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

Commit c0fefc8

Browse files
authored
Move to npm scope (#594)
1 parent b29b3d2 commit c0fefc8

16 files changed

Lines changed: 236 additions & 203 deletions

README.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
# feathers-authentication
1+
# @feathersjs/authentication
22

33
[![Greenkeeper badge](https://badges.greenkeeper.io/feathersjs/authentication.svg)](https://greenkeeper.io/)
44

55
[![Build Status](https://travis-ci.org/feathersjs/authentication.png?branch=master)](https://travis-ci.org/feathersjs/authentication)
6-
[![Maintainability](https://api.codeclimate.com/v1/badges/65abe50ec85244072ee9/maintainability)](https://codeclimate.com/github/feathersjs/authentication/maintainability)
76
[![Test Coverage](https://api.codeclimate.com/v1/badges/65abe50ec85244072ee9/test_coverage)](https://codeclimate.com/github/feathersjs/authentication/test_coverage)
87
[![Dependency Status](https://img.shields.io/david/feathersjs/authentication.svg?style=flat-square)](https://david-dm.org/feathersjs/authentication)
9-
[![Download Status](https://img.shields.io/npm/dm/feathers-authentication.svg?style=flat-square)](https://www.npmjs.com/package/feathers-authentication)
10-
[![Slack Status](http://slack.feathersjs.com/badge.svg)](http://slack.feathersjs.com)
8+
[![Download Status](https://img.shields.io/npm/dm/feathers-authentication.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/authentication)
119

1210
> Add Authentication to your FeathersJS app.
1311
14-
`feathers-authentication` adds shared [PassportJS](http://passportjs.org/) authentication for Feathers HTTP REST and WebSocket transports using [JSON Web Tokens](http://jwt.io/).
12+
`@feathersjs/authentication` adds shared [PassportJS](http://passportjs.org/) authentication for Feathers HTTP REST and WebSocket transports using [JSON Web Tokens](http://jwt.io/).
1513

1614

1715
## Installation
@@ -37,7 +35,7 @@ This module contains:
3735

3836
### Hooks
3937

40-
`feathers-authentication` only includes a single hook. This bundled `authenticate` hook is used to register an array of one or more authentication strategies on a service method.
38+
`@feathersjs/authentication` only includes a single hook. This bundled `authenticate` hook is used to register an array of one or more authentication strategies on a service method.
4139

4240
> **Note:** Most of the time you should be registering this on your `/authentication` service. Without it you can hit the `authentication` service and generate a JWT `accessToken` without authentication (ie. anonymous authentication).
4341
@@ -108,19 +106,19 @@ The following default options will be mixed in with your global `auth` object fr
108106

109107
The following plugins are complementary but entirely optional:
110108

111-
- [feathers-authentication-client](https://github.com/feathersjs/feathers-authentication-client)
112-
- [feathers-authentication-local](https://github.com/feathersjs/feathers-authentication-local)
113-
- [feathers-authentication-jwt](https://github.com/feathersjs/feathers-authentication-jwt)
114-
- [feathers-authentication-oauth1](https://github.com/feathersjs/feathers-authentication-oauth1)
115-
- [feathers-authentication-oauth2](https://github.com/feathersjs/feathers-authentication-oauth2)
116-
- [feathers-authentication-hooks](https://github.com/feathersjs/feathers-authentication-hooks)
109+
- [feathers-authentication-client](https://github.com/feathersjs/authentication-client)
110+
- [feathers-authentication-local](https://github.com/feathersjs/authentication-local)
111+
- [feathers-authentication-jwt](https://github.com/feathersjs/authentication-jwt)
112+
- [feathers-authentication-oauth1](https://github.com/feathersjs/authentication-oauth1)
113+
- [feathers-authentication-oauth2](https://github.com/feathersjs/authentication-oauth2)
114+
- [feathers-authentication-hooks](https://github.com/feathersjs/authentication-hooks)
117115
- [feathers-permissions](https://github.com/feathersjs/feathers-permissions)
118116

119117
## Migrating to 1.x
120118
Refer to [the migration guide](./docs/migrating.md).
121119

122120
## Complete Example
123-
Here's an example of a Feathers server that uses `feathers-authentication` for local auth. You can try it out on your own machine by running the [example](./example/).
121+
Here's an example of a Feathers server that uses `@feathersjs/authentication` for local auth. You can try it out on your own machine by running the [example](./example/).
124122

125123
**Note:** This does NOT implement any authorization. Use [feathers-permissions](https://github.com/feathersjs/feathers-permissions) for that.
126124

@@ -135,7 +133,7 @@ const errors = require('feathers-errors');
135133
const errorHandler = require('feathers-errors/handler');
136134
const local = require('feathers-authentication-local');
137135
const jwt = require('feathers-authentication-jwt');
138-
const auth = require('feathers-authentication');
136+
const auth = require('@feathersjs/authentication');
139137

140138
const app = feathers();
141139
app.configure(rest())

docs/migrating.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ We've also decoupled the authentication strategies and permissions from the core
88

99
They are now located here:
1010

11-
- [feathers-authentication-client](https://github.com/feathersjs/feathers-authentication-client)
12-
- [feathers-authentication-local](https://github.com/feathersjs/feathers-authentication-local)
13-
- [feathers-authentication-jwt](https://github.com/feathersjs/feathers-authentication-jwt)
14-
- [feathers-authentication-oauth1](https://github.com/feathersjs/feathers-authentication-oauth1)
15-
- [feathers-authentication-oauth2](https://github.com/feathersjs/feathers-authentication-oauth2)
16-
- [feathers-authentication-hooks](https://github.com/feathersjs/feathers-authentication-hooks)
11+
- [feathers-authentication-client](https://github.com/feathersjs/authentication-client)
12+
- [feathers-authentication-local](https://github.com/feathersjs/authentication-local)
13+
- [feathers-authentication-jwt](https://github.com/feathersjs/authentication-jwt)
14+
- [feathers-authentication-oauth1](https://github.com/feathersjs/authentication-oauth1)
15+
- [feathers-authentication-oauth2](https://github.com/feathersjs/authentication-oauth2)
16+
- [feathers-authentication-hooks](https://github.com/feathersjs/authentication-hooks)
1717
- [feathers-permissions](https://github.com/feathersjs/feathers-permissions) **(experimental)**
1818

1919
For most of you, migrating your app should be fairly straight forward as there are only a couple breaking changes to the public interface.
@@ -27,7 +27,7 @@ For most of you, migrating your app should be fairly straight forward as there a
2727
**The Old Way (< v0.8.0)**
2828

2929
```js
30-
// feathers-authentication < v0.8.0
30+
// @feathersjs/authentication < v0.8.0
3131

3232
// In your config files
3333
{
@@ -47,7 +47,7 @@ For most of you, migrating your app should be fairly straight forward as there a
4747
}
4848

4949
// In your authentication service
50-
const authentication = require('feathers-authentication');
50+
const authentication = require('@feathersjs/authentication');
5151
const FacebookStrategy = require('passport-facebook').Strategy;
5252

5353
let config = app.get('authentication');
@@ -59,7 +59,7 @@ app.configure(authentication(config))
5959
**The New Way**
6060

6161
```js
62-
// feathers-authentication >= v1.0.0
62+
// @feathersjs/authentication >= v1.0.0
6363

6464
// In your config files
6565
{
@@ -74,7 +74,7 @@ app.configure(authentication(config))
7474
}
7575

7676
// In your app or authentication service, wherever you would like
77-
const auth = require('feathers-authentication');
77+
const auth = require('@feathersjs/authentication');
7878
const local = require('feathers-authentication-local');
7979
const jwt = require('feathers-authentication-jwt');
8080
const oauth1 = require('feathers-authentication-oauth1');
@@ -155,15 +155,15 @@ Authenticating through the Feathers client is almost exactly the same with just
155155

156156
- `type` is now `strategy` when calling `authenticate()` and must be an exact name match of one of your strategies registered server side.
157157
- You must fetch your user explicitly (typically after authentication succeeds)
158-
- You require `feathers-authentication-client` instead of `feathers-authentication/client`
158+
- You require `feathers-authentication-client` instead of `@feathersjs/authentication/client`
159159

160160
You can use `feathers-authentication-compatibility` on the server to keep the old client functional, this helps to migrate large scale deployments where you can not update all clients/api consumers before migrating to `>=1.0.0` Check https://www.npmjs.com/package/feathers-authentication-compatibility for more information.
161161

162162
**The Old Way (< v0.8.0)**
163163

164164
```js
165-
// feathers-authentication < v0.8.0
166-
const auth = require('feathers-authentication/client');
165+
// @feathersjs/authentication < v0.8.0
166+
const auth = require('@feathersjs/authentication/client');
167167
app.configure(auth());
168168

169169
app.authenticate({
@@ -266,7 +266,7 @@ app.configure(authentication({
266266
}));
267267
```
268268

269-
If you want to customize things further you can refer to the [`feathers-authentication-jwt`](https://github.com/feathersjs/feathers-authentication-jwt) module or implement your own custom passport JWT strategy.
269+
If you want to customize things further you can refer to the [`feathers-authentication-jwt`](https://github.com/feathersjs/authentication-jwt) module or implement your own custom passport JWT strategy.
270270

271271
## Hook Changes
272272

@@ -282,7 +282,7 @@ For the JWT strategy, this hook has different behavior from the old hooks: it wi
282282

283283
### Removed Hooks
284284

285-
We have removed all of the old authentication hooks. If you still need these they have been moved to the [feathers-authentication-hooks](https://github.com/feathersjs/feathers-authentication-hooks) repo and some of them have been deprecated.
285+
We have removed all of the old authentication hooks. If you still need these they have been moved to the [feathers-authentication-hooks](https://github.com/feathersjs/authentication-hooks) repo and some of them have been deprecated.
286286

287287
The following hooks have been removed:
288288

@@ -298,9 +298,9 @@ The following hooks have been removed:
298298
Typically you saw a lot of this in your hook definitions for a service:
299299

300300
```js
301-
// feathers-authentication < v0.8.0
301+
// @feathersjs/authentication < v0.8.0
302302
// Users service
303-
const auth = require('feathers-authentication').hooks;
303+
const auth = require('@feathersjs/authentication').hooks;
304304
exports.before = {
305305
all: [],
306306
find: [
@@ -336,8 +336,8 @@ exports.before = {
336336
**The New Way**
337337

338338
```js
339-
// feathers-authentication >= v1.0.0
340-
const auth = require('feathers-authentication');
339+
// @feathersjs/authentication >= v1.0.0
340+
const auth = require('@feathersjs/authentication');
341341
const local = require('feathers-authentication-local');
342342
const {
343343
queryWithCurrentUser,

docs/new-1.0-features.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ app.configure(authentication({
2525
We've added more helpful warning messages and added debug logs for every hook, service, and middleware. We use the [debug]() module so usage is the same.
2626

2727
#### Turning on all auth logs
28-
You can turn on all auth debug logs by running your app with `DEBUG=feathers-authentication* npm start`.
28+
You can turn on all auth debug logs by running your app with `DEBUG=@feathersjs/authentication* npm start`.
2929

3030
#### Turning on logs for a specific type
31-
If you want to only turn on logs for a `hooks`, `express`, `passport` or `service` you can do `DEBUG=feathers-authentication:<type>* npm start`. For example,
31+
If you want to only turn on logs for a `hooks`, `express`, `passport` or `service` you can do `DEBUG=@feathersjs/authentication:<type>* npm start`. For example,
3232

3333
```
34-
`DEBUG=feathers-authentication:hooks* npm start`
34+
`DEBUG=@feathersjs/authentication:hooks* npm start`
3535
```
3636

3737
#### Turning on logs for a specific entity
38-
If you want to only turn on logs for a specific hook, middleware or service you can do `DEBUG=feathers-authentication:<type>:<entity> npm start`. For example,
38+
If you want to only turn on logs for a specific hook, middleware or service you can do `DEBUG=@feathersjs/authentication:<type>:<entity> npm start`. For example,
3939

4040
```
41-
`DEBUG=feathers-authentication:hooks:authenticate npm start`
41+
`DEBUG=@feathersjs/authentication:hooks:authenticate npm start`
4242
```
4343

4444
## More Flexible Tokens

example/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# feathers-authentication Example
1+
# @feathersjs/authentication Example
22

3-
This provides a complete working example of some of the basic usage of `feathers-authentication`.
3+
This provides a complete working example of some of the basic usage of `@feathersjs/authentication`.
44

55
1. Start the app by running `npm start`
66
2. Make a request using the authenticated user.
@@ -9,4 +9,4 @@ This provides a complete working example of some of the basic usage of `feathers
99
curl -H "Content-Type: application/json" -X POST -d '{"email":"admin@feathersjs.com","password":"admin"}' http://localhost:3030/authentication
1010
```
1111

12-
For more details refer to the [`test/integration`](../test/integration) folder to see how you can authenticate with the server or refer to the [feathers-authentication-client](https://github.com/feathersjs/feathers-authentication-client).
12+
For more details refer to the [`test/integration`](../test/integration) folder to see how you can authenticate with the server or refer to the [feathers-authentication-client](https://github.com/feathersjs/authentication-client).

lib/express/authenticate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const errors = require('@feathersjs/errors');
22
const Debug = require('debug');
3-
const debug = Debug('feathers-authentication:express:authenticate');
3+
const debug = Debug('@feathersjs/authentication:express:authenticate');
44

55
module.exports = function authenticate (strategy, options = {}) {
66
// TODO (EK): Support arrays of strategies

lib/hooks/authenticate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const errors = require('@feathersjs/errors');
22
const Debug = require('debug');
33
const merge = require('lodash.merge');
4-
const debug = Debug('feathers-authentication:hooks:authenticate');
4+
const debug = Debug('@feathersjs/authentication:hooks:authenticate');
55

66
module.exports = function authenticate (strategies, options = {}) {
77
if (!strategies) {

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const getOptions = require('./options');
77
const service = require('./service');
88
const socket = require('./socket');
99

10-
const debug = Debug('feathers-authentication:index');
10+
const debug = Debug('@feathersjs/authentication:index');
1111

1212
module.exports = function init (config = {}) {
1313
return function authentication () {

lib/passport/authenticate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const makeDebug = require('debug');
22

3-
const debug = makeDebug('feathers-authentication:passport:authenticate');
3+
const debug = makeDebug('@feathersjs/authentication:passport:authenticate');
44

55
module.exports = function authenticate (options = {}) {
66
debug('Initializing custom passport authenticate', options);

lib/passport/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const initialize = require('./initialize');
22
const authenticate = require('./authenticate');
33
const makeDebug = require('debug');
44

5-
const debug = makeDebug('feathers-authentication:passport');
5+
const debug = makeDebug('@feathersjs/authentication:passport');
66

77
module.exports = function feathersPassport (options) {
88
const app = this;

lib/passport/initialize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const {
55
verifyJWT
66
} = require('../utils');
77

8-
const debug = makeDebug('feathers-authentication:passport:initialize');
8+
const debug = makeDebug('@feathersjs/authentication:passport:initialize');
99

1010
module.exports = function initialize (options = {}) {
1111
// const app = this;

0 commit comments

Comments
 (0)