node-oauth2-server
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -103,3 +103,3 @@ /** | ||
var scheme = parts[0], | ||
credentials = new Buffer(parts[1], 'base64').toString(), | ||
credentials = new Buffer(parts[1], 'base64').toString().replace(/^\s+|\s+$/g, ""), | ||
index = credentials.indexOf(':'); | ||
@@ -106,0 +106,0 @@ |
{ | ||
"name": "node-oauth2-server", | ||
"description": "Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "oauth", |
@@ -94,2 +94,49 @@ /** | ||
}); | ||
it('should extract credentials from body', function (done) { | ||
var app = bootstrap({ | ||
model: { | ||
getClient: function (id, secret, callback) { | ||
try { | ||
id.should.equal('thom'); | ||
secret.should.equal('nightworld'); | ||
callback(false, false); | ||
} catch (e) { | ||
return done(e); | ||
} | ||
} | ||
}, | ||
grants: ['password'] | ||
}); | ||
request(app) | ||
.post('/oauth/token') | ||
.set('Content-Type', 'application/x-www-form-urlencoded') | ||
.send({ grant_type: 'password', client_id: 'thom', client_secret: 'nightworld' }) | ||
.expect(400, done); | ||
}); | ||
it('should extract credentials from header (Basic)', function (done) { | ||
var app = bootstrap({ | ||
model: { | ||
getClient: function (id, secret, callback) { | ||
try { | ||
id.should.equal('thom'); | ||
secret.should.equal('nightworld'); | ||
callback(false, false); | ||
} catch (e) { | ||
return done(e); | ||
} | ||
} | ||
}, | ||
grants: ['password'] | ||
}); | ||
request(app) | ||
.post('/oauth/token') | ||
.set('Authorization', 'Basic dGhvbTpuaWdodHdvcmxkCg==') | ||
.set('Content-Type', 'application/x-www-form-urlencoded') | ||
.send({ grant_type: 'password' }) | ||
.expect(400, done); | ||
}); | ||
}); | ||
@@ -102,5 +149,2 @@ | ||
getClient: function (id, secret, callback) { | ||
id.should.equal('thom'); | ||
secret.should.equal('nightworld'); | ||
callback(false, false); // Fake invalid | ||
@@ -107,0 +151,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
68185
1444
0