@feathersjs/authentication 5.0.0-pre.3 → 5.0.0-pre.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/service.js CHANGED
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -19,15 +10,17 @@ const core_1 = require("./core");
19
10
  const hooks_1 = require("./hooks");
20
11
  require("@feathersjs/transport-commons");
21
12
  const commons_1 = require("@feathersjs/commons");
13
+ const schema_1 = require("@feathersjs/schema");
22
14
  const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
23
- const debug = commons_1.createDebug('@feathersjs/authentication/service');
15
+ const debug = (0, commons_1.createDebug)('@feathersjs/authentication/service');
24
16
  class AuthenticationService extends core_1.AuthenticationBase {
25
17
  constructor(app, configKey = 'authentication', options = {}) {
26
18
  super(app, configKey, options);
27
19
  if (typeof app.defaultAuthentication !== 'function') {
28
20
  app.defaultAuthentication = function (location) {
29
21
  const configKey = app.get('defaultAuthentication');
30
- const path = location || Object.keys(this.services).find(current => this.service(current).configKey === configKey);
22
+ const path = location ||
23
+ Object.keys(this.services).find((current) => this.service(current).configKey === configKey);
31
24
  return path ? this.service(path) : null;
32
25
  };
33
26
  }
@@ -39,12 +32,10 @@ class AuthenticationService extends core_1.AuthenticationBase {
39
32
  * @param _authResult The current authentication result
40
33
  * @param params The service call parameters
41
34
  */
42
- getPayload(_authResult, params) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- // Uses `params.payload` or returns an empty payload
45
- const { payload = {} } = params;
46
- return payload;
47
- });
35
+ async getPayload(_authResult, params) {
36
+ // Uses `params.payload` or returns an empty payload
37
+ const { payload = {} } = params;
38
+ return payload;
48
39
  }
49
40
  /**
50
41
  * Returns the JWT options based on an authentication result.
@@ -53,22 +44,20 @@ class AuthenticationService extends core_1.AuthenticationBase {
53
44
  * @param authResult The authentication result
54
45
  * @param params Service call parameters
55
46
  */
56
- getTokenOptions(authResult, params) {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- const { service, entity, entityId } = this.configuration;
59
- const jwtOptions = merge_1.default({}, params.jwtOptions, params.jwt);
60
- const value = service && entity && authResult[entity];
61
- // Set the subject to the entity id if it is available
62
- if (value && !jwtOptions.subject) {
63
- const idProperty = entityId || this.app.service(service).id;
64
- const subject = value[idProperty];
65
- if (subject === undefined) {
66
- throw new errors_1.NotAuthenticated(`Can not set subject from ${entity}.${idProperty}`);
67
- }
68
- jwtOptions.subject = `${subject}`;
47
+ async getTokenOptions(authResult, params) {
48
+ const { service, entity, entityId } = this.configuration;
49
+ const jwtOptions = (0, merge_1.default)({}, params.jwtOptions, params.jwt);
50
+ const value = service && entity && authResult[entity];
51
+ // Set the subject to the entity id if it is available
52
+ if (value && !jwtOptions.subject) {
53
+ const idProperty = entityId || this.app.service(service).id;
54
+ const subject = value[idProperty];
55
+ if (subject === undefined) {
56
+ throw new errors_1.NotAuthenticated(`Can not set subject from ${entity}.${idProperty}`);
69
57
  }
70
- return jwtOptions;
71
- });
58
+ jwtOptions.subject = `${subject}`;
59
+ }
60
+ return jwtOptions;
72
61
  }
73
62
  /**
74
63
  * Create and return a new JWT for a given authentication request.
@@ -77,30 +66,30 @@ class AuthenticationService extends core_1.AuthenticationBase {
77
66
  * @param data The authentication request (should include `strategy` key)
78
67
  * @param params Service call parameters
79
68
  */
80
- create(data, params) {
81
- return __awaiter(this, void 0, void 0, function* () {
82
- const authStrategies = params.authStrategies || this.configuration.authStrategies;
83
- if (!authStrategies.length) {
84
- throw new errors_1.NotAuthenticated('No authentication strategies allowed for creating a JWT (`authStrategies`)');
85
- }
86
- const authResult = yield this.authenticate(data, params, ...authStrategies);
87
- debug('Got authentication result', authResult);
88
- if (authResult.accessToken) {
89
- return authResult;
69
+ async create(data, params) {
70
+ const authStrategies = params.authStrategies || this.configuration.authStrategies;
71
+ if (!authStrategies.length) {
72
+ throw new errors_1.NotAuthenticated('No authentication strategies allowed for creating a JWT (`authStrategies`)');
73
+ }
74
+ const authResult = await this.authenticate(data, params, ...authStrategies);
75
+ debug('Got authentication result', authResult);
76
+ if (authResult.accessToken) {
77
+ return authResult;
78
+ }
79
+ const [payload, jwtOptions] = await Promise.all([
80
+ this.getPayload(authResult, params),
81
+ this.getTokenOptions(authResult, params)
82
+ ]);
83
+ debug('Creating JWT with', payload, jwtOptions);
84
+ const accessToken = await this.createAccessToken(payload, jwtOptions, params.secret);
85
+ return {
86
+ accessToken,
87
+ ...authResult,
88
+ authentication: {
89
+ ...authResult.authentication,
90
+ payload: jsonwebtoken_1.default.decode(accessToken)
90
91
  }
91
- const [payload, jwtOptions] = yield Promise.all([
92
- this.getPayload(authResult, params),
93
- this.getTokenOptions(authResult, params)
94
- ]);
95
- debug('Creating JWT with', payload, jwtOptions);
96
- const accessToken = yield this.createAccessToken(payload, jwtOptions, params.secret);
97
- return merge_1.default({ accessToken }, authResult, {
98
- authentication: {
99
- accessToken,
100
- payload: jsonwebtoken_1.default.decode(accessToken)
101
- }
102
- });
103
- });
92
+ };
104
93
  }
105
94
  /**
106
95
  * Mark a JWT as removed. By default only verifies the JWT and returns the result.
@@ -109,53 +98,48 @@ class AuthenticationService extends core_1.AuthenticationBase {
109
98
  * @param id The JWT to remove or null
110
99
  * @param params Service call parameters
111
100
  */
112
- remove(id, params) {
113
- return __awaiter(this, void 0, void 0, function* () {
114
- const { authentication } = params;
115
- const { authStrategies } = this.configuration;
116
- // When an id is passed it is expected to be the authentication `accessToken`
117
- if (id !== null && id !== authentication.accessToken) {
118
- throw new errors_1.NotAuthenticated('Invalid access token');
119
- }
120
- debug('Verifying authentication strategy in remove');
121
- return this.authenticate(authentication, params, ...authStrategies);
122
- });
101
+ async remove(id, params) {
102
+ const { authentication } = params;
103
+ const { authStrategies } = this.configuration;
104
+ // When an id is passed it is expected to be the authentication `accessToken`
105
+ if (id !== null && id !== authentication.accessToken) {
106
+ throw new errors_1.NotAuthenticated('Invalid access token');
107
+ }
108
+ debug('Verifying authentication strategy in remove');
109
+ return this.authenticate(authentication, params, ...authStrategies);
123
110
  }
124
111
  /**
125
112
  * Validates the service configuration.
126
113
  */
127
- setup() {
128
- return __awaiter(this, void 0, void 0, function* () {
129
- // The setup method checks for valid settings and registers the
130
- // connection and event (login, logout) hooks
131
- const { secret, service, entity, entityId } = this.configuration;
132
- if (typeof secret !== 'string') {
133
- throw new Error('A \'secret\' must be provided in your authentication configuration');
114
+ async setup() {
115
+ await super.setup();
116
+ // The setup method checks for valid settings and registers the
117
+ // connection and event (login, logout) hooks
118
+ const { secret, service, entity, entityId } = this.configuration;
119
+ if (typeof secret !== 'string') {
120
+ throw new Error("A 'secret' must be provided in your authentication configuration");
121
+ }
122
+ if (entity !== null) {
123
+ if (service === undefined) {
124
+ throw new Error("The 'service' option is not set in the authentication configuration");
134
125
  }
135
- if (entity !== null) {
136
- if (service === undefined) {
137
- throw new Error('The \'service\' option is not set in the authentication configuration');
138
- }
139
- if (this.app.service(service) === undefined) {
140
- throw new Error(`The '${service}' entity service does not exist (set to 'null' if it is not required)`);
141
- }
142
- if (this.app.service(service).id === undefined && entityId === undefined) {
143
- throw new Error(`The '${service}' service does not have an 'id' property and no 'entityId' option is set.`);
144
- }
126
+ if (this.app.service(service) === undefined) {
127
+ throw new Error(`The '${service}' entity service does not exist (set to 'null' if it is not required)`);
145
128
  }
146
- this.hooks({
147
- after: {
148
- create: [hooks_1.connection('login'), hooks_1.event('login')],
149
- remove: [hooks_1.connection('logout'), hooks_1.event('logout')]
150
- }
151
- });
152
- this.app.on('disconnect', (connection) => __awaiter(this, void 0, void 0, function* () {
153
- yield this.handleConnection('disconnect', connection);
154
- }));
155
- if (typeof this.publish === 'function') {
156
- this.publish(() => null);
129
+ if (this.app.service(service).id === undefined && entityId === undefined) {
130
+ throw new Error(`The '${service}' service does not have an 'id' property and no 'entityId' option is set.`);
157
131
  }
132
+ }
133
+ this.hooks({
134
+ create: [(0, schema_1.resolveDispatch)(), (0, hooks_1.connection)('login'), (0, hooks_1.event)('login')],
135
+ remove: [(0, schema_1.resolveDispatch)(), (0, hooks_1.connection)('logout'), (0, hooks_1.event)('logout')]
136
+ });
137
+ this.app.on('disconnect', async (connection) => {
138
+ await this.handleConnection('disconnect', connection);
158
139
  });
140
+ if (typeof this.publish === 'function') {
141
+ this.publish(() => null);
142
+ }
159
143
  }
160
144
  }
161
145
  exports.AuthenticationService = AuthenticationService;
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yDAAiC;AACjC,+CAAsD;AACtD,iCAAyF;AACzF,mCAA4C;AAC5C,yCAAuC;AACvC,iDAAkD;AAElD,gEAAwC;AAExC,MAAM,KAAK,GAAG,qBAAW,CAAC,oCAAoC,CAAC,CAAC;AAsBhE,MAAa,qBAAsB,SAAQ,yBAAkB;IAC3D,YAAa,GAAQ,EAAE,SAAS,GAAG,gBAAgB,EAAE,OAAO,GAAG,EAAE;QAC/D,KAAK,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAE/B,IAAI,OAAO,GAAG,CAAC,qBAAqB,KAAK,UAAU,EAAE;YACnD,GAAG,CAAC,qBAAqB,GAAG,UAAU,QAAiB;gBACrD,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;gBACn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AAU,EAAE,EAAE;YAC7C,MAAM,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA;QACvD,CAAC,CAAC,CAAA;QAEF,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE;YACtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;SACzB;IACH,CAAC;CACF;AAtKD,sDAsKC"}
package/lib/strategy.d.ts CHANGED
@@ -8,5 +8,5 @@ export declare class AuthenticationBaseStrategy implements AuthenticationStrateg
8
8
  setApplication(app: Application): void;
9
9
  setName(name: string): void;
10
10
  get configuration(): any;
11
- get entityService(): Service<any>;
11
+ get entityService(): Service;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"strategy.js","sourceRoot":"","sources":["../src/strategy.ts"],"names":[],"mappings":";;;AAGA,MAAa,0BAA0B;IAKrC,iBAAiB,CAAE,IAAwB;QACzC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;IAED,cAAc,CAAE,GAAgB;QAC9B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,OAAO,CAAE,IAAY;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,aAAa;QACf,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QAEvC,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;IAC3C,CAAC;CACF;AA9BD,gEA8BC"}
1
+ {"version":3,"file":"strategy.js","sourceRoot":"","sources":["../src/strategy.ts"],"names":[],"mappings":";;;AAGA,MAAa,0BAA0B;IAKrC,iBAAiB,CAAC,IAAwB;QACxC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAA;IAC5B,CAAC;IAED,cAAc,CAAC,GAAgB;QAC7B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrD,CAAC;IAED,IAAI,aAAa;QACf,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;QAEtC,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,IAAI,CAAA;SACZ;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,CAAA;IAC1C,CAAC;CACF;AA9BD,gEA8BC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@feathersjs/authentication",
3
3
  "description": "Add Authentication to your FeathersJS app.",
4
- "version": "5.0.0-pre.3",
4
+ "version": "5.0.0-pre.30",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/",
7
7
  "types": "lib/",
@@ -16,7 +16,8 @@
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git://github.com/feathersjs/feathers.git"
19
+ "url": "git://github.com/feathersjs/feathers.git",
20
+ "directory": "packages/authentication"
20
21
  },
21
22
  "author": {
22
23
  "name": "Feathers contributors",
@@ -41,9 +42,9 @@
41
42
  },
42
43
  "scripts": {
43
44
  "prepublish": "npm run compile",
44
- "compile": "shx rm -rf lib/ && tsc",
45
- "test": "npm run compile && npm run mocha",
46
- "mocha": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
45
+ "pack": "npm pack --pack-destination ../cli/test/build",
46
+ "compile": "shx rm -rf lib/ && tsc && npm run pack",
47
+ "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
47
48
  },
48
49
  "directories": {
49
50
  "lib": "lib"
@@ -52,27 +53,27 @@
52
53
  "access": "public"
53
54
  },
54
55
  "dependencies": {
55
- "@feathersjs/commons": "^5.0.0-pre.3",
56
- "@feathersjs/errors": "^5.0.0-pre.3",
57
- "@feathersjs/feathers": "^5.0.0-pre.3",
58
- "@feathersjs/transport-commons": "^5.0.0-pre.3",
59
- "@types/jsonwebtoken": "^8.5.1",
56
+ "@feathersjs/commons": "^5.0.0-pre.30",
57
+ "@feathersjs/errors": "^5.0.0-pre.30",
58
+ "@feathersjs/feathers": "^5.0.0-pre.30",
59
+ "@feathersjs/schema": "^5.0.0-pre.30",
60
+ "@feathersjs/transport-commons": "^5.0.0-pre.30",
61
+ "@types/jsonwebtoken": "^8.5.9",
60
62
  "jsonwebtoken": "^8.5.1",
61
63
  "lodash": "^4.17.21",
62
64
  "long-timeout": "^0.1.1",
63
- "uuid": "^8.3.2"
65
+ "uuid": "^9.0.0"
64
66
  },
65
67
  "devDependencies": {
66
- "@feathersjs/adapter-memory": "^5.0.0-pre.3",
67
- "@types/debug": "^4.1.5",
68
- "@types/lodash": "^4.14.168",
69
- "@types/mocha": "^8.2.2",
70
- "@types/node": "^14.14.41",
71
- "@types/uuid": "^8.3.0",
72
- "mocha": "^8.3.2",
73
- "shx": "^0.3.3",
74
- "ts-node": "^9.1.1",
75
- "typescript": "^4.2.4"
68
+ "@feathersjs/memory": "^5.0.0-pre.30",
69
+ "@types/lodash": "^4.14.186",
70
+ "@types/mocha": "^10.0.0",
71
+ "@types/node": "^18.8.2",
72
+ "@types/uuid": "^8.3.4",
73
+ "mocha": "^10.0.0",
74
+ "shx": "^0.3.4",
75
+ "ts-node": "^10.9.1",
76
+ "typescript": "^4.8.4"
76
77
  },
77
- "gitHead": "d332eaca9945aab0c222413a7e46cec1c0601648"
78
+ "gitHead": "b535c91197f4b997520e0a0e608793eeba791931"
78
79
  }