Skip to content

Commit a28fd97

Browse files
committed
Migration to passport-next
* Added CHANGELOG.md @rwky * Updated travis to use node 6, 8 and 10 @rwky * Removed uid2 dep replaced with node crypto @rwky * Replaced utils-merge with lodash * Updated README.md and package.json for passport-next org
1 parent a948096 commit a28fd97

File tree

10 files changed

+251
-65
lines changed

10 files changed

+251
-65
lines changed

.travis.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
language: "node_js"
22
node_js:
3-
- "5"
4-
- "4"
5-
- "3" # io.js
6-
- "2" # io.js
7-
- "1" # io.js
8-
- "0.12"
9-
- "0.10"
10-
- "0.8"
11-
- "0.6"
3+
- "6"
4+
- "8"
5+
- "10"
126

137

148
before_install:

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 1.5.0 (2018-06-29)
2+
3+
* Added CHANGELOG.md @rwky
4+
* Updated travis to use node 6, 8 and 10 @rwky
5+
* Removed uid2 dep replaced with node crypto @rwky
6+
* Replaced utils-merge with lodash
7+
* Updated README.md and package.json for passport-next org
8+

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
The MIT License (MIT)
22

3+
Copyright (c) 2018 Rowan Wookey <[email protected]>
34
Copyright (c) 2011-2016 Jared Hanson
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy of

README.md

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# passport-oauth2
22

