@feathersjs/authentication 5.0.0-pre.11 → 5.0.0-pre.17

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/CHANGELOG.md CHANGED
@@ -3,6 +3,65 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15)
7
+
8
+ **Note:** Version bump only for package @feathersjs/authentication
9
+
10
+
11
+
12
+
13
+
14
+ # [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12)
15
+
16
+
17
+ ### Features
18
+
19
+ * **express, koa:** make transports similar ([#2486](https://github.com/feathersjs/feathers/issues/2486)) ([26aa937](https://github.com/feathersjs/feathers/commit/26aa937c114fb8596dfefc599b1f53cead69c159))
20
+
21
+
22
+
23
+
24
+
25
+ # [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110))
31
+
32
+
33
+ ### Features
34
+
35
+ * **authentication-oauth:** Allow dynamic oAuth redirect ([#2469](https://github.com/feathersjs/feathers/issues/2469)) ([b7143d4](https://github.com/feathersjs/feathers/commit/b7143d4c0fbe961e714f79512be04449b9bbd7d9))
36
+
37
+
38
+
39
+
40
+
41
+ # [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13)
42
+
43
+ **Note:** Version bump only for package @feathersjs/authentication
44
+
45
+
46
+
47
+
48
+
49
+ # [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13)
50
+
51
+ **Note:** Version bump only for package @feathersjs/authentication
52
+
53
+
54
+
55
+
56
+
57
+ # [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12)
58
+
59
+ **Note:** Version bump only for package @feathersjs/authentication
60
+
61
+
62
+
63
+
64
+
6
65
  # [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06)
7
66
 
8
67
  **Note:** Version bump only for package @feathersjs/authentication
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Feathers
3
+ Copyright (c) 2022 Feathers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # @feathersjs/authentication
2
2
 
3
3
  [![CI](https://github.com/feathersjs/feathers/workflows/CI/badge.svg)](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI)
4
- [![Dependency Status](https://img.shields.io/david/feathersjs/feathers.svg?style=flat-square&path=packages/authentication)](https://david-dm.org/feathersjs/feathers?path=packages/authentication)
5
4
  [![Download Status](https://img.shields.io/npm/dm/@feathersjs/authentication.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/authentication)
6
5
 
7
6
  > Add Authentication to your FeathersJS app.
@@ -18,6 +17,6 @@ Refer to the [Feathers authentication API documentation](https://docs.feathersjs
18
17
 
19
18
  ## License
20
19
 
21
- Copyright (c) 2021 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
20
+ Copyright (c) 2022 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
22
21
 
23
22
  Licensed under the [MIT license](LICENSE).
package/lib/core.d.ts CHANGED
@@ -98,6 +98,13 @@ export declare class AuthenticationBase {
98
98
  * @param names The list or strategy names
99
99
  */
100
100
  getStrategies(...names: string[]): AuthenticationStrategy[];
101
+ /**
102
+ * Returns a single strategy by name
103
+ *
104
+ * @param name The strategy name
105
+ * @returns The authentication strategy or undefined
106
+ */
107
+ getStrategy(name: string): AuthenticationStrategy;
101
108
  /**
102
109
  * Create a new access token with payload and options.
103
110
  *
package/lib/core.js CHANGED
@@ -77,6 +77,15 @@ class AuthenticationBase {
77
77
  return names.map(name => this.strategies[name])
78
78
  .filter(current => !!current);
79
79
  }
80
+ /**
81
+ * Returns a single strategy by name
82
+ *
83
+ * @param name The strategy name
84
+ * @returns The authentication strategy or undefined
85
+ */
86
+ getStrategy(name) {
87
+ return this.strategies[name];
88
+ }
80
89
  /**
81
90
  * Create a new access token with payload and options.
82
91
  *
package/lib/core.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;AAAA,yDAAiC;AACjC,gEAAgF;AAChF,+BAAoC;AACpC,+CAAsD;AACtD,iDAAkD;AAGlD,wDAAuC;AAEvC,MAAM,KAAK,GAAG,IAAA,qBAAW,EAAC,iCAAiC,CAAC,CAAC;AAiE7D;;GAEG;AACH,MAAa,kBAAkB;IAO7B;;;;;;OAMG;IACH,YAAa,GAAgB,EAAE,SAAS,GAAG,gBAAgB,EAAE,OAAO,GAAG,EAAE;QACvE,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,UAAU,EAAE;YACzC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;SAC3F;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,GAAG,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAI,SAAS,CAAC,CAAC;QAChF,GAA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AAE,UAAiC;QAChG,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aACnE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,gBAAgB,KAAK,UAAU,CAAC,CAAC;QAErE,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE;YACjC,MAAM,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;SAChE;IACH,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,CAAE,GAAoB,EAAE,GAAmB,EAAE,GAAG,KAAe;QACxE,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;aAC5C,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC;QAE1D,KAAK,CAAC,+DAA+D,EAAE,KAAK,CAAC,CAAC;QAE9E,KAAK,MAAM,YAAY,IAAI,UAAU,EAAE;YACrC,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAEjD,IAAI,KAAK,KAAK,IAAI,EAAE;gBAClB,OAAO,KAAK,CAAC;aACd;SACF;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAxMD,gDAwMC"}
@@ -1,7 +1,7 @@
1
1
  import { HookContext, NextFunction } from '@feathersjs/feathers';
2
2
  export interface AuthenticateHookSettings {
3
3
  service?: string;
4
- strategies: string[];
4
+ strategies?: string[];
5
5
  }
6
- declare const _default: (originalSettings: string | AuthenticateHookSettings, ...originalStrategies: string[]) => (context: HookContext<any, any>, _next?: NextFunction) => Promise<any>;
6
+ declare const _default: (originalSettings: string | AuthenticateHookSettings, ...originalStrategies: string[]) => (context: HookContext, _next?: NextFunction) => Promise<any>;
7
7
  export default _default;
@@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AAI,EAAE,CAAC;SACf;QAED,IAAI,cAAc,EAAE;YAClB,MAAM,UAAU,GAAG,IAAA,cAAI,EAAC,MAAM,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;YAE9D,KAAK,CAAC,qBAAqB,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;YAEzD,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,cAAc,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,CAAC;YAE7F,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAA,cAAI,EAAC,UAAU,EAAE,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;SACtG;aAAM,IAAI,QAAQ,EAAE;YACnB,MAAM,IAAI,yBAAgB,CAAC,mBAAmB,CAAC,CAAC;SACjD;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- import * as hooks from './hooks';
2
- declare const authenticate: (originalSettings: string | import("./hooks/authenticate").AuthenticateHookSettings, ...originalStrategies: string[]) => (context: import("@feathersjs/feathers/lib").HookContext<any, any>, _next?: import("@feathersjs/hooks/lib").NextFunction) => Promise<any>;
3
- export { hooks };
4
- export { authenticate };
1
+ export * as hooks from './hooks';
2
+ export { authenticate } from './hooks';
5
3
  export { AuthenticationBase, AuthenticationRequest, AuthenticationResult, AuthenticationStrategy, ConnectionEvent } from './core';
6
4
  export { AuthenticationBaseStrategy } from './strategy';
7
5
  export { AuthenticationService } from './service';
package/lib/index.js CHANGED
@@ -20,10 +20,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.JWTStrategy = exports.AuthenticationService = exports.AuthenticationBaseStrategy = exports.AuthenticationBase = exports.authenticate = exports.hooks = void 0;
23
- const hooks = __importStar(require("./hooks"));
24
- exports.hooks = hooks;
25
- const { authenticate } = hooks;
26
- exports.authenticate = authenticate;
23
+ exports.hooks = __importStar(require("./hooks"));
24
+ var hooks_1 = require("./hooks");
25
+ Object.defineProperty(exports, "authenticate", { enumerable: true, get: function () { return hooks_1.authenticate; } });
27
26
  var core_1 = require("./core");
28
27
  Object.defineProperty(exports, "AuthenticationBase", { enumerable: true, get: function () { return core_1.AuthenticationBase; } });
29
28
  var strategy_1 = require("./strategy");
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAIxB,sBAAK;AAFd,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;AAGtB,oCAAY;AACrB,+BAMgB;AALd,0GAAA,kBAAkB,OAAA;AAMpB,uCAAwD;AAA/C,sHAAA,0BAA0B,OAAA;AACnC,qCAAkD;AAAzC,gHAAA,qBAAqB,OAAA;AAC9B,6BAAoC;AAA3B,kGAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAiC;AACjC,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AACrB,+BAMgB;AALd,0GAAA,kBAAkB,OAAA;AAMpB,uCAAwD;AAA/C,sHAAA,0BAA0B,OAAA;AACnC,qCAAkD;AAAzC,gHAAA,qBAAqB,OAAA;AAC9B,6BAAoC;AAA3B,kGAAA,WAAW,OAAA"}
package/lib/service.d.ts CHANGED
@@ -2,7 +2,7 @@ import { AuthenticationBase, AuthenticationResult, AuthenticationRequest } from
2
2
  import '@feathersjs/transport-commons';
3
3
  import { Params, ServiceMethods, ServiceAddons } from '@feathersjs/feathers';
4
4
  declare module '@feathersjs/feathers/lib/declarations' {
5
- interface FeathersApplication<ServiceTypes, AppSettings> {
5
+ interface FeathersApplication<Services, Settings> {
6
6
  /**
7
7
  * Returns the default authentication service or the
8
8
  * authentication service for a given path.
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
  }
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.11",
4
+ "version": "5.0.0-pre.17",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/",
7
7
  "types": "lib/",
@@ -52,26 +52,26 @@
52
52
  "access": "public"
53
53
  },
54
54
  "dependencies": {
55
- "@feathersjs/commons": "^5.0.0-pre.11",
56
- "@feathersjs/errors": "^5.0.0-pre.11",
57
- "@feathersjs/feathers": "^5.0.0-pre.11",
58
- "@feathersjs/transport-commons": "^5.0.0-pre.11",
59
- "@types/jsonwebtoken": "^8.5.5",
55
+ "@feathersjs/commons": "^5.0.0-pre.17",
56
+ "@feathersjs/errors": "^5.0.0-pre.17",
57
+ "@feathersjs/feathers": "^5.0.0-pre.17",
58
+ "@feathersjs/transport-commons": "^5.0.0-pre.17",
59
+ "@types/jsonwebtoken": "^8.5.8",
60
60
  "jsonwebtoken": "^8.5.1",
61
61
  "lodash": "^4.17.21",
62
62
  "long-timeout": "^0.1.1",
63
63
  "uuid": "^8.3.2"
64
64
  },
65
65
  "devDependencies": {
66
- "@feathersjs/memory": "^5.0.0-pre.11",
67
- "@types/lodash": "^4.14.175",
68
- "@types/mocha": "^9.0.0",
69
- "@types/node": "^16.10.2",
70
- "@types/uuid": "^8.3.1",
71
- "mocha": "^9.1.2",
72
- "shx": "^0.3.3",
73
- "ts-node": "^10.2.1",
74
- "typescript": "^4.4.3"
66
+ "@feathersjs/memory": "^5.0.0-pre.17",
67
+ "@types/lodash": "^4.14.178",
68
+ "@types/mocha": "^9.1.0",
69
+ "@types/node": "^17.0.15",
70
+ "@types/uuid": "^8.3.4",
71
+ "mocha": "^9.2.0",
72
+ "shx": "^0.3.4",
73
+ "ts-node": "^10.4.0",
74
+ "typescript": "^4.5.5"
75
75
  },
76
- "gitHead": "a9f7865cce8db2305b7c0d2ef4a165c2724034ef"
76
+ "gitHead": "d828748e57b40abfaa15710663afed417de14a1d"
77
77
  }
package/src/core.ts CHANGED
@@ -155,6 +155,16 @@ export class AuthenticationBase {
155
155
  .filter(current => !!current);
156
156
  }
157
157
 
158
+ /**
159
+ * Returns a single strategy by name
160
+ *
161
+ * @param name The strategy name
162
+ * @returns The authentication strategy or undefined
163
+ */
164
+ getStrategy (name: string) {
165
+ return this.strategies[name];
166
+ }
167
+
158
168
  /**
159
169
  * Create a new access token with payload and options.
160
170
  *
@@ -8,7 +8,7 @@ const debug = createDebug('@feathersjs/authentication/hooks/authenticate');
8
8
 
9
9
  export interface AuthenticateHookSettings {
10
10
  service?: string;
11
- strategies: string[];
11
+ strategies?: string[];
12
12
  }
13
13
 
14
14
  export default (originalSettings: string | AuthenticateHookSettings, ...originalStrategies: string[]) => {
@@ -20,7 +20,7 @@ export default (originalSettings: string | AuthenticateHookSettings, ...original
20
20
  throw new Error('The authenticate hook needs at least one allowed strategy');
21
21
  }
22
22
 
23
- return async (context: HookContext<any, any>, _next?: NextFunction) => {
23
+ return async (context: HookContext, _next?: NextFunction) => {
24
24
  const next = typeof _next === 'function' ? _next : async () => context;
25
25
  const { app, params, type, path, service } = context;
26
26
  const { strategies } = settings;
package/src/index.ts CHANGED
@@ -1,9 +1,5 @@
1
- import * as hooks from './hooks';
2
-
3
- const { authenticate } = hooks;
4
-
5
- export { hooks };
6
- export { authenticate };
1
+ export * as hooks from './hooks';
2
+ export { authenticate } from './hooks';
7
3
  export {
8
4
  AuthenticationBase,
9
5
  AuthenticationRequest,
package/src/service.ts CHANGED
@@ -10,7 +10,7 @@ import jsonwebtoken from 'jsonwebtoken';
10
10
  const debug = createDebug('@feathersjs/authentication/service');
11
11
 
12
12
  declare module '@feathersjs/feathers/lib/declarations' {
13
- interface FeathersApplication<ServiceTypes, AppSettings> { // eslint-disable-line
13
+ interface FeathersApplication<Services, Settings> { // eslint-disable-line
14
14
  /**
15
15
  * Returns the default authentication service or the
16
16
  * authentication service for a given path.
package/src/strategy.ts CHANGED
@@ -22,7 +22,7 @@ export class AuthenticationBaseStrategy implements AuthenticationStrategy {
22
22
  return this.authentication.configuration[this.name];
23
23
  }
24
24
 
25
- get entityService (): Service<any> {
25
+ get entityService (): Service {
26
26
  const { service } = this.configuration;
27
27
 
28
28
  if (!service) {