Permalink
Browse files

Upgrade to new plugin format.

  • Loading branch information...
1 parent f0bd586 commit 40f93626cb262387eca6ee2f0ab538e301bdb701 @marshallswain marshallswain committed Nov 15, 2015
Showing with 330 additions and 118 deletions.
  1. BIN .DS_Store
  2. +3 −0 .babelrc
  3. +13 −0 .editorconfig
  4. +28 −26 .jshintrc
  5. +3 −6 .npmignore
  6. +2 −3 .travis.yml
  7. +17 −17 LICENSE
  8. +19 −17 README.md
  9. +22 −22 package.json
  10. +197 −0 src/hooks.js
  11. +22 −23 lib/feathers-authentication.js → src/index.js
  12. +4 −4 test/server-fixtures.js
View
Binary file not shown.
View
@@ -0,0 +1,3 @@
+{
+ "presets": [ "es2015" ]
+}
View
@@ -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
View
@@ -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
+ }
}
View
@@ -1,7 +1,4 @@
-.git*
-docs/
+.idea/
+src/
test/
-.DS_Store
-*.markdown
-*.md
-.idea
+!lib/
View
@@ -1,5 +1,4 @@
language: node_js
node_js:
- - "0.10"
- - "node"
- - "iojs"
+ - 'node'
+ - 'iojs'
View
@@ -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.
View
@@ -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({
@@ -29,7 +32,7 @@ var app = feathers()
admin: {type: Boolean, default: false }
},
before:{
- create: [feathersPassportJwt.hashPassword('password')]
+ create: [feathersAuth.hashPassword('password')]
}
}))
```
@@ -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()
@@ -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
@@ -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).
View
@@ -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",
@@ -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"
Oops, something went wrong.

0 comments on commit 40f9362

Please sign in to comment.