3-
[![Build](https://img.shields.io/travis/jaredhanson/passport-oauth2.svg)](https://travis-ci.org/jaredhanson/passport-oauth2)
4-
[![Coverage](https://img.shields.io/coveralls/jaredhanson/passport-oauth2.svg)](https://coveralls.io/r/jaredhanson/passport-oauth2)
5-
[![Quality](https://img.shields.io/codeclimate/github/jaredhanson/passport-oauth2.svg?label=quality)](https://codeclimate.com/github/jaredhanson/passport-oauth2)
6-
[![Dependencies](https://img.shields.io/david/jaredhanson/passport-oauth2.svg)](https://david-dm.org/jaredhanson/passport-oauth2)
7-
3+
[![Build Status](https://travis-ci.org/passport-next/passport-oauth2.svg?branch=master)](https://travis-ci.org/passport-next/passport-oauth2)
4+
[![Coverage Status](https://coveralls.io/repos/github/passport-next/passport-oauth2/badge.svg?branch=master)](https://coveralls.io/github/passport-next/passport-oauth2?branch=master)
5+
[![Maintainability](https://api.codeclimate.com/v1/badges/5c6d93b9711897ef2949/maintainability)](https://codeclimate.com/github/passport-next/passport-oauth2/maintainability)
6+
[![Dependencies](https://david-dm.org/passport-next/passport-oauth2.png)](https://david-dm.org/passport-next/passport-oauth2)
7+
<!--[![SAST](https://gitlab.com/passport-next/passport-oauth2/badges/master/build.svg)](https://gitlab.com/passport-next/passport-oauth2/badges/master/build.svg)-->
88

99
General-purpose OAuth 2.0 authentication strategy for [Passport](http://passportjs.org/).
1010

@@ -27,7 +27,7 @@ list so other people can find it.
2727

2828
## Install
2929

30-
$ npm install passport-oauth2
30+
$ npm install @passport-next/passport-oauth2
3131

3232
## Usage
3333

@@ -75,12 +75,6 @@ app.get('/auth/example/callback',
7575
});
7676
```
7777

78-
## Related Modules
79-
80-
- [passport-oauth1](https://github.com/jaredhanson/passport-oauth1) — OAuth 1.0 authentication strategy
81-
- [passport-http-bearer](https://github.com/jaredhanson/passport-http-bearer) — Bearer token authentication strategy for APIs
82-
- [OAuth2orize](https://github.com/jaredhanson/oauth2orize) — OAuth 2.0 authorization server toolkit
83-
8478
## Contributing
8579

8680
#### Tests
@@ -103,24 +97,3 @@ executing:
10397
$ make test-cov
10498
$ make view-cov
10599
```
106-
107-
## Support
108-
109-
#### Funding
110-
111-
This software is provided to you as open source, free of charge. The time and
112-
effort to develop and maintain this project is dedicated by [@jaredhanson](https://github.com/jaredhanson).
113-
If you (or your employer) benefit from this project, please consider a financial
114-
contribution. Your contribution helps continue the efforts that produce this
115-
and other open source software.
116-
117-
Funds are accepted via [PayPal](https://paypal.me/jaredhanson), [Venmo](https://venmo.com/jaredhanson),
118-
and [other](http://jaredhanson.net/pay) methods. Any amount is appreciated.
119-
120-
## License
121-
122-
[The MIT License](http://opensource.org/licenses/MIT)
123-
124-
Copyright (c) 2011-2016 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>
125-
126-
<a target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/vK9dyjRnnWsMzzJTQ57fRJpH/jaredhanson/passport-oauth2'> <img alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/vK9dyjRnnWsMzzJTQ57fRJpH/jaredhanson/passport-oauth2.svg' /></a>

lib/state/session.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var uid = require('uid2');
1+
var crypto = require('crypto');
22

33
/**
44
* Creates an instance of `SessionStore`.
@@ -39,7 +39,7 @@ SessionStore.prototype.store = function(req, callback) {
3939
if (!req.session) { return callback(new Error('OAuth 2.0 authentication requires session support when using state. Did you forget to use express-session middleware?')); }
4040

4141
var key = this._key;
42-
var state = uid(24);
42+
var state = crypto.randomBytes(16).toString('hex');
4343
if (!req.session[key]) { req.session[key] = {}; }
4444
req.session[key].state = state;
4545
callback(null, state);

lib/strategy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Load modules.
2-
var passport = require('passport-strategy')
2+
var passport = require('@passport-next/passport-strategy')
33
, url = require('url')
44
, util = require('util')
55
, utils = require('./utils')

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports.merge = require('utils-merge');
1+
exports.merge = require('lodash').merge;
22

33
/**
44
* Reconstructs the original URL of the request.

package-lock.json

Lines changed: 212 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "passport-oauth2",
3-
"version": "1.4.0",
2+
"name": "@passport-next/passport-oauth2",
3+
"version": "1.5.0",
44
"description": "OAuth 2.0 authentication strategy for Passport.",
55
"keywords": [
66
"passport",
@@ -13,16 +13,15 @@
1313
"oauth2"
1414
],
1515
"author": {
16-
"name": "Jared Hanson",
17-
"email": "[email protected]",
18-
"url": "http://www.jaredhanson.net/"
16+
"name": "Rowan Wookey",
17+
"email": "[email protected]"
1918
},
2019
"repository": {
2120
"type": "git",
22-
"url": "git://github.com/jaredhanson/passport-oauth2.git"
21+
"url": "git://github.com/passport-next/passport-oauth2.git"
2322
},
2423
"bugs": {
25-
"url": "http://github.com/jaredhanson/passport-oauth2/issues"
24+
"url": "http://github.com/passport-next/passport-oauth2/issues"
2625
},
2726
"license": "MIT",
2827
"licenses": [
@@ -34,9 +33,8 @@
3433
"main": "./lib",
3534
"dependencies": {
3635
"oauth": "0.9.x",
37-
"passport-strategy": "1.x.x",
38-
"uid2": "0.0.x",
39-
"utils-merge": "1.x.x"
36+
"@passport-next/passport-strategy": "1.1.x",
37+
"lodash": "4.17.x"
4038
},
4139
"devDependencies": {
4240
"make-node": "0.3.x",
@@ -45,7 +43,7 @@
4543
"chai-passport-strategy": "1.x.x"
4644
},
4745
"engines": {
48-
"node": ">= 0.4.0"
46+
"node": ">= 6"
4947
},
5048
"scripts": {
5149
"test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js test/**/*.test.js"

0 commit comments

Comments
 (0)