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

node-oauth2-server

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-oauth2-server - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

test.js

6

package.json
{
"name": "node-oauth2-server",
"description": "Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js",
"version": "1.5.0",
"version": "1.5.1",
"keywords": [

@@ -38,3 +38,7 @@ "oauth",

"test": "mocha"
},
"repository": {
"type": "git",
"url": "https://github.com/nightworld/node-oauth2-server.git"
}
}

28

test/authorizeRequest.js

@@ -54,3 +54,3 @@ /**

.get('/')
.expect(/the access token was not found/i, 400, done);
.expect(400, /the access token was not found/i, done);
});

@@ -64,3 +64,3 @@

.set('Authorization', 'Bearer thom')
.expect(/the access token provided is invalid/i, 400, done);
.expect(400, /the access token provided is invalid/i, done);
});

@@ -74,3 +74,3 @@

.set('Authorization', 'Invalid')
.expect(/malformed auth header/i, 400, done);
.expect(400, /malformed auth header/i, done);
});

@@ -85,3 +85,3 @@

.send({ access_token: 'thom' })
.expect(/content type must be application\/x-www-form-urlencoded/i, 400, done);
.expect(400, /content type must be application\/x-www-form-urlencoded/i, done);
});

@@ -96,3 +96,3 @@

.send({ access_token: 'thom' })
.expect(/the access token provided is invalid/i, 400, done);
.expect(400, /the access token provided is invalid/i, done);
});

@@ -106,3 +106,3 @@

.send({ access_token: 'thom' })
.expect(/method cannot be GET/i, 400, done);
.expect(400, /method cannot be GET/i, done);
});

@@ -115,3 +115,3 @@

.get('/?access_token=thom')
.expect(/the access token provided is invalid/i, 400, done);
.expect(400, /the access token provided is invalid/i, done);
});

@@ -125,3 +125,3 @@

.set('Authorization', 'Invalid')
.expect(/only one method may be used/i, 400, done);
.expect(400, /only one method may be used/i, done);
});

@@ -135,3 +135,3 @@

.set('Authorization', 'Invalid')
.expect(/only one method may be used/i, 400, done);
.expect(400, /only one method may be used/i, done);
});

@@ -147,3 +147,3 @@ });

.get('/?access_token=thom')
.expect(/the access token provided is invalid/i, 400, done);
.expect(400, /the access token provided is invalid/i, done);
});

@@ -162,3 +162,3 @@

.get('/?access_token=thom')
.expect(/the access token provided has expired/i, 400, done);
.expect(400, /the access token provided has expired/i, done);
});

@@ -181,3 +181,3 @@

.get('/?access_token=thom')
.expect(/nightworld/, 200, done);
.expect(200, /nightworld/, done);
});

@@ -200,3 +200,3 @@

.get('/?access_token=thom')
.expect(/nightworld/, 200, done);
.expect(200, /nightworld/, done);
});

@@ -223,5 +223,5 @@ });

.get('/?access_token=thom')
.expect(/nightworld/, 200, done);
.expect(200, /nightworld/, done);
});
});

@@ -54,3 +54,3 @@ /**

.get('/oauth/token')
.expect(/method must be POST/i, 400, done);
.expect(400, /method must be POST/i, done);
});

@@ -65,3 +65,3 @@

.send({}) // Required to be valid JSON
.expect(/application\/x-www-form-urlencoded/i, 400, done);
.expect(400, /application\/x-www-form-urlencoded/i, done);
});

@@ -75,3 +75,3 @@

.set('Content-Type', 'application/x-www-form-urlencoded')
.expect(/invalid or missing grant_type parameter/i, 400, done);
.expect(400, /invalid or missing grant_type parameter/i, done);
});

@@ -86,3 +86,3 @@

.send({ grant_type: 'password' })
.expect(/invalid or missing grant_type parameter/i, 400, done);
.expect(400, /invalid or missing grant_type parameter/i, done);
});

@@ -97,3 +97,3 @@

.send({ grant_type: 'password' })
.expect(/invalid or missing client_id parameter/i, 400, done);
.expect(400, /invalid or missing client_id parameter/i, done);
});

@@ -108,3 +108,3 @@

.send({ grant_type: 'password', client_id: 'thom' })
.expect(/missing client_secret parameter/i, 400, done);
.expect(400, /missing client_secret parameter/i, done);
});

@@ -175,3 +175,3 @@

.send({ grant_type: 'password', client_id: 'thom', client_secret: 'nightworld' })
.expect(/client credentials are invalid/i, 400, done);
.expect(400, /client credentials are invalid/i, done);
});

@@ -198,3 +198,3 @@ });

.send({ grant_type: 'password', client_id: 'thom', client_secret: 'nightworld' })
.expect(/grant type is unauthorised for this client_id/i, 400, done);
.expect(400, /grant type is unauthorised for this client_id/i, done);
});

@@ -226,3 +226,3 @@ });

})
.expect(/missing parameters. \\"username\\" and \\"password\\"/i, 400, done);
.expect(400, /missing parameters. \\"username\\" and \\"password\\"/i, done);

@@ -253,3 +253,3 @@ });

.send(validBody)
.expect(/user credentials are invalid/i, 400, done);
.expect(400, /user credentials are invalid/i, done);

@@ -281,3 +281,3 @@ });

})
.expect(/no \\"refresh_token\\" parameter/i, 400, done);
.expect(400, /no \\"refresh_token\\" parameter/i, done);

@@ -311,3 +311,3 @@ });

})
.expect(/invalid refresh token/i, 400, done);
.expect(400, /invalid refresh token/i, done);

@@ -341,3 +341,3 @@ });

})
.expect(/invalid refresh token/i, 400, done);
.expect(400, /invalid refresh token/i, done);

@@ -374,3 +374,3 @@ });

})
.expect(/refresh token has expired/i, 400, done);
.expect(400, /refresh token has expired/i, done);

@@ -417,3 +417,3 @@ });

})
.expect(/"access_token": "(.*)",\n\s+"refresh_token": "(.*)"/i, 400, done);
.expect(200, /"access_token": "(.*)",\n\s+"refresh_token": "(.*)"/i, done);

@@ -460,3 +460,3 @@ });

})
.expect(/"access_token": "(.*)",\n\s+"refresh_token": "(.*)"/i, 400, done);
.expect(200, /"access_token": "(.*)",\n\s+"refresh_token": "(.*)"/i, done);

@@ -488,3 +488,3 @@ });

})
.expect(/invalid grant_type/i, 400, done);
.expect(400, /invalid grant_type/i, done);
});

@@ -516,3 +516,3 @@

})
.expect(/invalid grant_type/i, 400, done);
.expect(400, /invalid grant_type/i, done);
});

@@ -544,3 +544,3 @@

})
.expect(/invalid request/i, 400, done);
.expect(400, /invalid request/i, done);
});

@@ -596,3 +596,3 @@

.send({ grant_type: 'implicit', client_id: 'thom', client_secret: 'nightworld' })
.expect(/invalid grant_type/i, 400, done);
.expect(400, /invalid grant_type/i, done);
});

@@ -599,0 +599,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