Comparing version 1.8.10 to 1.8.11
{ | ||
"name": "httpntlm", | ||
"description": "httpntlm is a Node.js library to do HTTP NTLM authentication", | ||
"version": "1.8.10", | ||
"version": "1.8.11", | ||
"dependencies": { | ||
@@ -39,3 +39,3 @@ "des.js": "^1.0.1", | ||
"scripts": { | ||
"jshint": "jshint *.js" | ||
"test": "mocha" | ||
}, | ||
@@ -53,7 +53,7 @@ "funding": [ | ||
"devDependencies": { | ||
"deep-equal": "^2.2.0", | ||
"express": "^4.18.2", | ||
"express-ntlm": "^2.6.2", | ||
"mocha": "^10.2.0", | ||
"rewire": "^6.0.0" | ||
} | ||
} |
103
README.md
@@ -7,2 +7,6 @@ # httpntlm | ||
## Snyk security scan | ||
[![Known Vulnerabilities](https://snyk.io/test/github/SamDecrock/node-http-ntlm/badge.svg)](https://snyk.io/test/github/SamDecrock/node-http-ntlm) | ||
## Donate | ||
@@ -12,2 +16,4 @@ | ||
If you've benefited from this module in any way, please consider donating! | ||
Thank you for your support! | ||
@@ -45,49 +51,2 @@ | ||
It supports __http__ and __https__. | ||
## pre-encrypt the password | ||
```js | ||
var httpntlm = require('httpntlm'); | ||
var ntlm = httpntlm.ntlm; | ||
var lm = ntlm.create_LM_hashed_password('Azx123456'); | ||
var nt = ntlm.create_NT_hashed_password('Azx123456'); | ||
console.log(lm); | ||
console.log(Array.prototype.slice.call(lm, 0)); | ||
lm = Buffer.from([ 183, 180, 19, 95, 163, 5, 118, 130, 30, 146, 159, 252, 1, 57, 81, 39 ]); | ||
console.log(lm); | ||
console.log(nt); | ||
console.log(Array.prototype.slice.call(nt, 0)); | ||
nt = Buffer.from([150, 27, 7, 219, 220, 207, 134, 159, 42, 60, 153, 28, 131, 148, 14, 1]); | ||
console.log(nt); | ||
httpntlm.get({ | ||
url: "https://someurl.com", | ||
username: 'm$', | ||
lm_password: lm, | ||
nt_password: nt, | ||
workstation: 'choose.something', | ||
domain: '' | ||
}, function (err, res){ | ||
if(err) return console.log(err); | ||
console.log(res.headers); | ||
console.log(res.body); | ||
}); | ||
/* you can save the array into your code and use it when you need it | ||
<Buffer b7 b4 13 5f a3 05 76 82 1e 92 9f fc 01 39 51 27>// before convert to array | ||
[ 183, 180, 19, 95, 163, 5, 118, 130, 30, 146, 159, 252, 1, 57, 81, 39 ]// convert to array | ||
<Buffer b7 b4 13 5f a3 05 76 82 1e 92 9f fc 01 39 51 27>//convert back to buffer | ||
<Buffer 96 1b 07 db dc cf 86 9f 2a 3c 99 1c 83 94 0e 01> | ||
[ 150, 27, 7, 219, 220, 207, 134, 159, 42, 60, 153, 28, 131, 148, 14, 1 ] | ||
<Buffer 96 1b 07 db dc cf 86 9f 2a 3c 99 1c 83 94 0e 01> | ||
*/ | ||
``` | ||
## Options | ||
@@ -119,2 +78,26 @@ | ||
### pre-encrypt the password | ||
```js | ||
var httpntlm = require('httpntlm'); | ||
var ntlm = httpntlm.ntlm; | ||
var lm = ntlm.create_LM_hashed_password('Azx123456'); | ||
var nt = ntlm.create_NT_hashed_password('Azx123456'); | ||
httpntlm.get({ | ||
url: "https://someurl.com", | ||
username: 'm$', | ||
lm_password: lm, | ||
nt_password: nt, | ||
workstation: 'choose.something', | ||
domain: '' | ||
}, function (err, res){ | ||
if(err) return console.log(err); | ||
console.log(res.headers); | ||
console.log(res.body); | ||
}); | ||
``` | ||
### Use the NTLM-functions yourself | ||
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example): | ||
@@ -176,3 +159,3 @@ | ||
## Download binary files | ||
### Download binary files | ||
@@ -196,3 +179,3 @@ ```js | ||
## Pass in custom headers | ||
### Pass in custom headers | ||
@@ -215,4 +198,8 @@ ```js | ||
}); | ||
```` | ||
``` | ||
### More examples | ||
You can find more examples on [Snyk](https://snyk.io/advisor/npm-package/httpntlm/example). | ||
## More information | ||
@@ -224,21 +211,15 @@ | ||
## Contributing | ||
## Tests | ||
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs. | ||
To run the unit tests, simply run | ||
Tests are written with Mocha. | ||
node ./tests/unittests.js | ||
To run tests, simply run: | ||
All tests should return `true` | ||
npm test | ||
To run the integration tests, first start the NTLM server with | ||
Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests. | ||
node ./tests/integrationtests-server.js | ||
Next, run the integration tests with: | ||
node ./tests/integrationtests.js | ||
## License (MIT) | ||
@@ -245,0 +226,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55426
8
932
238