Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compliance): updated the npm packages #1048

Merged
merged 1 commit into from Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5,069 changes: 2,730 additions & 2,339 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Expand Up @@ -8,16 +8,16 @@
"author": "Vinay Pulim <v@pulim.com>",
"dependencies": {
"bluebird": "^3.5.0",
"concat-stream": "^1.5.1",
"debug": "^2.6.9",
"concat-stream": "^2.0.0",
"debug": "^4.1.1",
"httpntlm": "^1.5.2",
"lodash": "^4.17.5",
"request": ">=2.9.0",
"sax": ">=0.6",
"serve-static": "^1.11.1",
"strip-bom": "~0.3.1",
"strip-bom": "^3.0.0",
"uuid": "^3.1.0",
"xml-crypto": "~0.8.0"
"xml-crypto": "^1.2.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -46,34 +46,34 @@
],
"license": "MIT",
"devDependencies": {
"@types/bluebird": "^3.5.25",
"@types/debug": "^4.1.1",
"@types/bluebird": "^3.5.26",
"@types/debug": "^4.1.2",
"@types/express": "^4.16.1",
"@types/lodash": "^4.14.121",
"@types/node": "^11.9.4",
"@types/lodash": "^4.14.122",
"@types/node": "^11.11.0",
"@types/request": "^2.48.1",
"@types/sax": "^1.0.1",
"@types/uuid": "^3.4.4",
"body-parser": "^1.15.2",
"colors": "^1.3.3",
"coveralls": "^3.0.2",
"diff": "^2.2.1",
"coveralls": "^3.0.3",
"diff": "^4.0.1",
"doctoc": "^1.4.0",
"duplexer": "~0.1.1",
"express": "^4.16.4",
"finalhandler": "^1.1.1",
"glob": "^7.1.3",
"jshint": "^2.10.1",
"mocha": "~5.2.0",
"nyc": "^11.4.1",
"mocha": "^6.0.2",
"nyc": "^13.3.0",
"readable-stream": "~2.0.2",
"semver": "~5.0.3",
"should": "~3.3.0",
"sinon": "^1.17.5",
"semver": "^5.6.0",
"should": "^13.2.3",
"sinon": "^1.17.7",
"source-map-support": "^0.5.10",
"timekeeper": "~0.0.4",
"tslint": "^5.12.1",
"timekeeper": "^2.1.2",
"tslint": "^5.13.1",
"typedoc": "^0.14.2",
"typescript": "^3.3.3"
"typescript": "^3.3.3333"
}
}
2 changes: 1 addition & 1 deletion test/mocha.opts
@@ -1,4 +1,4 @@
--reporter spec
--ui exports
--ui bdd
--require should
--require source-map-support/register
7 changes: 7 additions & 0 deletions test/security/BasicAuthSecurity.js
Expand Up @@ -14,6 +14,13 @@ describe('BasicAuthSecurity', function() {
new BasicAuthSecurity(username, password, {});
});

it('Should have Authorization header when addHeaders is invoked', function() {
var security = new BasicAuthSecurity(username, password, {});
var headers = {};
security.addHeaders(headers);
headers.should.have.property('Authorization');
});

it('is used in addOptions', function() {
var options = {};
var defaultOptions = { foo: 3 };
Expand Down
7 changes: 7 additions & 0 deletions test/security/BearerSecurity.js
Expand Up @@ -20,5 +20,12 @@ describe('BearerSecurity', function() {
instance.addOptions(options);
options.should.have.property("foo", 2);
});

it('should return the authoriation header on calling addHeader', () => {
const security = new BearerSecurity(token, {});
let headers = {};
security.addHeaders(headers);
headers.should.have.property('Authorization', "Bearer token");
});
});
});
42 changes: 42 additions & 0 deletions test/security/ClientSSLSecurity.js
Expand Up @@ -44,6 +44,48 @@ describe('ClientSSLSecurity', function() {
instance.should.have.property("key", keyBuffer);
});

it('should accept a String as argument for the key or cert', function () {
var certString = join(__dirname, '..', 'certs', 'agent2-cert.pem'),
keyString = join(__dirname, '..', 'certs', 'agent2-key.pem'),
certBuffer = fs.readFileSync(join(__dirname, '..', 'certs', 'agent2-cert.pem')),
keyBuffer = fs.readFileSync(join(__dirname, '..', 'certs', 'agent2-key.pem')),
instance;

instance = new ClientSSLSecurity(keyString, certString, certString);
instance.should.have.property("ca", certBuffer);
instance.should.have.property("cert", certBuffer);
instance.should.have.property("key", keyBuffer);
});

it('should not accept a integer as argument for the key', function () {
var instance;
try {
instance = new ClientSSLSecurity(10);
} catch(error) {
// do nothing
}
should(instance).not.be.ok();
});

it('should not accept a integer as argument for the key', function () {
var instance;
try {
instance = new ClientSSLSecurity(null, 10);
} catch(error) {
// do nothing
}
should(instance).not.be.ok();
});

it('should return blank string when call toXml', function () {
var certBuffer = fs.readFileSync(join(__dirname, '..', 'certs', 'agent2-cert.pem')),
keyBuffer = fs.readFileSync(join(__dirname, '..', 'certs', 'agent2-key.pem')),
instance;

instance = new ClientSSLSecurity(keyBuffer, certBuffer, certBuffer);
var xml = instance.toXML();
xml.should.be.exactly('');
});
it('should accept a Array as argument for the ca', function () {
var caList = [];
var instance = new ClientSSLSecurity(null, null, caList);
Expand Down
29 changes: 29 additions & 0 deletions test/security/ClientSSLSecurityPFX.js
Expand Up @@ -97,4 +97,33 @@ describe('ClientSSLSecurityPFX', function() {
instance = new ClientSSLSecurityPFX(pfkBuffer);
instance.should.have.property("pfx", pfkBuffer);
});

it('should return a blank when toXML is called', function () {
var pfkBuffer = fs.readFileSync(join(__dirname, '..', 'certs', 'pfk-buffer.pfx')),
instance;

instance = new ClientSSLSecurityPFX(pfkBuffer);
var xml = instance.toXML();
xml.should.be.exactly('');
});

it('should accept a String as argument for the pfx cert', function () {
var pfkBuffer = fs.readFileSync(join(__dirname, '..', 'certs', 'pfk-buffer.pfx')),
instance;

instance = new ClientSSLSecurityPFX(join(__dirname, '..', 'certs', 'pfk-buffer.pfx'));
instance.should.have.property("pfx", pfkBuffer);
});

it('should have an options with addOptions', function () {
var pfkBuffer = fs.readFileSync(join(__dirname, '..', 'certs', 'client-password.pfx')),
instance;

instance = new ClientSSLSecurityPFX(pfkBuffer, 'test2est');
var options = { foo: 5 };
instance.addOptions(options);
options.should.have.property("pfx", pfkBuffer);
options.should.have.property("passphrase", 'test2est');
options.should.have.property("foo", 5);
});
});