Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Commit

Permalink
Upgrade to new plugin format.
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallswain committed Nov 15, 2015
1 parent f0bd586 commit 40f9362
Show file tree
Hide file tree
Showing 12 changed files with 330 additions and 118 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .babelrc
@@ -0,0 +1,3 @@
{
"presets": [ "es2015" ]
}
13 changes: 13 additions & 0 deletions .editorconfig
@@ -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
54 changes: 28 additions & 26 deletions .jshintrc
@@ -1,28 +1,30 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": false,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": "nofunc",
"newcap": false,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": false,
"trailing": true,
"smarttabs": true,
"white": false,
"globals": {
"it": true,
"describe": true,
"before": true,
"after": true,
"exports": true
}
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": "nofunc",
"newcap": false,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": false,
"trailing": true,
"smarttabs": true,
"white": false,
"node": true,
"globals": {
"it": true,
"describe": true,
"before": true,
"beforeEach": true,
"after": true,
"afterEach": true
}
}
9 changes: 3 additions & 6 deletions .npmignore
@@ -1,7 +1,4 @@
.git*
docs/
.idea/
src/
test/
.DS_Store
*.markdown
*.md
.idea
!lib/
5 changes: 2 additions & 3 deletions .travis.yml
@@ -1,5 +1,4 @@
language: node_js
node_js:
- "0.10"
- "node"
- "iojs"
- 'node'
- 'iojs'
34 changes: 17 additions & 17 deletions LICENSE
@@ -1,22 +1,22 @@
The MIT License (MIT)

Copyright 2015 Marshall Thompson
Copyright (c) 2015 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:
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 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.

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.
36 changes: 19 additions & 17 deletions README.md
@@ -1,25 +1,28 @@
# Feathers Passport-JWT
# feathers-authentication

