@celljs/oauth2-core 3.8.0 → 3.9.0

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.
Files changed (50) hide show
  1. package/esm/node/authentication/authentication-protocol.d.ts +10 -0
  2. package/esm/node/authentication/authentication-protocol.js +13 -0
  3. package/esm/node/authentication/authentication-protocol.js.map +1 -0
  4. package/esm/node/authentication/index.d.ts +1 -0
  5. package/esm/node/authentication/index.js +2 -0
  6. package/esm/node/authentication/index.js.map +1 -0
  7. package/esm/node/authorization/authorization-protocol.d.ts +11 -0
  8. package/esm/node/authorization/authorization-protocol.js +14 -0
  9. package/esm/node/authorization/authorization-protocol.js.map +1 -0
  10. package/esm/node/authorization/index.d.ts +1 -0
  11. package/esm/node/authorization/index.js +2 -0
  12. package/esm/node/authorization/index.js.map +1 -0
  13. package/esm/node/endpoint/access-token-response-converter.d.ts +16 -0
  14. package/esm/node/endpoint/access-token-response-converter.js +66 -0
  15. package/esm/node/endpoint/access-token-response-converter.js.map +1 -0
  16. package/esm/node/endpoint/endpoint-protocol.d.ts +128 -0
  17. package/esm/node/endpoint/endpoint-protocol.js +93 -0
  18. package/esm/node/endpoint/endpoint-protocol.js.map +1 -0
  19. package/esm/node/endpoint/index.d.ts +2 -0
  20. package/esm/node/endpoint/index.js +3 -0
  21. package/esm/node/endpoint/index.js.map +1 -0
  22. package/esm/node/error/error-protocol.d.ts +80 -0
  23. package/esm/node/error/error-protocol.js +82 -0
  24. package/esm/node/error/error-protocol.js.map +1 -0
  25. package/esm/node/error/error.d.ts +11 -0
  26. package/esm/node/error/error.js +15 -0
  27. package/esm/node/error/error.js.map +1 -0
  28. package/esm/node/error/index.d.ts +2 -0
  29. package/esm/node/error/index.js +3 -0
  30. package/esm/node/error/index.js.map +1 -0
  31. package/esm/node/index.d.ts +6 -0
  32. package/esm/node/index.js +7 -0
  33. package/esm/node/index.js.map +1 -0
  34. package/esm/node/module.d.ts +3 -0
  35. package/esm/node/module.js +4 -0
  36. package/esm/node/module.js.map +1 -0
  37. package/esm/node/oidc/index.d.ts +1 -0
  38. package/esm/node/oidc/index.js +2 -0
  39. package/esm/node/oidc/index.js.map +1 -0
  40. package/esm/node/oidc/oidc-protocol.d.ts +116 -0
  41. package/esm/node/oidc/oidc-protocol.js +120 -0
  42. package/esm/node/oidc/oidc-protocol.js.map +1 -0
  43. package/esm/node/token/index.d.ts +1 -0
  44. package/esm/node/token/index.js +2 -0
  45. package/esm/node/token/index.js.map +1 -0
  46. package/esm/node/token/token-protocol.d.ts +65 -0
  47. package/esm/node/token/token-protocol.js +57 -0
  48. package/esm/node/token/token-protocol.js.map +1 -0
  49. package/esm/package.json +3 -0
  50. package/package.json +61 -6
