Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http-auth

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-auth - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

41

lib/auth/digest.js

@@ -95,23 +95,28 @@ /**

// Checking response for username.
var ha1 = util.md5(this.users[co.username]);
// If algorithm is MD5-sess.
if(co.algorithm == 'MD5-sess') {
ha1 = util.md5(ha1 + ":" + co.nonce + ":" + co.cnonce);
}
// If qop is specified.
if(co.qop) {
if(co.nc > this.nonces[co.nonce]) {
// Updating nonce count.
this.nonces[co.nonce] = co.nc;
var userHash = this.users[co.username];
// Username is correct.
if(userHash) {
var ha1 = util.md5(userHash);
// If algorithm is MD5-sess.
if(co.algorithm == 'MD5-sess') {
ha1 = util.md5(ha1 + ":" + co.nonce + ":" + co.cnonce);
}
// If qop is specified.
if(co.qop) {
if(co.nc > this.nonces[co.nonce]) {
// Updating nonce count.
this.nonces[co.nonce] = co.nc;
// Evaluating final authentication response.
var authRes = util.md5(ha1 + ":" + co.nonce + ":" + co.nc + ":" + co.cnonce + ":" + co.qop + ":" + ha2);
authenticated = (authRes == co.response);
}
} else {
// Evaluating final authentication response.
var authRes = util.md5(ha1 + ":" + co.nonce + ":" + co.nc + ":" + co.cnonce + ":" + co.qop + ":" + ha2);
var authRes = util.md5(ha1 + ":" + co.nonce + ":" + ha2);
authenticated = (authRes == co.response);
}
} else {
// Evaluating final authentication response.
var authRes = util.md5(ha1 + ":" + co.nonce + ":" + ha2);
authenticated = (authRes == co.response);
}

@@ -118,0 +123,0 @@ }

{
"name": "http-auth",
"description": "Module for HTTP basic and digest access authentication.",
"version": "1.0.1",
"description": "Node.js module for HTTP basic and digest access authentication.",
"version": "1.0.2",
"author": "Gevorg Harutyunyan",

@@ -12,3 +12,3 @@ "maintainers": [

],
"homepage": "https://github.com/gevorg/http-auth",
"homepage": "http://gevorg.me/http-auth.html",
"repository": {

@@ -15,0 +15,0 @@ "type": "git",

# http-auth
Module for HTTP basic and digest access authentication.
[Node.js](http://nodejs.org/) module for HTTP basic and digest access authentication.

@@ -13,19 +13,6 @@ ## Installation

$ npm install http-auth
## Usage
Digest access authentication usage:
--------------------
/**
* HTTP authentication module.
*/
var auth = require('http-auth');
## Digest access authentication usage
/**
* HTTP module.
*/
var http = require('http');
/**
* Requesting new digest access authentication instance.

@@ -48,20 +35,6 @@ */

}).listen(1337);
// Log url.
console.log('Server running at http://127.0.0.1:1337/');
Basic access authentication usage:
--------------------
/**
* HTTP authentication module.
*/
var auth = require('http-auth');
## Basic access authentication usage
/**
* HTTP module.
*/
var http = require('http');
/**
* Requesting new basic access authentication instance.

@@ -83,20 +56,6 @@ */

}).listen(1337);
// Log url.
console.log('Server running at http://127.0.0.1:1337/');
You can load users from file:
--------------------
/**
* HTTP authentication module.
*/
var auth = require('http-auth');
## You can load users from file
/**
* HTTP module.
*/
var http = require('http');
/**
* Requesting new digest access authentication instance.

@@ -119,19 +78,5 @@ */

// Log url.
console.log('Server running at http://127.0.0.1:1337/');
You can also use it with [express framework](http://expressjs.com/):
--------------------
/**
* HTTP authentication module.
*/
var auth = require('http-auth');
## You can also use it with [express framework](http://expressjs.com/)
/**
* Express module.
*/
var express = require('express');
/**
* Requesting new digest access authentication instance.

@@ -144,9 +89,4 @@ */

});
/**
* Creating new server.
*/
var app = express.createServer();
/**
* Handler for digest path, with digest access authentication.

@@ -157,12 +97,3 @@ */

});
/**
* Start listenning 1337 port.
*/
app.listen(1337);
// Log url.
console.log('Server running at http://127.0.0.1:1337/');
## Configurations

@@ -169,0 +100,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc