Skip to content

Commit

Permalink
Migration to passport-next
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rwky committed Jun 29, 2018
1 parent a948096 commit a28fd97
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 65 deletions.
12 changes: 3 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
language: "node_js"
node_js:
- "5"
- "4"
- "3" # io.js
- "2" # io.js
- "1" # io.js
- "0.12"
- "0.10"
- "0.8"
- "0.6"
- "6"
- "8"
- "10"


before_install:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 1.5.0 (2018-06-29)

* 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 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
The MIT License (MIT)

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

Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
39 changes: 6 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# passport-oauth2

[![Build](https://img.shields.io/travis/jaredhanson/passport-oauth2.svg)](https://travis-ci.org/jaredhanson/passport-oauth2)
[![Coverage](https://img.shields.io/coveralls/jaredhanson/passport-oauth2.svg)](https://coveralls.io/r/jaredhanson/passport-oauth2)
[![Quality](https://img.shields.io/codeclimate/github/jaredhanson/passport-oauth2.svg?label=quality)](https://codeclimate.com/github/jaredhanson/passport-oauth2)
[![Dependencies](https://img.shields.io/david/jaredhanson/passport-oauth2.svg)](https://david-dm.org/jaredhanson/passport-oauth2)

[![Build Status](https://travis-ci.org/passport-next/passport-oauth2.svg?branch=master)](https://travis-ci.org/passport-next/passport-oauth2)
[![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)
[![Maintainability](https://api.codeclimate.com/v1/badges/5c6d93b9711897ef2949/maintainability)](https://codeclimate.com/github/passport-next/passport-oauth2/maintainability)
[![Dependencies](https://david-dm.org/passport-next/passport-oauth2.png)](https://david-dm.org/passport-next/passport-oauth2)
<!--[![SAST](https://gitlab.com/passport-next/passport-oauth2/badges/master/build.svg)](https://gitlab.com/passport-next/passport-oauth2/badges/master/build.svg)-->

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

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

## Install

$ npm install passport-oauth2
$ npm install @passport-next/passport-oauth2

## Usage

Expand Down Expand Up @@ -75,12 +75,6 @@ app.get('/auth/example/callback',
});
```

## Related Modules

- [passport-oauth1](https://github.com/jaredhanson/passport-oauth1) — OAuth 1.0 authentication strategy
- [passport-http-bearer](https://github.com/jaredhanson/passport-http-bearer) — Bearer token authentication strategy for APIs
- [OAuth2orize](https://github.com/jaredhanson/oauth2orize) — OAuth 2.0 authorization server toolkit

## Contributing

#### Tests
Expand All @@ -103,24 +97,3 @@ executing:
$ make test-cov
$ make view-cov
```

## Support

#### Funding

This software is provided to you as open source, free of charge. The time and
effort to develop and maintain this project is dedicated by [@jaredhanson](https://github.com/jaredhanson).
If you (or your employer) benefit from this project, please consider a financial
contribution. Your contribution helps continue the efforts that produce this
and other open source software.

Funds are accepted via [PayPal](https://paypal.me/jaredhanson), [Venmo](https://venmo.com/jaredhanson),
and [other](http://jaredhanson.net/pay) methods. Any amount is appreciated.

## License

[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2011-2016 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>

<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>
4 changes: 2 additions & 2 deletions lib/state/session.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var uid = require('uid2');
var crypto = require('crypto');

/**
* Creates an instance of `SessionStore`.
Expand Down Expand Up @@ -39,7 +39,7 @@ SessionStore.prototype.store = function(req, callback) {
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?')); }

var key = this._key;
var state = uid(24);
var state = crypto.randomBytes(16).toString('hex');
if (!req.session[key]) { req.session[key] = {}; }
req.session[key].state = state;
callback(null, state);
Expand Down
2 changes: 1 addition & 1 deletion lib/strategy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Load modules.
var passport = require('passport-strategy')
var passport = require('@passport-next/passport-strategy')
, url = require('url')
, util = require('util')
, utils = require('./utils')
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exports.merge = require('utils-merge');
exports.merge = require('lodash').merge;

/**
* Reconstructs the original URL of the request.
Expand Down
212 changes: 212 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "passport-oauth2",
"version": "1.4.0",
"name": "@passport-next/passport-oauth2",
"version": "1.5.0",
"description": "OAuth 2.0 authentication strategy for Passport.",
"keywords": [
"passport",
Expand All @@ -13,16 +13,15 @@
"oauth2"
],
"author": {
"name": "Jared Hanson",
"email": "[email protected]",
"url": "http://www.jaredhanson.net/"
"name": "Rowan Wookey",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "git://github.com/jaredhanson/passport-oauth2.git"
"url": "git://github.com/passport-next/passport-oauth2.git"
},
"bugs": {
"url": "http://github.com/jaredhanson/passport-oauth2/issues"
"url": "http://github.com/passport-next/passport-oauth2/issues"
},
"license": "MIT",
"licenses": [
Expand All @@ -34,9 +33,8 @@
"main": "./lib",
"dependencies": {
"oauth": "0.9.x",
"passport-strategy": "1.x.x",
"uid2": "0.0.x",
"utils-merge": "1.x.x"
"@passport-next/passport-strategy": "1.1.x",
"lodash": "4.17.x"
},
"devDependencies": {
"make-node": "0.3.x",
Expand All @@ -45,7 +43,7 @@
"chai-passport-strategy": "1.x.x"
},
"engines": {
"node": ">= 0.4.0"
"node": ">= 6"
},
"scripts": {
"test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js test/**/*.test.js"
Expand Down
Loading

0 comments on commit a28fd97

Please sign in to comment.