@@ -0,0 +1,10 @@
1
+ export declare enum AuthenticationMethod {
2
+ Header = "header",
3
+ Form = "form",
4
+ Query = "query"
5
+ }
6
+ export declare enum ClientAuthenticationMethod {
7
+ Basic = "basic",
8
+ Post = "post",
9
+ None = "none"
10
+ }
@@ -0,0 +1,13 @@
1
+ export var AuthenticationMethod;
2
+ (function (AuthenticationMethod) {
3
+ AuthenticationMethod["Header"] = "header";
4
+ AuthenticationMethod["Form"] = "form";
5
+ AuthenticationMethod["Query"] = "query";
6
+ })(AuthenticationMethod || (AuthenticationMethod = {}));
7
+ export var ClientAuthenticationMethod;
8
+ (function (ClientAuthenticationMethod) {
9
+ ClientAuthenticationMethod["Basic"] = "basic";
10
+ ClientAuthenticationMethod["Post"] = "post";
11
+ ClientAuthenticationMethod["None"] = "none";
12
+ })(ClientAuthenticationMethod || (ClientAuthenticationMethod = {}));
13
+ //# sourceMappingURL=authentication-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication-protocol.js","sourceRoot":"","sources":["../../../src/node/authentication/authentication-protocol.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC5B,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,uCAAe,CAAA;AACnB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IAClC,6CAAe,CAAA;IACf,2CAAa,CAAA;IACb,2CAAa,CAAA;AACjB,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC"}
@@ -0,0 +1 @@
1
+ export * from './authentication-protocol.js';
@@ -0,0 +1,2 @@
1
+ export * from './authentication-protocol.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/authentication/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare enum AuthorizationGrantType {
2
+ AuthorizationCode = "authorization_code",
3
+ Implicit = "implicit",
4
+ RefreshToken = "refresh_token",
5
+ ClientCredentials = "client_credentials",
6
+ Password = "password"
7
+ }
8
+ export declare enum AuthorizationResponseType {
9
+ Code = "code",
10
+ Token = "token"
11
+ }
@@ -0,0 +1,14 @@
1
+ export var AuthorizationGrantType;
2
+ (function (AuthorizationGrantType) {
3
+ AuthorizationGrantType["AuthorizationCode"] = "authorization_code";
4
+ AuthorizationGrantType["Implicit"] = "implicit";
5
+ AuthorizationGrantType["RefreshToken"] = "refresh_token";
6
+ AuthorizationGrantType["ClientCredentials"] = "client_credentials";
7
+ AuthorizationGrantType["Password"] = "password";
8
+ })(AuthorizationGrantType || (AuthorizationGrantType = {}));
9
+ export var AuthorizationResponseType;
10
+ (function (AuthorizationResponseType) {
11
+ AuthorizationResponseType["Code"] = "code";
12
+ AuthorizationResponseType["Token"] = "token";
13
+ })(AuthorizationResponseType || (AuthorizationResponseType = {}));
14
+ //# sourceMappingURL=authorization-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-protocol.js","sourceRoot":"","sources":["../../../src/node/authorization/authorization-protocol.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAC9B,kEAAwC,CAAA;IACxC,+CAAqB,CAAA;IACrB,wDAA8B,CAAA;IAC9B,kEAAwC,CAAA;IACxC,+CAAqB,CAAA;AACzB,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC;AAED,MAAM,CAAN,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACjC,0CAAa,CAAA;IACb,4CAAe,CAAA;AACnB,CAAC,EAHW,yBAAyB,KAAzB,yBAAyB,QAGpC"}
@@ -0,0 +1 @@
1
+ export * from './authorization-protocol.js';
@@ -0,0 +1,2 @@
1
+ export * from './authorization-protocol.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/authorization/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { TokenType } from '../token/index.js';
2
+ import { AccessTokenResponse } from './endpoint-protocol.js';
3
+ export declare class AccessTokenResponseConverter {
4
+ convert(tokenResponse: {
5
+ [key: string]: string;
6
+ }): AccessTokenResponse;
7
+ protected getScopes(tokenResponse: {
8
+ [key: string]: string;
9
+ }): string[];
10
+ protected getExpiresIn(tokenResponse: {
11
+ [key: string]: string;
12
+ }): number;
13
+ protected getAccessTokenType(tokenResponse: {
14
+ [key: string]: string;
15
+ }): TokenType.Bearer | undefined;
16
+ }
@@ -0,0 +1,66 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { TokenType } from '../token/index.js';
8
+ import { OAuth2ParameterNames } from './endpoint-protocol.js';
9
+ import { Component } from '@celljs/core';
10
+ let AccessTokenResponseConverter = class AccessTokenResponseConverter {
11
+ convert(tokenResponse) {
12
+ const accessToken = tokenResponse[OAuth2ParameterNames.ACCESS_TOKEN];
13
+ const tokenType = this.getAccessTokenType(tokenResponse);
14
+ const expiresIn = this.getExpiresIn(tokenResponse);
15
+ const scopes = this.getScopes(tokenResponse);
16
+ const refreshToken = tokenResponse[OAuth2ParameterNames.REFRESH_TOKEN];
17
+ const checkParameters = [
18
+ OAuth2ParameterNames.ACCESS_TOKEN,
19
+ OAuth2ParameterNames.EXPIRES_IN,
20
+ OAuth2ParameterNames.REFRESH_TOKEN,
21
+ OAuth2ParameterNames.SCOPE,
22
+ OAuth2ParameterNames.TOKEN_TYPE
23
+ ];
24
+ const additionalParameters = {};
25
+ for (const key in tokenResponse) {
26
+ if (Object.prototype.hasOwnProperty.call(tokenResponse, key) && !checkParameters.includes(key)) {
27
+ additionalParameters[key] = tokenResponse[key];
28
+ }
29
+ }
30
+ const issuedAt = Date.now();
31
+ const expiresAt = expiresIn > 0 ? issuedAt + 1000 * expiresIn : issuedAt + 1000;
32
+ return {
33
+ accessToken: {
34
+ tokenType,
35
+ issuedAt,
36
+ expiresAt,
37
+ tokenValue: accessToken,
38
+ scopes
39
+ },
40
+ refreshToken: refreshToken ? { tokenValue: refreshToken, issuedAt } : undefined,
41
+ additionalParameters
42
+ };
43
+ }
44
+ getScopes(tokenResponse) {
45
+ if (tokenResponse[OAuth2ParameterNames.SCOPE]) {
46
+ return tokenResponse[OAuth2ParameterNames.SCOPE].split(' ');
47
+ }
48
+ return [];
49
+ }
50
+ getExpiresIn(tokenResponse) {
51
+ if (tokenResponse[OAuth2ParameterNames.EXPIRES_IN]) {
52
+ return parseInt(tokenResponse[OAuth2ParameterNames.EXPIRES_IN]);
53
+ }
54
+ return 0;
55
+ }
56
+ getAccessTokenType(tokenResponse) {
57
+ if (TokenType.Bearer.toUpperCase() === (tokenResponse[OAuth2ParameterNames.TOKEN_TYPE] || '').toUpperCase()) {
58
+ return TokenType.Bearer;
59
+ }
60
+ }
61
+ };
62
+ AccessTokenResponseConverter = __decorate([
63
+ Component(AccessTokenResponseConverter)
64
+ ], AccessTokenResponseConverter);
65
+ export { AccessTokenResponseConverter };
66
+ //# sourceMappingURL=access-token-response-converter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-token-response-converter.js","sourceRoot":"","sources":["../../../src/node/endpoint/access-token-response-converter.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAuB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGlC,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACrC,OAAO,CAAC,aAAwC;QAC5C,MAAM,WAAW,GAAG,aAAa,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;QACzD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QAC7C,MAAM,YAAY,GAAG,aAAa,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;QAEvE,MAAM,eAAe,GAAG;YACpB,oBAAoB,CAAC,YAAY;YACjC,oBAAoB,CAAC,UAAU;YAC/B,oBAAoB,CAAC,aAAa;YAClC,oBAAoB,CAAC,KAAK;YAC1B,oBAAoB,CAAC,UAAU;SAClC,CAAC;QACF,MAAM,oBAAoB,GAA8B,EAAE,CAAC;QAC3D,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;YAC9B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC7F,oBAAoB,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;YACnD,CAAC;QACL,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC5B,MAAM,SAAS,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;QAEhF,OAAO;YACH,WAAW,EAAE;gBACT,SAAS;gBACT,QAAQ;gBACR,SAAS;gBACT,UAAU,EAAE,WAAW;gBACvB,MAAM;aACT;YACD,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;YAC/E,oBAAoB;SACvB,CAAC;IAEN,CAAC;IAES,SAAS,CAAC,aAAyC;QACzD,IAAI,aAAa,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5C,OAAO,aAAa,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAES,YAAY,CAAC,aAAyC;QAC5D,IAAI,aAAa,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;YACjD,OAAO,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,CAAC,CAAC;IACb,CAAC;IAES,kBAAkB,CAAC,aAAyC;QAClE,IAAI,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAC1G,OAAO,SAAS,CAAC,MAAM,CAAC;QAC5B,CAAC;IACL,CAAC;CACJ,CAAA;AA1DY,4BAA4B;IADxC,SAAS,CAAC,4BAA4B,CAAC;GAC3B,4BAA4B,CA0DxC"}
@@ -0,0 +1,128 @@
1
+ import { AuthorizationGrantType, AuthorizationResponseType } from '../authorization/index.js';
2
+ import { RefreshToken, AccessToken } from '../token/index.js';
3
+ export declare namespace OAuth2ParameterNames {
4
+ /**
5
+ * used in Access Token Request.
6
+ */
7
+ const GRANT_TYPE = "grant_type";
8
+ /**
9
+ * used in Authorization Request.
10
+ */
11
+ const RESPONSE_TYPE = "response_type";
12
+ /**
13
+ * used in Authorization Request and Access Token Request.
14
+ */
15
+ const CLIENT_ID = "client_id";
16
+ /**
17
+ * used in Access Token Request.
18
+ */
19
+ const CLIENT_SECRET = "client_secret";
20
+ /**
21
+ * used in Authorization Request and Access Token Request.
22
+ */
23
+ const REDIRECT_URI = "redirect_uri";
24
+ /**
25
+ * used in Authorization Request, Authorization Response, Access Token Request and Access Token Response.
26
+ */
27
+ const SCOPE = "scope";
28
+ /**
29
+ * used in Authorization Request and Authorization Response.
30
+ */
31
+ const STATE = "state";
32
+ /**
33
+ * used in Authorization Response and Access Token Request.
34
+ */
35
+ const CODE = "code";
36
+ /**
37
+ * used in Authorization Response and Access Token Response.
38
+ */
39
+ const ACCESS_TOKEN = "access_token";
40
+ /**
41
+ * used in Authorization Response and Access Token Response.
42
+ */
43
+ const TOKEN_TYPE = "token_type";
44
+ /**
45
+ * used in Authorization Response and Access Token Response.
46
+ */
47
+ const EXPIRES_IN = "expires_in";
48
+ /**
49
+ * used in Access Token Request and Access Token Response.
50
+ */
51
+ const REFRESH_TOKEN = "refresh_token";
52
+ /**
53
+ * used in Access Token Request.
54
+ */
55
+ const USERNAME = "username";
56
+ /**
57
+ * used in Access Token Request.
58
+ */
59
+ const PASSWORD = "password";
60
+ /**
61
+ * used in Authorization Response and Access Token Response.
62
+ */
63
+ const ERROR = "error";
64
+ /**
65
+ * used in Authorization Response and Access Token Response.
66
+ */
67
+ const ERROR_DESCRIPTION = "error_description";
68
+ /**
69
+ * used in Authorization Response and Access Token Response.
70
+ */
71
+ const ERROR_URI = "error_uri";
72
+ /**
73
+ * Non-standard parameter (used internally).
74
+ */
75
+ const REGISTRATION_ID = "registration_id";
76
+ }
77
+ export declare namespace PkceParameterNames {
78
+ /**
79
+ * `code_challenge`- used in Authorization Request.
80
+ */
81
+ const CODE_CHALLENGE = "code_challenge";
82
+ /**
83
+ * `code_challenge_method`- used in Authorization Request.
84
+ */
85
+ const CODE_CHALLENGE_METHOD = "code_challenge_method";
86
+ /**
87
+ * `code_verifier`- used in Token Request.
88
+ */
89
+ const CODE_VERIFIER = "code_verifier";
90
+ }
91
+ export interface AuthorizationRequest {
92
+ authorizationUri: string;
93
+ authorizationGrantType: AuthorizationGrantType;
94
+ responseType: AuthorizationResponseType;
95
+ clientId: string;
96
+ redirectUri: string;
97
+ scopes: string[];
98
+ state: string;
99
+ additionalParameters: {
100
+ [key: string]: any;
101
+ };
102
+ authorizationRequestUri: string;
103
+ attributes: {
104
+ [key: string]: any;
105
+ };
106
+ }
107
+ export interface AuthorizationResponse {
108
+ redirectUri: string;
109
+ state: string;
110
+ code: string;
111
+ error: OAuth2Error;
112
+ }
113
+ export interface OAuth2Error {
114
+ errorCode: string;
115
+ description?: string;
116
+ uri?: string;
117
+ }
118
+ export interface AuthorizationExchange {
119
+ authorizationRequest: AuthorizationRequest;
120
+ authorizationResponse: AuthorizationResponse;
121
+ }
122
+ export declare class AccessTokenResponse {
123
+ accessToken: AccessToken;
124
+ refreshToken?: RefreshToken;
125
+ additionalParameters: {
126
+ [key: string]: any;
127
+ };
128
+ }
@@ -0,0 +1,93 @@
1
+ export var OAuth2ParameterNames;
2
+ (function (OAuth2ParameterNames) {
3
+ /**
4
+ * used in Access Token Request.
5
+ */
6
+ OAuth2ParameterNames.GRANT_TYPE = 'grant_type';
7
+ /**
8
+ * used in Authorization Request.
9
+ */
10
+ OAuth2ParameterNames.RESPONSE_TYPE = 'response_type';
11
+ /**
12
+ * used in Authorization Request and Access Token Request.
13
+ */
14
+ OAuth2ParameterNames.CLIENT_ID = 'client_id';
15
+ /**
16
+ * used in Access Token Request.
17
+ */
18
+ OAuth2ParameterNames.CLIENT_SECRET = 'client_secret';
19
+ /**
20
+ * used in Authorization Request and Access Token Request.
21
+ */
22
+ OAuth2ParameterNames.REDIRECT_URI = 'redirect_uri';
23
+ /**
24
+ * used in Authorization Request, Authorization Response, Access Token Request and Access Token Response.
25
+ */
26
+ OAuth2ParameterNames.SCOPE = 'scope';
27
+ /**
28
+ * used in Authorization Request and Authorization Response.
29
+ */
30
+ OAuth2ParameterNames.STATE = 'state';
31
+ /**
32
+ * used in Authorization Response and Access Token Request.
33
+ */
34
+ OAuth2ParameterNames.CODE = 'code';
35
+ /**
36
+ * used in Authorization Response and Access Token Response.
37
+ */
38
+ OAuth2ParameterNames.ACCESS_TOKEN = 'access_token';
39
+ /**
40
+ * used in Authorization Response and Access Token Response.
41
+ */
42
+ OAuth2ParameterNames.TOKEN_TYPE = 'token_type';
43
+ /**
44
+ * used in Authorization Response and Access Token Response.
45
+ */
46
+ OAuth2ParameterNames.EXPIRES_IN = 'expires_in';
47
+ /**
48
+ * used in Access Token Request and Access Token Response.
49
+ */
50
+ OAuth2ParameterNames.REFRESH_TOKEN = 'refresh_token';
51
+ /**
52
+ * used in Access Token Request.
53
+ */
54
+ OAuth2ParameterNames.USERNAME = 'username';
55
+ /**
56
+ * used in Access Token Request.
57
+ */
58
+ OAuth2ParameterNames.PASSWORD = 'password';
59
+ /**
60
+ * used in Authorization Response and Access Token Response.
61
+ */
62
+ OAuth2ParameterNames.ERROR = 'error';
63
+ /**
64
+ * used in Authorization Response and Access Token Response.
65
+ */
66
+ OAuth2ParameterNames.ERROR_DESCRIPTION = 'error_description';
67
+ /**
68
+ * used in Authorization Response and Access Token Response.
69
+ */
70
+ OAuth2ParameterNames.ERROR_URI = 'error_uri';
71
+ /**
72
+ * Non-standard parameter (used internally).
73
+ */
74
+ OAuth2ParameterNames.REGISTRATION_ID = 'registration_id';
75
+ })(OAuth2ParameterNames || (OAuth2ParameterNames = {}));
76
+ export var PkceParameterNames;
77
+ (function (PkceParameterNames) {
78
+ /**
79
+ * `code_challenge`- used in Authorization Request.
80
+ */
81
+ PkceParameterNames.CODE_CHALLENGE = 'code_challenge';
82
+ /**
83
+ * `code_challenge_method`- used in Authorization Request.
84
+ */
85
+ PkceParameterNames.CODE_CHALLENGE_METHOD = 'code_challenge_method';
86
+ /**
87
+ * `code_verifier`- used in Token Request.
88
+ */
89
+ PkceParameterNames.CODE_VERIFIER = 'code_verifier';
90
+ })(PkceParameterNames || (PkceParameterNames = {}));
91
+ export class AccessTokenResponse {
92
+ }
93
+ //# sourceMappingURL=endpoint-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-protocol.js","sourceRoot":"","sources":["../../../src/node/endpoint/endpoint-protocol.ts"],"names":[],"mappings":"AAGA,MAAM,KAAW,oBAAoB,CA2FpC;AA3FD,WAAiB,oBAAoB;IACjC;;OAEG;IACU,+BAAU,GAAG,YAAY,CAAC;IAEvC;;OAEG;IACU,kCAAa,GAAG,eAAe,CAAC;IAE7C;;OAEG;IACU,8BAAS,GAAG,WAAW,CAAC;IAErC;;OAEG;IACU,kCAAa,GAAG,eAAe,CAAC;IAE7C;;OAEG;IACU,iCAAY,GAAG,cAAc,CAAC;IAE3C;;OAEG;IACU,0BAAK,GAAG,OAAO,CAAC;IAE7B;;OAEG;IACU,0BAAK,GAAG,OAAO,CAAC;IAE7B;;OAEG;IACU,yBAAI,GAAG,MAAM,CAAC;IAE3B;;OAEG;IACU,iCAAY,GAAG,cAAc,CAAC;IAE3C;;OAEG;IACU,+BAAU,GAAG,YAAY,CAAC;IAEvC;;OAEG;IACU,+BAAU,GAAG,YAAY,CAAC;IAEvC;;OAEG;IACU,kCAAa,GAAG,eAAe,CAAC;IAE7C;;OAEG;IACU,6BAAQ,GAAG,UAAU,CAAC;IAEnC;;OAEG;IACU,6BAAQ,GAAG,UAAU,CAAC;IAEnC;;OAEG;IACU,0BAAK,GAAG,OAAO,CAAC;IAE7B;;OAEG;IACU,sCAAiB,GAAG,mBAAmB,CAAC;IAErD;;OAEG;IACU,8BAAS,GAAG,WAAW,CAAC;IAErC;;OAEG;IACU,oCAAe,GAAG,iBAAiB,CAAC;AAErD,CAAC,EA3FgB,oBAAoB,KAApB,oBAAoB,QA2FpC;AAED,MAAM,KAAW,kBAAkB,CAgBlC;AAhBD,WAAiB,kBAAkB;IAE/B;;OAEG;IACU,iCAAc,GAAG,gBAAgB,CAAC;IAE/C;;OAEG;IACU,wCAAqB,GAAG,uBAAuB,CAAC;IAE7D;;OAEG;IACU,gCAAa,GAAG,eAAe,CAAC;AACjD,CAAC,EAhBgB,kBAAkB,KAAlB,kBAAkB,QAgBlC;AAiCD,MAAM,OAAO,mBAAmB;CAI/B"}
@@ -0,0 +1,2 @@
1
+ export * from './endpoint-protocol.js';
2
+ export * from './access-token-response-converter.js';
@@ -0,0 +1,3 @@
1
+ export * from './endpoint-protocol.js';
2
+ export * from './access-token-response-converter.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/endpoint/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC"}
@@ -0,0 +1,80 @@
1
+ export declare enum OAuth2ErrorCodes {
2
+ /**
3
+ * `invalid_request` - The request is missing a required parameter,
4
+ * includes an invalid parameter value,
5
+ * includes a parameter more than once, or is otherwise malformed.
6
+ */
7
+ INVALID_REQUEST = "invalid_request",
8
+ /**
9
+ * `unauthorized_client` - The client is not authorized to request
10
+ * an authorization code or access token using this method.
11
+ */
12
+ UNAUTHORIZED_CLIENT = "unauthorized_client",
13
+ /**
14
+ * `access_denied` - The resource owner or authorization server denied the request.
15
+ */
16
+ ACCESS_DENIED = "access_denied",
17
+ /**
18
+ * `unsupported_response_type` - The authorization server does not support
19
+ * obtaining an authorization code or access token using this method.
20
+ */
21
+ UNSUPPORTED_RESPONSE_TYPE = "unsupported_response_type",
22
+ /**
23
+ * `invalid_scope` - The requested scope is invalid, unknown, malformed or
24
+ * exceeds the scope granted by the resource owner.
25
+ */
26
+ INVALID_SCOPE = "invalid_scope",
27
+ /**
28
+ * `insufficient_scope` - The request requires higher privileges than
29
+ * provided by the access token.
30
+ * The resource server SHOULD respond with the HTTP 403 (Forbidden)
31
+ * status code and MAY include the 'scope' attribute with the scope
32
+ * necessary to access the protected resource.
33
+ *
34
+ * @see <a href='https://tools.ietf.org/html/rfc6750#section-3.1'>RFC-6750 - Section 3.1 - Error Codes</a>
35
+ */
36
+ INSUFFICIENT_SCOPE = "insufficient_scope",
37
+ /**
38
+ * `invalid_token` - The access token provided is expired, revoked,
39
+ * malformed, or invalid for other reasons.
40
+ * The resource SHOULD respond with the HTTP 401 (Unauthorized) status code.
41
+ * The client MAY request a new access token and retry the protected resource request.
42
+ *
43
+ * @see <a href='https://tools.ietf.org/html/rfc6750#section-3.1'>RFC-6750 - Section 3.1 - Error Codes</a>
44
+ */
45
+ INVALID_TOKEN = "invalid_token",
46
+ /**
47
+ * `server_error` - The authorization server encountered an
48
+ * unexpected condition that prevented it from fulfilling the request.
49
+ * (This error code is needed because a 500 Internal Server Error HTTP status code
50
+ * cannot be returned to the client via a HTTP redirect.)
51
+ */
52
+ SERVER_ERROR = "server_error",
53
+ /**
54
+ * `temporarily_unavailable` - The authorization server is currently unable
55
+ * to handle the request due to a temporary overloading or maintenance of the server.
56
+ * (This error code is needed because a 503 Service Unavailable HTTP status code
57
+ * cannot be returned to the client via an HTTP redirect.)
58
+ */
59
+ TEMPORARILY_UNAVAILABLE = "temporarily_unavailable",
60
+ /**
61
+ * `invalid_client` - Client authentication failed (e.g., unknown client,
62
+ * no client authentication included, or unsupported authentication method).
63
+ * The authorization server MAY return a HTTP 401 (Unauthorized) status code
64
+ * to indicate which HTTP authentication schemes are supported.
65
+ * If the client attempted to authenticate via the &quot;Authorization&quot; request header field,
66
+ * the authorization server MUST respond with a HTTP 401 (Unauthorized) status code and
67
+ * include the &quot;WWW-Authenticate&quot; response header field matching the authentication scheme used by the client.
68
+ */
69
+ INVALID_CLIENT = "invalid_client",
70
+ /**
71
+ * `invalid_grant` - The provided authorization grant
72
+ * (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked,
73
+ * does not match the redirection URI used in the authorization request, or was issued to another client.
74
+ */
75
+ INVALID_GRANT = "invalid_grant",
76
+ /**
77
+ * `unsupported_grant_type` - The authorization grant type is not supported by the authorization server.
78
+ */
79
+ UNSUPPORTED_GRANT_TYPE = "unsupported_grant_type"
80
+ }
@@ -0,0 +1,82 @@
1
+ export var OAuth2ErrorCodes;
2
+ (function (OAuth2ErrorCodes) {
3
+ /**
4
+ * `invalid_request` - The request is missing a required parameter,
5
+ * includes an invalid parameter value,
6
+ * includes a parameter more than once, or is otherwise malformed.
7
+ */
8
+ OAuth2ErrorCodes["INVALID_REQUEST"] = "invalid_request";
9
+ /**
10
+ * `unauthorized_client` - The client is not authorized to request
11
+ * an authorization code or access token using this method.
12
+ */
13
+ OAuth2ErrorCodes["UNAUTHORIZED_CLIENT"] = "unauthorized_client";
14
+ /**
15
+ * `access_denied` - The resource owner or authorization server denied the request.
16
+ */
17
+ OAuth2ErrorCodes["ACCESS_DENIED"] = "access_denied";
18
+ /**
19
+ * `unsupported_response_type` - The authorization server does not support
20
+ * obtaining an authorization code or access token using this method.
21
+ */
22
+ OAuth2ErrorCodes["UNSUPPORTED_RESPONSE_TYPE"] = "unsupported_response_type";
23
+ /**
24
+ * `invalid_scope` - The requested scope is invalid, unknown, malformed or
25
+ * exceeds the scope granted by the resource owner.
26
+ */
27
+ OAuth2ErrorCodes["INVALID_SCOPE"] = "invalid_scope";
28
+ /**
29
+ * `insufficient_scope` - The request requires higher privileges than
30
+ * provided by the access token.
31
+ * The resource server SHOULD respond with the HTTP 403 (Forbidden)
32
+ * status code and MAY include the 'scope' attribute with the scope
33
+ * necessary to access the protected resource.
34
+ *
35
+ * @see <a href='https://tools.ietf.org/html/rfc6750#section-3.1'>RFC-6750 - Section 3.1 - Error Codes</a>
36
+ */
37
+ OAuth2ErrorCodes["INSUFFICIENT_SCOPE"] = "insufficient_scope";
38
+ /**
39
+ * `invalid_token` - The access token provided is expired, revoked,
40
+ * malformed, or invalid for other reasons.
41
+ * The resource SHOULD respond with the HTTP 401 (Unauthorized) status code.
42
+ * The client MAY request a new access token and retry the protected resource request.
43
+ *
44
+ * @see <a href='https://tools.ietf.org/html/rfc6750#section-3.1'>RFC-6750 - Section 3.1 - Error Codes</a>
45
+ */
46
+ OAuth2ErrorCodes["INVALID_TOKEN"] = "invalid_token";
47
+ /**
48
+ * `server_error` - The authorization server encountered an
49
+ * unexpected condition that prevented it from fulfilling the request.
50
+ * (This error code is needed because a 500 Internal Server Error HTTP status code
51
+ * cannot be returned to the client via a HTTP redirect.)
52
+ */
53
+ OAuth2ErrorCodes["SERVER_ERROR"] = "server_error";
54
+ /**
55
+ * `temporarily_unavailable` - The authorization server is currently unable
56
+ * to handle the request due to a temporary overloading or maintenance of the server.
57
+ * (This error code is needed because a 503 Service Unavailable HTTP status code
58
+ * cannot be returned to the client via an HTTP redirect.)
59
+ */
60
+ OAuth2ErrorCodes["TEMPORARILY_UNAVAILABLE"] = "temporarily_unavailable";
61
+ /**
62
+ * `invalid_client` - Client authentication failed (e.g., unknown client,
63
+ * no client authentication included, or unsupported authentication method).
64
+ * The authorization server MAY return a HTTP 401 (Unauthorized) status code
65
+ * to indicate which HTTP authentication schemes are supported.
66
+ * If the client attempted to authenticate via the &quot;Authorization&quot; request header field,
67
+ * the authorization server MUST respond with a HTTP 401 (Unauthorized) status code and
68
+ * include the &quot;WWW-Authenticate&quot; response header field matching the authentication scheme used by the client.
69
+ */
70
+ OAuth2ErrorCodes["INVALID_CLIENT"] = "invalid_client";
71
+ /**
72
+ * `invalid_grant` - The provided authorization grant
73
+ * (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked,
74
+ * does not match the redirection URI used in the authorization request, or was issued to another client.
75
+ */
76
+ OAuth2ErrorCodes["INVALID_GRANT"] = "invalid_grant";
77
+ /**
78
+ * `unsupported_grant_type` - The authorization grant type is not supported by the authorization server.
79
+ */
80
+ OAuth2ErrorCodes["UNSUPPORTED_GRANT_TYPE"] = "unsupported_grant_type";
81
+ })(OAuth2ErrorCodes || (OAuth2ErrorCodes = {}));
82
+ //# sourceMappingURL=error-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-protocol.js","sourceRoot":"","sources":["../../../src/node/error/error-protocol.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBA4FX;AA5FD,WAAY,gBAAgB;IAExB;;;;OAIG;IACH,uDAAmC,CAAA;IAEnC;;;OAGG;IACH,+DAA2C,CAAA;IAE3C;;OAEG;IACH,mDAA+B,CAAA;IAE/B;;;OAGG;IACH,2EAAuD,CAAA;IAEvD;;;OAGG;IACH,mDAA+B,CAAA;IAE/B;;;;;;;;OAQG;IACH,6DAAyC,CAAA;IAEzC;;;;;;;OAOG;IACH,mDAA+B,CAAA;IAE/B;;;;;OAKG;IACH,iDAA6B,CAAA;IAE7B;;;;;OAKG;IACH,uEAAmD,CAAA;IAEnD;;;;;;;;OAQG;IACH,qDAAiC,CAAA;IAEjC;;;;OAIG;IACH,mDAA+B,CAAA;IAE/B;;OAEG;IACH,qEAAiD,CAAA;AAErD,CAAC,EA5FW,gBAAgB,KAAhB,gBAAgB,QA4F3B"}
@@ -0,0 +1,11 @@
1
+ import { CustomError } from '@celljs/core';
2
+ import { OAuth2Error } from '../endpoint/index.js';
3
+ import { AuthenticationError } from '@celljs/security/lib/node';
4
+ export declare class OAuth2AuthorizationError extends CustomError {
5
+ oauth2Error: OAuth2Error;
6
+ constructor(oauth2Error: OAuth2Error, error?: Error);
7
+ }
8
+ export declare class OAuth2AuthenticationError extends AuthenticationError {
9
+ oauth2Error: OAuth2Error;
10
+ constructor(oauth2Error: OAuth2Error, error?: Error);
11
+ }
@@ -0,0 +1,15 @@
1
+ import { CustomError } from '@celljs/core';
2
+ import { AuthenticationError } from '@celljs/security/lib/node';
3
+ export class OAuth2AuthorizationError extends CustomError {
4
+ constructor(oauth2Error, error) {
5
+ super(error ? error.message : oauth2Error.description);
6
+ this.oauth2Error = oauth2Error;
7
+ }
8
+ }
9
+ export class OAuth2AuthenticationError extends AuthenticationError {
10
+ constructor(oauth2Error, error) {
11
+ super(error ? error.message : oauth2Error.description);
12
+ this.oauth2Error = oauth2Error;
13
+ }
14
+ }
15
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/node/error/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IAErD,YAAmB,WAAwB,EAAE,KAAa;QACtD,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;2BADxC,WAAW;IAE9B,CAAC;CAEJ;AAED,MAAM,OAAO,yBAA0B,SAAQ,mBAAmB;IAE9D,YAAmB,WAAwB,EAAE,KAAa;QACtD,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;2BADxC,WAAW;IAE9B,CAAC;CAEJ"}
@@ -0,0 +1,2 @@
1
+ export * from './error.js';
2
+ export * from './error-protocol.js';
@@ -0,0 +1,3 @@
1
+ export * from './error.js';
2
+ export * from './error-protocol.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/error/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './authentication/index.js';
2
+ export * from './authorization/index.js';
3
+ export * from './endpoint/index.js';
4
+ export * from './oidc/index.js';
5
+ export * from './token/index.js';
6
+ export * from './error/index.js';
@@ -0,0 +1,7 @@
1
+ export * from './authentication/index.js';
2
+ export * from './authorization/index.js';
3
+ export * from './endpoint/index.js';
4
+ export * from './oidc/index.js';
5
+ export * from './token/index.js';
6
+ export * from './error/index.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ import './index.js';
2
+ declare const _default: import("inversify").interfaces.ContainerModule;
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { autoBind } from '@celljs/core';
2
+ import './index.js';
3
+ export default autoBind();
4
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/node/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,SAAS,CAAC;AAEjB,eAAe,QAAQ,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './oidc-protocol.js';
@@ -0,0 +1,2 @@
1
+ export * from './oidc-protocol.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/oidc/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,116 @@
1
+ export declare namespace OidcScopes {
2
+ /**
3
+ * The `openid`scope is required for OpenID Connect Authentication Requests.
4
+ */
5
+ const OPENID = "openid";
6
+ /**
7
+ * The `profile`scope requests access to the default profile claims, which are:
8
+ * `name, family_name, given_name, middle_name, nickname, preferred_username,
9
+ * profile, picture, website, gender, birthdate, zoneinfo, locale, updated_at}.
10
+ */
11
+ const PROFILE = "profile";
12
+ /**
13
+ * The `email`scope requests access to the `email`and `email_verified`claims.
14
+ */
15
+ const EMAIL = "email";
16
+ /**
17
+ * The `address`scope requests access to the `address`claim.
18
+ */
19
+ const ADDRESS = "address";
20
+ /**
21
+ * The `phone`scope requests access to the `phone_number`and `phone_number_verified`claims.
22
+ */
23
+ const PHONE = "phone";
24
+ }
25
+ export declare namespace OidcParameterNames {
26
+ /**
27
+ * `id_token`- used in the Access Token Response.
28
+ */
29
+ const ID_TOKEN = "id_token";
30
+ /**
31
+ * `nonce`- used in the Authentication Request.
32
+ */
33
+ const NONCE = "nonce";
34
+ }
35
+ export declare namespace StandardClaimNames {
36
+ /**
37
+ * `sub`- the Subject identifier
38
+ */
39
+ const SUB = "sub";
40
+ /**
41
+ * `name`- the user's full name
42
+ */
43
+ const NAME = "name";
44
+ /**
45
+ * `given_name`- the user's given name(s) or first name(s)
46
+ */
47
+ const GIVEN_NAME = "given_name";
48
+ /**
49
+ * `family_name`- the user's surname(s) or last name(s)
50
+ */
51
+ const FAMILY_NAME = "family_name";
52
+ /**
53
+ * `middle_name`- the user's middle name(s)
54
+ */
55
+ const MIDDLE_NAME = "middle_name";
56
+ /**
57
+ * `nickname`- the user's nick name that may or may not be the same as the `given_name}
58
+ */
59
+ const NICKNAME = "nickname";
60
+ /**
61
+ * `preferred_username`- the preferred username that the user wishes to be referred to
62
+ */
63
+ const PREFERRED_USERNAME = "preferred_username";
64
+ /**
65
+ * `profile`- the URL of the user's profile page
66
+ */
67
+ const PROFILE = "profile";
68
+ /**
69
+ * `picture`- the URL of the user's profile picture
70
+ */
71
+ const PICTURE = "picture";
72
+ /**
73
+ * `website`- the URL of the user's web page or blog
74
+ */
75
+ const WEBSITE = "website";
76
+ /**
77
+ * `email`- the user's preferred e-mail address
78
+ */
79
+ const EMAIL = "email";
80
+ /**
81
+ * `email_verified`- `true`if the user's e-mail address has been verified, otherwise `false}
82
+ */
83
+ const EMAIL_VERIFIED = "email_verified";
84
+ /**
85
+ * `gender`- the user's gender
86
+ */
87
+ const GENDER = "gender";
88
+ /**
89
+ * `birthdate`- the user's birth date
90
+ */
91
+ const BIRTHDATE = "birthdate";
92
+ /**
93
+ * `zoneinfo`- the user's time zone
94
+ */
95
+ const ZONEINFO = "zoneinfo";
96
+ /**
97
+ * `locale`- the user's locale
98
+ */
99
+ const LOCALE = "locale";
100
+ /**
101
+ * `phone_number`- the user's preferred phone number
102
+ */
103
+ const PHONE_NUMBER = "phone_number";
104
+ /**
105
+ * `phone_number_verified`- `true`if the user's phone number has been verified, otherwise `false}
106
+ */
107
+ const PHONE_NUMBER_VERIFIED = "phone_number_verified";
108
+ /**
109
+ * `address`- the user's preferred postal address
110
+ */
111
+ const ADDRESS = "address";
112
+ /**
113
+ * `updated_at`- the time the user's information was last updated
114
+ */
115
+ const UPDATED_AT = "updated_at";
116
+ }
@@ -0,0 +1,120 @@
1
+ export var OidcScopes;
2
+ (function (OidcScopes) {
3
+ /**
4
+ * The `openid`scope is required for OpenID Connect Authentication Requests.
5
+ */
6
+ OidcScopes.OPENID = 'openid';
7
+ /**
8
+ * The `profile`scope requests access to the default profile claims, which are:
9
+ * `name, family_name, given_name, middle_name, nickname, preferred_username,
10
+ * profile, picture, website, gender, birthdate, zoneinfo, locale, updated_at}.
11
+ */
12
+ OidcScopes.PROFILE = 'profile';
13
+ /**
14
+ * The `email`scope requests access to the `email`and `email_verified`claims.
15
+ */
16
+ OidcScopes.EMAIL = 'email';
17
+ /**
18
+ * The `address`scope requests access to the `address`claim.
19
+ */
20
+ OidcScopes.ADDRESS = 'address';
21
+ /**
22
+ * The `phone`scope requests access to the `phone_number`and `phone_number_verified`claims.
23
+ */
24
+ OidcScopes.PHONE = 'phone';
25
+ })(OidcScopes || (OidcScopes = {}));
26
+ export var OidcParameterNames;
27
+ (function (OidcParameterNames) {
28
+ /**
29
+ * `id_token`- used in the Access Token Response.
30
+ */
31
+ OidcParameterNames.ID_TOKEN = 'id_token';
32
+ /**
33
+ * `nonce`- used in the Authentication Request.
34
+ */
35
+ OidcParameterNames.NONCE = 'nonce';
36
+ })(OidcParameterNames || (OidcParameterNames = {}));
37
+ export var StandardClaimNames;
38
+ (function (StandardClaimNames) {
39
+ /**
40
+ * `sub`- the Subject identifier
41
+ */
42
+ StandardClaimNames.SUB = 'sub';
43
+ /**
44
+ * `name`- the user's full name
45
+ */
46
+ StandardClaimNames.NAME = 'name';
47
+ /**
48
+ * `given_name`- the user's given name(s) or first name(s)
49
+ */
50
+ StandardClaimNames.GIVEN_NAME = 'given_name';
51
+ /**
52
+ * `family_name`- the user's surname(s) or last name(s)
53
+ */
54
+ StandardClaimNames.FAMILY_NAME = 'family_name';
55
+ /**
56
+ * `middle_name`- the user's middle name(s)
57
+ */
58
+ StandardClaimNames.MIDDLE_NAME = 'middle_name';
59
+ /**
60
+ * `nickname`- the user's nick name that may or may not be the same as the `given_name}
61
+ */
62
+ StandardClaimNames.NICKNAME = 'nickname';
63
+ /**
64
+ * `preferred_username`- the preferred username that the user wishes to be referred to
65
+ */
66
+ StandardClaimNames.PREFERRED_USERNAME = 'preferred_username';
67
+ /**
68
+ * `profile`- the URL of the user's profile page
69
+ */
70
+ StandardClaimNames.PROFILE = 'profile';
71
+ /**
72
+ * `picture`- the URL of the user's profile picture
73
+ */
74
+ StandardClaimNames.PICTURE = 'picture';
75
+ /**
76
+ * `website`- the URL of the user's web page or blog
77
+ */
78
+ StandardClaimNames.WEBSITE = 'website';
79
+ /**
80
+ * `email`- the user's preferred e-mail address
81
+ */
82
+ StandardClaimNames.EMAIL = 'email';
83
+ /**
84
+ * `email_verified`- `true`if the user's e-mail address has been verified, otherwise `false}
85
+ */
86
+ StandardClaimNames.EMAIL_VERIFIED = 'email_verified';
87
+ /**
88
+ * `gender`- the user's gender
89
+ */
90
+ StandardClaimNames.GENDER = 'gender';
91
+ /**
92
+ * `birthdate`- the user's birth date
93
+ */
94
+ StandardClaimNames.BIRTHDATE = 'birthdate';
95
+ /**
96
+ * `zoneinfo`- the user's time zone
97
+ */
98
+ StandardClaimNames.ZONEINFO = 'zoneinfo';
99
+ /**
100
+ * `locale`- the user's locale
101
+ */
102
+ StandardClaimNames.LOCALE = 'locale';
103
+ /**
104
+ * `phone_number`- the user's preferred phone number
105
+ */
106
+ StandardClaimNames.PHONE_NUMBER = 'phone_number';
107
+ /**
108
+ * `phone_number_verified`- `true`if the user's phone number has been verified, otherwise `false}
109
+ */
110
+ StandardClaimNames.PHONE_NUMBER_VERIFIED = 'phone_number_verified';
111
+ /**
112
+ * `address`- the user's preferred postal address
113
+ */
114
+ StandardClaimNames.ADDRESS = 'address';
115
+ /**
116
+ * `updated_at`- the time the user's information was last updated
117
+ */
118
+ StandardClaimNames.UPDATED_AT = 'updated_at';
119
+ })(StandardClaimNames || (StandardClaimNames = {}));
120
+ //# sourceMappingURL=oidc-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oidc-protocol.js","sourceRoot":"","sources":["../../../src/node/oidc/oidc-protocol.ts"],"names":[],"mappings":"AAAA,MAAM,KAAW,UAAU,CA6B1B;AA7BD,WAAiB,UAAU;IAEvB;;OAEG;IACU,iBAAM,GAAG,QAAQ,CAAC;IAE/B;;;;OAIG;IACU,kBAAO,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACU,gBAAK,GAAG,OAAO,CAAC;IAE7B;;OAEG;IACU,kBAAO,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACU,gBAAK,GAAG,OAAO,CAAC;AAEjC,CAAC,EA7BgB,UAAU,KAAV,UAAU,QA6B1B;AAED,MAAM,KAAW,kBAAkB,CAYlC;AAZD,WAAiB,kBAAkB;IAE/B;;OAEG;IACU,2BAAQ,GAAG,UAAU,CAAC;IAEnC;;OAEG;IACU,wBAAK,GAAG,OAAO,CAAC;AAEjC,CAAC,EAZgB,kBAAkB,KAAlB,kBAAkB,QAYlC;AAED,MAAM,KAAW,kBAAkB,CAsGlC;AAtGD,WAAiB,kBAAkB;IAE/B;;OAEG;IACU,sBAAG,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACU,uBAAI,GAAG,MAAM,CAAC;IAE3B;;OAEG;IACU,6BAAU,GAAG,YAAY,CAAC;IAEvC;;OAEG;IACU,8BAAW,GAAG,aAAa,CAAC;IAEzC;;OAEG;IACU,8BAAW,GAAG,aAAa,CAAC;IAEzC;;OAEG;IACU,2BAAQ,GAAG,UAAU,CAAC;IAEnC;;OAEG;IACU,qCAAkB,GAAG,oBAAoB,CAAC;IAEvD;;OAEG;IACU,0BAAO,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACU,0BAAO,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACU,0BAAO,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACU,wBAAK,GAAG,OAAO,CAAC;IAE7B;;OAEG;IACU,iCAAc,GAAG,gBAAgB,CAAC;IAE/C;;OAEG;IACU,yBAAM,GAAG,QAAQ,CAAC;IAE/B;;OAEG;IACU,4BAAS,GAAG,WAAW,CAAC;IAErC;;OAEG;IACU,2BAAQ,GAAG,UAAU,CAAC;IAEnC;;OAEG;IACU,yBAAM,GAAG,QAAQ,CAAC;IAE/B;;OAEG;IACU,+BAAY,GAAG,cAAc,CAAC;IAE3C;;OAEG;IACU,wCAAqB,GAAG,uBAAuB,CAAC;IAE7D;;OAEG;IACU,0BAAO,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACU,6BAAU,GAAG,YAAY,CAAC;AAE3C,CAAC,EAtGgB,kBAAkB,KAAlB,kBAAkB,QAsGlC"}
@@ -0,0 +1 @@
1
+ export * from './token-protocol.js';
@@ -0,0 +1,2 @@
1
+ export * from './token-protocol.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/token/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,65 @@
1
+ export interface Token {
2
+ tokenValue: string;
3
+ issuedAt: number;
4
+ }
5
+ export declare enum TokenType {
6
+ Bearer = "Bearer"
7
+ }
8
+ export interface AccessToken extends Token {
9
+ tokenType?: TokenType;
10
+ scopes: string[];
11
+ expiresAt: number;
12
+ }
13
+ export interface RefreshToken extends Token {
14
+ }
15
+ export declare namespace IdTokenClaimNames {
16
+ /**
17
+ * `iss`- the Issuer identifier
18
+ */
19
+ const ISS = "iss";
20
+ /**
21
+ * `sub`- the Subject identifier
22
+ */
23
+ const SUB = "sub";
24
+ /**
25
+ * `aud`- the Audience(s) that the ID Token is intended for
26
+ */
27
+ const AUD = "aud";
28
+ /**
29
+ * `exp`- the Expiration time on or after which the ID Token MUST NOT be accepted
30
+ */
31
+ const EXP = "exp";
32
+ /**
33
+ * `iat`- the time at which the ID Token was issued
34
+ */
35
+ const IAT = "iat";
36
+ /**
37
+ * `auth_time`- the time when the End-User authentication occurred
38
+ */
39
+ const AUTH_TIME = "auth_time";
40
+ /**
41
+ * `nonce`- a `export const`value used to associate a Client session with an ID Token,
42
+ * and to mitigate replay attacks.
43
+ */
44
+ const NONCE = "nonce";
45
+ /**
46
+ * `acr`- the Authentication Context Class Reference
47
+ */
48
+ const ACR = "acr";
49
+ /**
50
+ * `amr`- the Authentication Methods References
51
+ */
52
+ const AMR = "amr";
53
+ /**
54
+ * `azp`- the Authorized party to which the ID Token was issued
55
+ */
56
+ const AZP = "azp";
57
+ /**
58
+ * `at_hash`- the Access Token hash value
59
+ */
60
+ const AT_HASH = "at_hash";
61
+ /**
62
+ * `c_hash`- the Authorization Code hash value
63
+ */
64
+ const C_HASH = "c_hash";
65
+ }
@@ -0,0 +1,57 @@
1
+ export var TokenType;
2
+ (function (TokenType) {
3
+ TokenType["Bearer"] = "Bearer";
4
+ })(TokenType || (TokenType = {}));
5
+ export var IdTokenClaimNames;
6
+ (function (IdTokenClaimNames) {
7
+ /**
8
+ * `iss`- the Issuer identifier
9
+ */
10
+ IdTokenClaimNames.ISS = 'iss';
11
+ /**
12
+ * `sub`- the Subject identifier
13
+ */
14
+ IdTokenClaimNames.SUB = 'sub';
15
+ /**
16
+ * `aud`- the Audience(s) that the ID Token is intended for
17
+ */
18
+ IdTokenClaimNames.AUD = 'aud';
19
+ /**
20
+ * `exp`- the Expiration time on or after which the ID Token MUST NOT be accepted
21
+ */
22
+ IdTokenClaimNames.EXP = 'exp';
23
+ /**
24
+ * `iat`- the time at which the ID Token was issued
25
+ */
26
+ IdTokenClaimNames.IAT = 'iat';
27
+ /**
28
+ * `auth_time`- the time when the End-User authentication occurred
29
+ */
30
+ IdTokenClaimNames.AUTH_TIME = 'auth_time';
31
+ /**
32
+ * `nonce`- a `export const`value used to associate a Client session with an ID Token,
33
+ * and to mitigate replay attacks.
34
+ */
35
+ IdTokenClaimNames.NONCE = 'nonce';
36
+ /**
37
+ * `acr`- the Authentication Context Class Reference
38
+ */
39
+ IdTokenClaimNames.ACR = 'acr';
40
+ /**
41
+ * `amr`- the Authentication Methods References
42
+ */
43
+ IdTokenClaimNames.AMR = 'amr';
44
+ /**
45
+ * `azp`- the Authorized party to which the ID Token was issued
46
+ */
47
+ IdTokenClaimNames.AZP = 'azp';
48
+ /**
49
+ * `at_hash`- the Access Token hash value
50
+ */
51
+ IdTokenClaimNames.AT_HASH = 'at_hash';
52
+ /**
53
+ * `c_hash`- the Authorization Code hash value
54
+ */
55
+ IdTokenClaimNames.C_HASH = 'c_hash';
56
+ })(IdTokenClaimNames || (IdTokenClaimNames = {}));
57
+ //# sourceMappingURL=token-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-protocol.js","sourceRoot":"","sources":["../../../src/node/token/token-protocol.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,SAEX;AAFD,WAAY,SAAS;IACjB,8BAAiB,CAAA;AACrB,CAAC,EAFW,SAAS,KAAT,SAAS,QAEpB;AAUD,MAAM,KAAW,iBAAiB,CA+DjC;AA/DD,WAAiB,iBAAiB;IAE9B;;OAEG;IACU,qBAAG,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACU,qBAAG,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACU,qBAAG,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACU,qBAAG,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACU,qBAAG,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACU,2BAAS,GAAG,WAAW,CAAC;IAErC;;;OAGG;IACU,uBAAK,GAAG,OAAO,CAAC;IAE7B;;OAEG;IACU,qBAAG,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACU,qBAAG,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACU,qBAAG,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACU,yBAAO,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACU,wBAAM,GAAG,QAAQ,CAAC;AAEnC,CAAC,EA/DgB,iBAAiB,KAAjB,iBAAiB,QA+DjC"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/oauth2-core",
3
- "version": "3.8.0",
3
+ "version": "3.9.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "cell-component"
@@ -18,19 +18,20 @@
18
18
  "typings": "lib/node/index.d.ts",