[![Build Status](https://travis-ci.org/feathersjs/feathers-passport-jwt.png?branch=master)](https://travis-ci.org/feathersjs/feathers-passport-jwt)
[![Build Status](https://travis-ci.org/feathersjs/feathers-authentication.png?branch=master)](https://travis-ci.org/feathersjs/feathers-authentication)

feathers-passport-jwt adds shared [PassportJS](http://passportjs.org/) authentication for Feathers HTTP REST and websockets services using [JSON Web Tokens](http://jwt.io/).
> Add Authentication to your FeathersJS app.
`feathers-authentication` adds shared [PassportJS](http://passportjs.org/) authentication for Feathers HTTP REST and websockets services using [JSON Web Tokens](http://jwt.io/).

## Usage
If you are using the default options, setting up JWT auth for your Feathers app is as simple as the below example. Note: You must set up the `body-parser` module before setting up `feathers-passport-jwt`.
If you are using the default options, setting up JWT auth for your Feathers app is as simple as the below example. Note: You must set up the `body-parser` module before setting up `feathers-authentication`.

```js
var feathers = require('feathers');
var hooks = require('feathers-hooks');
var bodyParser = require('body-parser');
var feathersPassportJwt = require('feathers-passport-jwt');
var feathersAuth = require('feathers-authentication');
var mongooseService = require('feathers-mongoose');

var app = feathers()
.configure(feathers.rest())
.configure(feathers.socketio())
.configure(hooks())
.use(bodyParser.urlencoded({ extended: true }))
// Configure feathers-passport-jwt
.configure(feathersPassportJwt({
// Configure feathers-authentication
.configure(feathersAuth({
secret: 'feathers-rocks'
}))
.use('/api/users', mongooseService({
Expand All @@ -29,7 +32,7 @@ var app = feathers()
admin: {type: Boolean, default: false }
},
before:{
create: [feathersPassportJwt.hashPassword('password')]
create: [feathersAuth.hashPassword('password')]
}
}))
```
Expand Down Expand Up @@ -79,8 +82,8 @@ var passport = require('passport');
var hooks = require('feathers-hooks');
var memory = require('feathers-memory');
var bodyParser = require('body-parser');
var feathersPassportJwt = require('feathers-passport-jwt');
var hashPassword = feathersPassportJwt.hashPassword;
var feathersAuth = require('feathers-authentication');
var hashPassword = feathersAuth.hashPassword;

// Initialize the application
var app = feathers()
Expand All @@ -89,8 +92,8 @@ var app = feathers()
.configure(hooks())
// Needed for parsing bodies (login)
.use(bodyParser.urlencoded({ extended: true }))
// Configure feathers-passport-jwt
.configure(feathersPassportJwt({
// Configure feathers-authentication
.configure(feathersAuth({
secret: 'feathers-rocks'
}))
// Initialize a user service
Expand Down Expand Up @@ -153,18 +156,17 @@ Add a `login.html` with an HTML form that allows to log our user in:
</html>
```

## About


## Changelog

__1.0.0__

- Initial release

## Author

- [Marshall Thompson](https://github.com/marshallswain)

## License

Copyright (c) 2015 Marshall Thompson
Copyright (c) 2015

Licensed under the [MIT license](LICENSE).
44 changes: 22 additions & 22 deletions package.json
@@ -1,50 +1,48 @@
{
"name": "feathers-authentication",
"version": "1.0.6",
"description": "Feathers REST and websocket authentication using JSON Web Tokens (JWT) with PassportJS.",
"description": "Add Authentication to your FeathersJS app.",
"version": "0.0.0",
"homepage": "https://github.com/feathersjs/feathers-authentication",
"main": "lib/",
"keywords": [
"feathers-plugin",
"feathers"
],
"licenses": [
{
"type": "MIT",
"url": "https://github.com/feathersjs/feathers-authentication/blob/master/LICENSE"
}
"feathers",
"feathers-plugin"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/feathersjs/feathers-authentication.git"
},
"author": {
"name": "Marshall Thompson",
"email": "marshall@creativeideal.net",
"name": "Feathers contributors",
"email": "hello@feathersjs.com",
"url": "https://feathersjs.com"
},
"contributors": [],
"bugs": {
"url": "https://github.com/feathersjs/feathers-authentication/issues"
},
"engines": {
"node": ">=0.10.0"
"node": ">= 0.12.0"
},
"main": "lib/feathers-authentication.js",
"scripts": {
"publish": "git push origin --tags",
"prepublish": "npm run compile",
"publish": "git push origin && git push origin --tags",
"release:patch": "npm version patch && npm publish",
"release:minor": "npm version minor && npm publish",
"release:major": "npm version major && npm publish",
"jshint": "jshint lib/. test/. --config",
"mocha": "mocha test/ --recursive",
"compile": "rm -rf lib/ && babel -d lib/ src/",
"watch": "babel --watch -d lib/ src/",
"jshint": "jshint src/. test/. --config",
"mocha": "mocha test/ --compilers js:babel-core/register",
"test": "npm run jshint && npm run mocha"
},
"directories": {
"lib": "lib"
},
"dependencies": {
"bcrypt": "^0.8.5",
"debug": "^2.0.0",
"debug": "^2.2.0",
"feathers-hooks": "^0.4.0",
"jsonwebtoken": "^5.4.0",
"lodash": "^2.4.1",
Expand All @@ -53,12 +51,14 @@
},
"devDependencies": {
"async": "^1.4.2",
"babel-cli": "^6.1.18",
"babel-core": "^6.1.21",
"babel-preset-es2015": "^6.1.18",
"body-parser": "^1.9.0",
"feathers": "^1.0.0",
"feathers": "^1.2.0",
"feathers-memory": "^0.3.4",
"jshint": "^2.7.0",
"mocha": "^2.2.4",
"q": "^1.4.1",
"jshint": "^2.8.0",
"mocha": "^2.3.3",
"request": "^2.44.0",
"socket.io-client": "^1.1.0",
"xmlhttprequest": "^1.6.0"
Expand Down

0 comments on commit 40f9362

Please sign in to comment.