This repository has been archived by the owner on Sep 11, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d892b2d
Showing
12 changed files
with
256 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"plugins": [ "add-module-exports" ], | ||
"presets": [ "es2015" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Commenting this out is preferred by some people, see | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
# The compiled/babelified modules | ||
lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
verbose: false | ||
instrumentation: | ||
root: ./src/ | ||
excludes: | ||
- lib/ | ||
include-all-sources: true | ||
reporting: | ||
print: summary | ||
reports: | ||
- html | ||
- text | ||
- lcov | ||
watermarks: | ||
statements: [50, 80] | ||
lines: [50, 80] | ||
functions: [50, 80] | ||
branches: [50, 80] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.editorconfig | ||
.jshintrc | ||
.travis.yml | ||
.istanbul.yml | ||
.babelrc | ||
.idea/ | ||
src/ | ||
test/ | ||
!lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: node_js | ||
node_js: | ||
- 'node' | ||
- '6' | ||
- '4' | ||
addons: | ||
code_climate: | ||
repo_token: 'your repo token' | ||
before_script: | ||
- npm install -g codeclimate-test-reporter | ||
after_script: | ||
- codeclimate-test-reporter < coverage/lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Feathers | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# feathers-authentication-oauth2 | ||
|
||
[![Build Status](https://travis-ci.org/feathersjs/feathers-authentication-oauth2.png?branch=master)](https://travis-ci.org/feathersjs/feathers-authentication-oauth2) | ||
[![Code Climate](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth2/badges/gpa.svg)](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth2) | ||
[![Test Coverage](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth2/badges/coverage.svg)](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth2/coverage) | ||
[![Issue Count](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth2/badges/issue_count.svg)](https://codeclimate.com/github/feathersjs/feathers-authentication-oauth2) | ||
[![Dependency Status](https://img.shields.io/david/feathersjs/feathers-authentication-oauth2.svg?style=flat-square)](https://david-dm.org/feathersjs/feathers-authentication-oauth2) | ||
[![Download Status](https://img.shields.io/npm/dm/feathers-authentication-oauth2.svg?style=flat-square)](https://www.npmjs.com/package/feathers-authentication-oauth2) | ||
|
||
> A Feathers OAuth2 authentication provider | ||
## Installation | ||
|
||
``` | ||
npm install feathers-authentication-oauth2 --save | ||
``` | ||
|
||
## Documentation | ||
|
||
Please refer to the [feathers-authentication-oauth2 documentation](http://docs.feathersjs.com/) for more details. | ||
|
||
## Complete Example | ||
|
||
Here's an example of a Feathers server that uses `feathers-authentication-oauth2`. | ||
|
||
```js | ||
const feathers = require('feathers'); | ||
const rest = require('feathers-rest'); | ||
const hooks = require('feathers-hooks'); | ||
const bodyParser = require('body-parser'); | ||
const errorHandler = require('feathers-errors/handler'); | ||
const plugin = require('feathers-authentication-oauth2'); | ||
|
||
// Initialize the application | ||
const app = feathers() | ||
.configure(rest()) | ||
.configure(hooks()) | ||
// Needed for parsing bodies (login) | ||
.use(bodyParser.json()) | ||
.use(bodyParser.urlencoded({ extended: true })) | ||
// Initialize your feathers plugin | ||
.use('/plugin', plugin()) | ||
.use(errorHandler()); | ||
|
||
app.listen(3030); | ||
|
||
console.log('Feathers app started on 127.0.0.1:3030'); | ||
``` | ||
|
||
## License | ||
|
||
Copyright (c) 2016 | ||
|
||
Licensed under the [MIT license](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--recursive test/ | ||
--compilers js:babel-core/register |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"name": "feathers-authentication-oauth2", | ||
"description": "A Feathers OAuth2 authentication provider", | ||
"version": "0.0.0", | ||
"homepage": "https://github.com/feathersjs/feathers-authentication-oauth2", | ||
"main": "lib/", | ||
"keywords": [ | ||
"feathers", | ||
"feathers-plugin" | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/feathersjs/feathers-authentication-oauth2.git" | ||
}, | ||
"author": { | ||
"name": "Feathers contributors", | ||
"email": "hello@feathersjs.com", | ||
"url": "https://feathersjs.com" | ||
}, | ||
"contributors": [], | ||
"bugs": { | ||
"url": "https://github.com/feathersjs/feathers-authentication-oauth2/issues" | ||
}, | ||
"engines": { | ||
"node": ">= 4.6.0" | ||
}, | ||
"scripts": { | ||
"prepublish": "npm run compile", | ||
"publish": "git push origin --tags && npm run changelog && git push origin", | ||
"release:patch": "npm version patch && npm publish", | ||
"release:minor": "npm version minor && npm publish", | ||
"release:major": "npm version major && npm publish", | ||
"changelog": "github_changelog_generator && git add CHANGELOG.md && git commit -am \"Updating changelog\"", | ||
"compile": "rimraf lib/ && babel -d lib/ src/", | ||
"watch": "babel --watch -d lib/ src/", | ||
"lint": "semistandard src/**/*.js test/**/*.js --fix", | ||
"mocha": "mocha --opts mocha.opts", | ||
"coverage": "istanbul cover _mocha -- --opts mocha.opts", | ||
"test": "npm run compile && npm run lint && npm run coverage", | ||
"start": "npm run compile && node example/app" | ||
}, | ||
"semistandard": { | ||
"sourceType": "module", | ||
"env": [ | ||
"mocha" | ||
] | ||
}, | ||
"directories": { | ||
"lib": "lib" | ||
}, | ||
"dependencies": { | ||
"debug": "^2.2.0", | ||
"feathers-errors": "^2.4.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.16.0", | ||
"babel-core": "^6.17.0", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-preset-es2015": "^6.16.0", | ||
"chai": "^3.5.0", | ||
"istanbul": "^1.1.0-alpha.1", | ||
"mocha": "^3.1.2", | ||
"rimraf": "^2.5.4", | ||
"semistandard": "^9.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// import errors from 'feathers-errors'; | ||
import makeDebug from 'debug'; | ||
|
||
const debug = makeDebug('feathers-authentication-oauth2'); | ||
|
||
export default function init () { | ||
debug('Initializing feathers-authentication-oauth2 plugin'); | ||
|
||
return 'feathers-authentication-oauth2'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { expect } from 'chai'; | ||
import plugin from '../src'; | ||
|
||
describe('feathers-authentication-oauth2', () => { | ||
it('is CommonJS compatible', () => { | ||
expect(typeof require('../lib')).to.equal('function'); | ||
}); | ||
|
||
it('basic functionality', () => { | ||
expect(typeof plugin).to.equal('function', 'It worked'); | ||
expect(plugin()).to.equal('feathers-authentication-oauth2'); | ||
}); | ||
}); |