19
19
  "files": [
20
20
  "lib",
21
+ "esm",
21
22
  "src",
22
23
  "cell.yml"
23
24
  ],
24
25
  "scripts": {
25
- "build": "tsc -b",
26
- "clean": "rm -rf lib *.tsbuildinfo",
26
+ "build": "tsc -b && bun ../../scripts/build-esm.ts",
27
+ "clean": "rm -rf lib esm *.tsbuildinfo",
27
28
  "test": "bun test --preload reflect-metadata ./lib",
28
29
  "watch": "tsc -b -w --preserveWatchOutput"
29
30
  },
30
31
  "dependencies": {
31
- "@celljs/core": "3.8.0",
32
- "@celljs/security": "3.8.0",
33
- "@celljs/web": "3.8.0",
32
+ "@celljs/core": "3.9.0",
33
+ "@celljs/security": "3.9.0",
34
+ "@celljs/web": "3.9.0",
34
35
  "tslib": "^2.8.0"
35
36
  },
36
37
  "devDependencies": {
@@ -39,5 +40,59 @@
39
40
  },
40
41
  "publishConfig": {
41
42
  "access": "public"
43
+ },
44
+ "exports": {
45
+ ".": {
46
+ "webpack": "./lib/node/index.js",
47
+ "import": "./esm/node/index.js",
48
+ "default": "./lib/node/index.js"
49
+ },
50
+ "./package.json": "./package.json",
51
+ "./lib/node": {
52
+ "webpack": "./lib/node/index.js",
53
+ "import": "./esm/node/index.js",
54
+ "default": "./lib/node/index.js"
55
+ },
56
+ "./lib/node/authentication": {
57
+ "webpack": "./lib/node/authentication/index.js",
58
+ "import": "./esm/node/authentication/index.js",
59
+ "default": "./lib/node/authentication/index.js"
60
+ },
61
+ "./lib/node/authorization": {
62
+ "webpack": "./lib/node/authorization/index.js",
63
+ "import": "./esm/node/authorization/index.js",
64
+ "default": "./lib/node/authorization/index.js"
65
+ },
66
+ "./lib/node/endpoint": {
67
+ "webpack": "./lib/node/endpoint/index.js",
68
+ "import": "./esm/node/endpoint/index.js",
69
+ "default": "./lib/node/endpoint/index.js"
70
+ },
71
+ "./lib/node/error": {
72
+ "webpack": "./lib/node/error/index.js",
73
+ "import": "./esm/node/error/index.js",
74
+ "default": "./lib/node/error/index.js"
75
+ },
76
+ "./lib/node/oidc": {
77
+ "webpack": "./lib/node/oidc/index.js",
78
+ "import": "./esm/node/oidc/index.js",
79
+ "default": "./lib/node/oidc/index.js"
80
+ },
81
+ "./lib/node/token": {
82
+ "webpack": "./lib/node/token/index.js",
83
+ "import": "./esm/node/token/index.js",
84
+ "default": "./lib/node/token/index.js"
85
+ },
86
+ "./lib/*.js": {
87
+ "webpack": "./lib/*.js",
88
+ "import": "./esm/*.js",
89
+ "default": "./lib/*.js"
90
+ },
91
+ "./lib/*": {
92
+ "webpack": "./lib/*.js",
93
+ "import": "./esm/*.js",
94
+ "default": "./lib/*.js"
95
+ },
96
+ "./*": "./*"
42
97
  }
43
98
  }