@loopback/authentication 7.2.0 → 7.3.3
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/README.md +4 -4
- package/dist/authentication.component.js +1 -2
- package/dist/authentication.component.js.map +1 -1
- package/dist/decorators/authenticate.decorator.js +1 -1
- package/dist/providers/auth-metadata.provider.js.map +1 -1
- package/dist/providers/auth-strategy.provider.js.map +1 -1
- package/package.json +34 -34
- package/src/authentication.component.ts +2 -2
- package/src/decorators/authenticate.decorator.ts +1 -1
- package/src/providers/auth-metadata.provider.ts +2 -1
- package/src/providers/auth-strategy.provider.ts +2 -1
- package/CHANGELOG.md +0 -1634
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ documentation is in
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-

|
|
10
10
|
|
|
11
11
|
This component contains the core logic for the authentication layer in
|
|
12
12
|
LoopBack 4.
|
|
@@ -67,8 +67,8 @@ to build the authentication system.
|
|
|
67
67
|
|
|
68
68
|
## Contributions
|
|
69
69
|
|
|
70
|
-
- [Guidelines](https://github.com/
|
|
71
|
-
- [Join the team](https://github.com/
|
|
70
|
+
- [Guidelines](https://github.com/loopbackio/loopback-next/blob/master/docs/CONTRIBUTING.md)
|
|
71
|
+
- [Join the team](https://github.com/loopbackio/loopback-next/issues/110)
|
|
72
72
|
|
|
73
73
|
## Tests
|
|
74
74
|
|
|
@@ -77,7 +77,7 @@ run `npm test` from the root folder.
|
|
|
77
77
|
## Contributors
|
|
78
78
|
|
|
79
79
|
See
|
|
80
|
-
[all contributors](https://github.com/
|
|
80
|
+
[all contributors](https://github.com/loopbackio/loopback-next/graphs/contributors).
|
|
81
81
|
|
|
82
82
|
## License
|
|
83
83
|
|
|
@@ -15,8 +15,7 @@ let AuthenticationComponent = class AuthenticationComponent {
|
|
|
15
15
|
[keys_1.AuthenticationBindings.AUTH_ACTION.key]: providers_1.AuthenticateActionProvider,
|
|
16
16
|
[keys_1.AuthenticationBindings.STRATEGY.key]: providers_1.AuthenticationStrategyProvider,
|
|
17
17
|
[keys_1.AuthenticationBindings.METADATA.key]: providers_1.AuthMetadataProvider,
|
|
18
|
-
[keys_1.AuthenticationBindings.AUTHENTICATION_MIDDLEWARE
|
|
19
|
-
.key]: providers_1.AuthenticationMiddlewareProvider,
|
|
18
|
+
[keys_1.AuthenticationBindings.AUTHENTICATION_MIDDLEWARE.key]: providers_1.AuthenticationMiddlewareProvider,
|
|
20
19
|
};
|
|
21
20
|
}
|
|
22
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.component.js","sourceRoot":"","sources":["../src/authentication.component.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,wCAAwC;AACxC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAAkE;AAClE,iCAA8C;AAC9C,2CAKqB;AAGrB,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAApC;QACE,cAAS,GAAG;YACV,CAAC,6BAAsB,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,sCAA0B;YACpE,CAAC,6BAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,0CAA8B;YACrE,CAAC,6BAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,gCAAoB;YAC3D,CAAC,6BAAsB,CAAC,yBAAyB
|
|
1
|
+
{"version":3,"file":"authentication.component.js","sourceRoot":"","sources":["../src/authentication.component.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,wCAAwC;AACxC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAAkE;AAClE,iCAA8C;AAC9C,2CAKqB;AAGrB,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAApC;QACE,cAAS,GAAG;YACV,CAAC,6BAAsB,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,sCAA0B;YACpE,CAAC,6BAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,0CAA8B;YACrE,CAAC,6BAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,gCAAoB;YAC3D,CAAC,6BAAsB,CAAC,yBAAyB,CAAC,GAAG,CAAC,EACpD,4CAAgC;SACnC,CAAC;IACJ,CAAC;CAAA,CAAA;AARY,uBAAuB;IADnC,iBAAU,CAAC,EAAC,IAAI,EAAE,EAAC,CAAC,kBAAW,CAAC,GAAG,CAAC,EAAE,6BAAsB,CAAC,SAAS,EAAC,EAAC,CAAC;GAC7D,uBAAuB,CAQnC;AARY,0DAAuB"}
|
|
@@ -21,7 +21,7 @@ function authenticate(...strategies) {
|
|
|
21
21
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
22
|
target, method,
|
|
23
23
|
// Use `any` to for `TypedPropertyDescriptor`
|
|
24
|
-
// See https://github.com/
|
|
24
|
+
// See https://github.com/loopbackio/loopback-next/pull/2704
|
|
25
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
26
|
methodDescriptor) {
|
|
27
27
|
const specs = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-metadata.provider.js","sourceRoot":"","sources":["../../src/providers/auth-metadata.provider.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,wCAAwC;AACxC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAMwB;AACxB,8CAAsD;AACtD,kCAA+C;AAG/C;;;GAGG;AACH,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;
|
|
1
|
+
{"version":3,"file":"auth-metadata.provider.js","sourceRoot":"","sources":["../../src/providers/auth-metadata.provider.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,wCAAwC;AACxC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAMwB;AACxB,8CAAsD;AACtD,kCAA+C;AAG/C;;;GAGG;AACH,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAG/B,YAEmB,eAAgC,EAEhC,UAAkB,EAElB,UAAiC,EAAE;QAJnC,oBAAe,GAAf,eAAe,CAAiB;QAEhC,eAAU,GAAV,UAAU,CAAQ;QAElB,YAAO,GAAP,OAAO,CAA4B;IACnD,CAAC;IAEJ;;OAEG;IACH,KAAK;;QACH,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,OAAO;QACtD,MAAM,QAAQ,GAAG,oCAAuB,CACtC,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,UAAU,CAChB,CAAC;QACF,0CAA0C;QAC1C,IAAI,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAC,CAAC,0CAAE,IAAI;YAAE,OAAO,SAAS,CAAC;QAC1C,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC9B,gCAAgC;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;IACtC,CAAC;CACF,CAAA;AA3BY,oBAAoB;IAI5B,mBAAA,aAAM,CAAC,mBAAY,CAAC,gBAAgB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAA;IAEvD,mBAAA,aAAM,CAAC,mBAAY,CAAC,sBAAsB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAA;IAE7D,mBAAA,aAAM,CAAC,EAAC,WAAW,EAAE,6BAAsB,CAAC,SAAS,EAAC,CAAC,CAAA;;GAR/C,oBAAoB,CA2BhC;AA3BY,oDAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-strategy.provider.js","sourceRoot":"","sources":["../../src/providers/auth-strategy.provider.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,wCAAwC;AACxC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAOwB;AACxB,kCAA+C;AAC/C,oCAIkB;AAElB;;;;;;;;GAQG;AAKH,IAAa,8BAA8B,GAA3C,MAAa,8BAA8B;
|
|
1
|
+
{"version":3,"file":"auth-strategy.provider.js","sourceR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AQ,CAAC,CAAC;YAC7C,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC3B;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AA1CY,8BAA8B;IAJ1C,qBAAc,CACb,6BAAsB,CAAC,4CAA4C,EACnE,EAAC,KAAK,EAAE,mBAAY,CAAC,SAAS,EAAC,CAChC,CAAC,6DAA6D;;IAK1D,mBAAA,iBAAU,EAAE,CAAA;IAEZ,mBAAA,aAAM,CAAC,6BAAsB,CAAC,QAAQ,CAAC,CAAA;;GAN/B,8BAA8B,CA0C1C;AA1CY,wEAA8B"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/authentication",
|
|
3
|
-
"version": "7.2.0",
|
|
4
3
|
"description": "A LoopBack component for authentication support.",
|
|
4
|
+
"version": "7.3.3",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"LoopBack",
|
|
7
|
+
"Authentication"
|
|
8
|
+
],
|
|
9
|
+
"license": "MIT",
|
|
5
10
|
"main": "dist/index.js",
|
|
6
11
|
"types": "dist/index.d.ts",
|
|
12
|
+
"author": "IBM Corp.",
|
|
13
|
+
"copyright.owner": "IBM Corp.",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/loopbackio/loopback-next.git",
|
|
17
|
+
"directory": "packages/authentication"
|
|
18
|
+
},
|
|
7
19
|
"engines": {
|
|
8
|
-
"node": "^10.16 || 12 || 14 ||
|
|
20
|
+
"node": "^10.16 || 12 || 14 || 16"
|
|
9
21
|
},
|
|
10
22
|
"scripts": {
|
|
11
23
|
"acceptance": "lb-mocha \"dist/__tests__/acceptance/**/*.js\"",
|
|
@@ -17,47 +29,35 @@
|
|
|
17
29
|
"unit": "lb-mocha \"dist/__tests__/unit/**/*.js\"",
|
|
18
30
|
"verify": "npm pack && tar xf loopback-authentication*.tgz && tree package && npm run clean"
|
|
19
31
|
},
|
|
20
|
-
"author": "IBM Corp.",
|
|
21
|
-
"copyright.owner": "IBM Corp.",
|
|
22
|
-
"license": "MIT",
|
|
23
32
|
"publishConfig": {
|
|
24
33
|
"access": "public"
|
|
25
34
|
},
|
|
35
|
+
"files": [
|
|
36
|
+
"README.md",
|
|
37
|
+
"dist",
|
|
38
|
+
"src",
|
|
39
|
+
"!*/__tests__"
|
|
40
|
+
],
|
|
26
41
|
"peerDependencies": {
|
|
27
|
-
"@loopback/core": "^2.
|
|
28
|
-
"@loopback/rest": "^
|
|
42
|
+
"@loopback/core": "^2.17.0",
|
|
43
|
+
"@loopback/rest": "^10.0.1"
|
|
29
44
|
},
|
|
30
45
|
"dependencies": {
|
|
31
|
-
"@loopback/security": "^0.
|
|
32
|
-
"@types/express": "^4.17.
|
|
33
|
-
"@types/lodash": "^4.14.
|
|
46
|
+
"@loopback/security": "^0.5.3",
|
|
47
|
+
"@types/express": "^4.17.13",
|
|
48
|
+
"@types/lodash": "^4.14.173",
|
|
34
49
|
"lodash": "^4.17.21",
|
|
35
|
-
"tslib": "^2.1
|
|
50
|
+
"tslib": "^2.3.1"
|
|
36
51
|
},
|
|
37
52
|
"devDependencies": {
|
|
38
|
-
"@loopback/build": "^
|
|
39
|
-
"@loopback/core": "^2.
|
|
40
|
-
"@loopback/eslint-config": "^
|
|
41
|
-
"@loopback/openapi-spec-builder": "^3.
|
|
42
|
-
"@loopback/rest": "^
|
|
43
|
-
"@loopback/testlab": "^3.3
|
|
44
|
-
"@types/node": "^10.17.
|
|
53
|
+
"@loopback/build": "^7.0.1",
|
|
54
|
+
"@loopback/core": "^2.17.0",
|
|
55
|
+
"@loopback/eslint-config": "^11.0.1",
|
|
56
|
+
"@loopback/openapi-spec-builder": "^3.2.3",
|
|
57
|
+
"@loopback/rest": "^10.0.1",
|
|
58
|
+
"@loopback/testlab": "^3.4.3",
|
|
59
|
+
"@types/node": "^10.17.60",
|
|
45
60
|
"jsonwebtoken": "^8.5.1"
|
|
46
61
|
},
|
|
47
|
-
"
|
|
48
|
-
"LoopBack",
|
|
49
|
-
"Authentication"
|
|
50
|
-
],
|
|
51
|
-
"files": [
|
|
52
|
-
"README.md",
|
|
53
|
-
"dist",
|
|
54
|
-
"src",
|
|
55
|
-
"!*/__tests__"
|
|
56
|
-
],
|
|
57
|
-
"repository": {
|
|
58
|
-
"type": "git",
|
|
59
|
-
"url": "https://github.com/strongloop/loopback-next.git",
|
|
60
|
-
"directory": "packages/authentication"
|
|
61
|
-
},
|
|
62
|
-
"gitHead": "156ca0fcf8fa246ca380ab28b44b3708896be2b6"
|
|
62
|
+
"gitHead": "1df36bb1ee2e513d9e197bd6010c4cfb296d50b8"
|
|
63
63
|
}
|
|
@@ -18,7 +18,7 @@ export class AuthenticationComponent implements Component {
|
|
|
18
18
|
[AuthenticationBindings.AUTH_ACTION.key]: AuthenticateActionProvider,
|
|
19
19
|
[AuthenticationBindings.STRATEGY.key]: AuthenticationStrategyProvider,
|
|
20
20
|
[AuthenticationBindings.METADATA.key]: AuthMetadataProvider,
|
|
21
|
-
[AuthenticationBindings.AUTHENTICATION_MIDDLEWARE
|
|
22
|
-
|
|
21
|
+
[AuthenticationBindings.AUTHENTICATION_MIDDLEWARE.key]:
|
|
22
|
+
AuthenticationMiddlewareProvider,
|
|
23
23
|
};
|
|
24
24
|
}
|
|
@@ -36,7 +36,7 @@ export function authenticate(
|
|
|
36
36
|
target: any,
|
|
37
37
|
method?: string,
|
|
38
38
|
// Use `any` to for `TypedPropertyDescriptor`
|
|
39
|
-
// See https://github.com/
|
|
39
|
+
// See https://github.com/loopbackio/loopback-next/pull/2704
|
|
40
40
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
41
|
methodDescriptor?: TypedPropertyDescriptor<any>,
|
|
42
42
|
) {
|
|
@@ -19,7 +19,8 @@ import {AuthenticationMetadata, AuthenticationOptions} from '../types';
|
|
|
19
19
|
* @example `context.bind('authentication.operationMetadata').toProvider(AuthMetadataProvider)`
|
|
20
20
|
*/
|
|
21
21
|
export class AuthMetadataProvider
|
|
22
|
-
implements Provider<AuthenticationMetadata[] | undefined>
|
|
22
|
+
implements Provider<AuthenticationMetadata[] | undefined>
|
|
23
|
+
{
|
|
23
24
|
constructor(
|
|
24
25
|
@inject(CoreBindings.CONTROLLER_CLASS, {optional: true})
|
|
25
26
|
private readonly controllerClass: Constructor<{}>,
|
|
@@ -32,7 +32,8 @@ import {
|
|
|
32
32
|
{scope: BindingScope.TRANSIENT},
|
|
33
33
|
) //this needs to be transient, e.g. for request level context.
|
|
34
34
|
export class AuthenticationStrategyProvider
|
|
35
|
-
implements Provider<AuthenticationStrategy[] | undefined>
|
|
35
|
+
implements Provider<AuthenticationStrategy[] | undefined>
|
|
36
|
+
{
|
|
36
37
|
constructor(
|
|
37
38
|
@extensions()
|
|
38
39
|
protected authenticationStrategies: Getter<AuthenticationStrategy[]>,
|