@tsed/oidc-provider 7.83.3 → 8.0.0-alpha.10

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 (127) hide show
  1. package/lib/esm/OidcModule.js.map +1 -1
  2. package/lib/esm/decorators/grantId.js.map +1 -1
  3. package/lib/esm/decorators/interaction.js.map +1 -1
  4. package/lib/esm/decorators/interactions.js.map +1 -1
  5. package/lib/esm/decorators/noCache.js.map +1 -1
  6. package/lib/esm/decorators/oidcCtx.js.map +1 -1
  7. package/lib/esm/decorators/oidcSession.js.map +1 -1
  8. package/lib/esm/decorators/params.js.map +1 -1
  9. package/lib/esm/decorators/prompt.js.map +1 -1
  10. package/lib/esm/decorators/uid.js.map +1 -1
  11. package/lib/esm/middlewares/OidcInteractionMiddleware.js.map +1 -1
  12. package/lib/esm/middlewares/OidcNoCacheMiddleware.js.map +1 -1
  13. package/lib/esm/middlewares/OidcSecureMiddleware.js.map +1 -1
  14. package/lib/esm/services/OidcAdapters.js.map +1 -1
  15. package/lib/esm/services/OidcInteractionContext.js +1 -1
  16. package/lib/esm/services/OidcInteractionContext.js.map +1 -1
  17. package/lib/esm/services/OidcInteractions.js.map +1 -1
  18. package/lib/esm/services/OidcJwks.js +1 -1
  19. package/lib/esm/services/OidcJwks.js.map +1 -1
  20. package/lib/esm/services/OidcPolicy.js.map +1 -1
  21. package/lib/esm/services/OidcProvider.js +0 -1
  22. package/lib/esm/services/OidcProvider.js.map +1 -1
  23. package/lib/esm/utils/debug.js.map +1 -1
  24. package/lib/types/domain/OidcSettings.d.ts +1 -1
  25. package/lib/types/domain/interfaces.d.ts +1 -1
  26. package/lib/types/services/OidcInteractionContext.d.ts +1 -1
  27. package/lib/types/services/OidcProvider.d.ts +1 -1
  28. package/package.json +32 -30
  29. package/vitest.config.mts +5 -5
  30. package/lib/cjs/OidcModule.js +0 -84
  31. package/lib/cjs/OidcModule.js.map +0 -1
  32. package/lib/cjs/constants/constants.js +0 -14
  33. package/lib/cjs/constants/constants.js.map +0 -1
  34. package/lib/cjs/decorators/grantId.js +0 -11
  35. package/lib/cjs/decorators/grantId.js.map +0 -1
  36. package/lib/cjs/decorators/interaction.js +0 -17
  37. package/lib/cjs/decorators/interaction.js.map +0 -1
  38. package/lib/cjs/decorators/interactions.js +0 -14
  39. package/lib/cjs/decorators/interactions.js.map +0 -1
  40. package/lib/cjs/decorators/noCache.js +0 -10
  41. package/lib/cjs/decorators/noCache.js.map +0 -1
  42. package/lib/cjs/decorators/oidcCtx.js +0 -11
  43. package/lib/cjs/decorators/oidcCtx.js.map +0 -1
  44. package/lib/cjs/decorators/oidcSession.js +0 -14
  45. package/lib/cjs/decorators/oidcSession.js.map +0 -1
  46. package/lib/cjs/decorators/params.js +0 -11
  47. package/lib/cjs/decorators/params.js.map +0 -1
  48. package/lib/cjs/decorators/prompt.js +0 -11
  49. package/lib/cjs/decorators/prompt.js.map +0 -1
  50. package/lib/cjs/decorators/uid.js +0 -11
  51. package/lib/cjs/decorators/uid.js.map +0 -1
  52. package/lib/cjs/domain/InteractionMethods.js +0 -3
  53. package/lib/cjs/domain/InteractionMethods.js.map +0 -1
  54. package/lib/cjs/domain/OidcAccountsMethods.js +0 -3
  55. package/lib/cjs/domain/OidcAccountsMethods.js.map +0 -1
  56. package/lib/cjs/domain/OidcBadInteractionName.js +0 -8
  57. package/lib/cjs/domain/OidcBadInteractionName.js.map +0 -1
  58. package/lib/cjs/domain/OidcInteractionMethods.js +0 -3
  59. package/lib/cjs/domain/OidcInteractionMethods.js.map +0 -1
  60. package/lib/cjs/domain/OidcInteractionOptions.js +0 -3
  61. package/lib/cjs/domain/OidcInteractionOptions.js.map +0 -1
  62. package/lib/cjs/domain/OidcInteractionPromptProps.js +0 -3
  63. package/lib/cjs/domain/OidcInteractionPromptProps.js.map +0 -1
  64. package/lib/cjs/domain/OidcSettings.js +0 -3
  65. package/lib/cjs/domain/OidcSettings.js.map +0 -1
  66. package/lib/cjs/domain/interfaces.js +0 -3
  67. package/lib/cjs/domain/interfaces.js.map +0 -1
  68. package/lib/cjs/index.js +0 -38
  69. package/lib/cjs/index.js.map +0 -1
  70. package/lib/cjs/middlewares/OidcInteractionMiddleware.js +0 -20
  71. package/lib/cjs/middlewares/OidcInteractionMiddleware.js.map +0 -1
  72. package/lib/cjs/middlewares/OidcNoCacheMiddleware.js +0 -22
  73. package/lib/cjs/middlewares/OidcNoCacheMiddleware.js.map +0 -1
  74. package/lib/cjs/middlewares/OidcSecureMiddleware.js +0 -38
  75. package/lib/cjs/middlewares/OidcSecureMiddleware.js.map +0 -1
  76. package/lib/cjs/package.json +0 -3
  77. package/lib/cjs/services/OidcAdapters.js +0 -85
  78. package/lib/cjs/services/OidcAdapters.js.map +0 -1
  79. package/lib/cjs/services/OidcInteractionContext.js +0 -165
  80. package/lib/cjs/services/OidcInteractionContext.js.map +0 -1
  81. package/lib/cjs/services/OidcInteractions.js +0 -64
  82. package/lib/cjs/services/OidcInteractions.js.map +0 -1
  83. package/lib/cjs/services/OidcJwks.js +0 -31
  84. package/lib/cjs/services/OidcJwks.js.map +0 -1
  85. package/lib/cjs/services/OidcPolicy.js +0 -78
  86. package/lib/cjs/services/OidcPolicy.js.map +0 -1
  87. package/lib/cjs/services/OidcProvider.js +0 -201
  88. package/lib/cjs/services/OidcProvider.js.map +0 -1
  89. package/lib/cjs/services/OidcProviderNodeModule.js +0 -16
  90. package/lib/cjs/services/OidcProviderNodeModule.js.map +0 -1
  91. package/lib/cjs/utils/debug.js +0 -25
  92. package/lib/cjs/utils/debug.js.map +0 -1
  93. package/lib/cjs/utils/events.js +0 -64
  94. package/lib/cjs/utils/events.js.map +0 -1
  95. package/lib/esm/package.json +0 -3
  96. package/lib/types-esm/OidcModule.d.ts +0 -14
  97. package/lib/types-esm/constants/constants.d.ts +0 -10
  98. package/lib/types-esm/decorators/grantId.d.ts +0 -2
  99. package/lib/types-esm/decorators/interaction.d.ts +0 -5
  100. package/lib/types-esm/decorators/interactions.d.ts +0 -6
  101. package/lib/types-esm/decorators/noCache.d.ts +0 -1
  102. package/lib/types-esm/decorators/oidcCtx.d.ts +0 -3
  103. package/lib/types-esm/decorators/oidcSession.d.ts +0 -6
  104. package/lib/types-esm/decorators/params.d.ts +0 -2
  105. package/lib/types-esm/decorators/prompt.d.ts +0 -3
  106. package/lib/types-esm/decorators/uid.d.ts +0 -2
  107. package/lib/types-esm/domain/InteractionMethods.d.ts +0 -10
  108. package/lib/types-esm/domain/OidcAccountsMethods.d.ts +0 -5
  109. package/lib/types-esm/domain/OidcBadInteractionName.d.ts +0 -3
  110. package/lib/types-esm/domain/OidcInteractionMethods.d.ts +0 -3
  111. package/lib/types-esm/domain/OidcInteractionOptions.d.ts +0 -8
  112. package/lib/types-esm/domain/OidcInteractionPromptProps.d.ts +0 -9
  113. package/lib/types-esm/domain/OidcSettings.d.ts +0 -67
  114. package/lib/types-esm/domain/interfaces.d.ts +0 -12
  115. package/lib/types-esm/index.d.ts +0 -34
  116. package/lib/types-esm/middlewares/OidcInteractionMiddleware.d.ts +0 -5
  117. package/lib/types-esm/middlewares/OidcNoCacheMiddleware.d.ts +0 -4
  118. package/lib/types-esm/middlewares/OidcSecureMiddleware.d.ts +0 -4
  119. package/lib/types-esm/services/OidcAdapters.d.ts +0 -9
  120. package/lib/types-esm/services/OidcInteractionContext.d.ts +0 -38
  121. package/lib/types-esm/services/OidcInteractions.d.ts +0 -14
  122. package/lib/types-esm/services/OidcJwks.d.ts +0 -8
  123. package/lib/types-esm/services/OidcPolicy.d.ts +0 -16
  124. package/lib/types-esm/services/OidcProvider.d.ts +0 -40
  125. package/lib/types-esm/services/OidcProviderNodeModule.d.ts +0 -7
  126. package/lib/types-esm/utils/debug.d.ts +0 -1
  127. package/lib/types-esm/utils/events.d.ts +0 -5
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OidcJwks = void 0;
4
- const tslib_1 = require("tslib");
5
- const di_1 = require("@tsed/di");
6
- const path_1 = require("path");
7
- const jwks_1 = require("@tsed/jwks");
8
- let OidcJwks = class OidcJwks {
9
- $onInit() {
10
- return this.getJwks();
11
- }
12
- getJwks() {
13
- return (0, jwks_1.getJwks)({
14
- path: this.jwksPath,
15
- certificates: this.certificates
16
- });
17
- }
18
- };
19
- tslib_1.__decorate([
20
- (0, di_1.Constant)("oidc.jwksPath", (0, path_1.join)(process.cwd(), "keys", "jwks.json")),
21
- tslib_1.__metadata("design:type", String)
22
- ], OidcJwks.prototype, "jwksPath", void 0);
23
- tslib_1.__decorate([
24
- (0, di_1.Constant)("oidc.certificates"),
25
- tslib_1.__metadata("design:type", Array)
26
- ], OidcJwks.prototype, "certificates", void 0);
27
- OidcJwks = tslib_1.__decorate([
28
- (0, di_1.Injectable)()
29
- ], OidcJwks);
30
- exports.OidcJwks = OidcJwks;
31
- //# sourceMappingURL=OidcJwks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OidcJwks.js","sourceRoot":"","sources":["../../../src/services/OidcJwks.ts"],"names":[],"mappings":";;;;AAAA,iCAA8C;AAC9C,+BAA0B;AAC1B,qCAAsD;AAG/C,IAAM,QAAQ,GAAd,MAAM,QAAQ;IASnB,OAAO;QACL,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,OAAO;QACL,OAAO,IAAA,cAAO,EAAC;YACb,IAAI,EAAE,IAAI,CAAC,QAAQ;YACnB,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAlBC;IAAC,IAAA,aAAQ,EAAC,eAAe,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;;0CACnD;AAEjB;IAAC,IAAA,aAAQ,EAAC,mBAAmB,CAAC;;8CACK;AALxB,QAAQ;IADpB,IAAA,eAAU,GAAE;GACA,QAAQ,CAmBpB;AAnBY,4BAAQ"}
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OidcPolicy = void 0;
4
- const tslib_1 = require("tslib");
5
- const di_1 = require("@tsed/di");
6
- const OidcInteractions_js_1 = require("./OidcInteractions.js");
7
- const OidcProviderNodeModule_js_1 = require("./OidcProviderNodeModule.js");
8
- let OidcPolicy = class OidcPolicy {
9
- constructor(module) {
10
- this.module = module;
11
- }
12
- getPolicy() {
13
- let policy = this.module.interactionPolicy.base();
14
- const { usePriority, interactions } = this.getInteractions();
15
- if (interactions.size) {
16
- for (const { name, instance, options } of interactions.values()) {
17
- if (!policy.get(name)) {
18
- const prompt = this.createPrompt(instance, options);
19
- policy.add(prompt, options.priority);
20
- }
21
- if (instance.$onCreate) {
22
- instance.$onCreate(policy.get(name));
23
- }
24
- }
25
- // reordering interactions by interactions index
26
- if (!usePriority) {
27
- policy = policy.sort((a, b) => {
28
- const o1 = interactions.get(a.name)?.order || 0;
29
- const o2 = interactions.get(b.name)?.order || 0;
30
- return o1 < o2 ? -1 : 1;
31
- });
32
- }
33
- }
34
- return this.injector.alter("$alterOidcPolicy", policy);
35
- }
36
- createPrompt(instance, options) {
37
- const { checks: originalChecks = [], details, ...promptOptions } = options;
38
- const checks = [...(instance.checks ? instance.checks() : originalChecks)].filter(Boolean);
39
- return new this.module.interactionPolicy.Prompt(promptOptions, instance.details ? instance.details.bind(instance) : details, ...checks);
40
- }
41
- getInteractions() {
42
- let usePriority = false;
43
- const interactions = this.oidcInteractions.getInteractions();
44
- const map = interactions.reduce((map, provider, index) => {
45
- const instance = this.injector.get(provider.token);
46
- const options = provider.store.get("interactionOptions");
47
- if (options.priority !== undefined) {
48
- usePriority = true;
49
- }
50
- return map.set(options.name, {
51
- order: index,
52
- name: options.name,
53
- provider,
54
- instance,
55
- options
56
- });
57
- }, new Map());
58
- return {
59
- interactions: map,
60
- usePriority
61
- };
62
- }
63
- };
64
- tslib_1.__decorate([
65
- (0, di_1.Inject)(),
66
- tslib_1.__metadata("design:type", di_1.InjectorService)
67
- ], OidcPolicy.prototype, "injector", void 0);
68
- tslib_1.__decorate([
69
- (0, di_1.Inject)(),
70
- tslib_1.__metadata("design:type", OidcInteractions_js_1.OidcInteractions)
71
- ], OidcPolicy.prototype, "oidcInteractions", void 0);
72
- OidcPolicy = tslib_1.__decorate([
73
- (0, di_1.Injectable)(),
74
- tslib_1.__param(0, (0, di_1.Inject)(OidcProviderNodeModule_js_1.OIDC_PROVIDER_NODE_MODULE)),
75
- tslib_1.__metadata("design:paramtypes", [Object])
76
- ], OidcPolicy);
77
- exports.OidcPolicy = OidcPolicy;
78
- //# sourceMappingURL=OidcPolicy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OidcPolicy.js","sourceRoot":"","sources":["../../../src/services/OidcPolicy.ts"],"names":[],"mappings":";;;;AAAA,iCAAuE;AAKvE,+DAAuD;AACvD,2EAAsE;AAI/D,IAAM,UAAU,GAAhB,MAAM,UAAU;IAOrB,YAAyD,MAAiC;QAAjC,WAAM,GAAN,MAAM,CAA2B;IAAG,CAAC;IAEvF,SAAS;QACd,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAClD,MAAM,EAAC,WAAW,EAAE,YAAY,EAAC,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAE3D,IAAI,YAAY,CAAC,IAAI,EAAE;YACrB,KAAK,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAC,IAAI,YAAY,CAAC,MAAM,EAAE,EAAE;gBAC7D,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBACrB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;oBAEpD,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;iBACtC;gBAED,IAAI,QAAQ,CAAC,SAAS,EAAE;oBACtB,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AAK,CAAC;QAExB,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,CAAC;QAE7D,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAC7B,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;YACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAqB,QAAQ,CAAC,KAAK,CAAE,CAAC;YAExE,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAEzD,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE;gBAClC,WAAW,GAAG,IAAI,CAAC;aACpB;YAED,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE;gBAC3B,KAAK,EAAE,KAAK;gBACZ,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,QAAQ;gBACR,QAAQ;gBACR,OAAO;aACR,CAAC,CAAC;QACL,CAAC,EACD,IAAI,GAAG,EASJ,CACJ,CAAC;QAEF,OAAO;YACL,YAAY,EAAE,GAAG;YACjB,WAAW;SACZ,CAAC;IACJ,CAAC;CACF,CAAA;AAtFC;IAAC,IAAA,WAAM,GAAE;sCACW,oBAAe;4CAAC;AAEpC;IAAC,IAAA,WAAM,GAAE;sCACmB,sCAAgB;oDAAC;AALlC,UAAU;IADtB,IAAA,eAAU,GAAE;IAQE,mBAAA,IAAA,WAAM,EAAC,qDAAyB,CAAC,CAAA;;GAPnC,UAAU,CAuFtB;AAvFY,gCAAU"}
@@ -1,201 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OidcProvider = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@tsed/common");
6
- const core_1 = require("@tsed/core");
7
- const di_1 = require("@tsed/di");
8
- const constants_js_1 = require("../constants/constants.js");
9
- const events_js_1 = require("../utils/events.js");
10
- const OidcAdapters_js_1 = require("./OidcAdapters.js");
11
- const OidcInteractions_js_1 = require("./OidcInteractions.js");
12
- const OidcJwks_js_1 = require("./OidcJwks.js");
13
- const OidcPolicy_js_1 = require("./OidcPolicy.js");
14
- const OidcProviderNodeModule_js_1 = require("./OidcProviderNodeModule.js");
15
- function mapError(error) {
16
- return Object.getOwnPropertyNames(error).reduce((obj, key) => {
17
- return {
18
- ...obj,
19
- [key]: error[key]
20
- };
21
- }, {});
22
- }
23
- let OidcProvider = class OidcProvider {
24
- constructor(module) {
25
- this.module = module;
26
- }
27
- get logger() {
28
- return this.$ctx?.logger || this.injector.logger;
29
- }
30
- hasConfiguration() {
31
- return !!this.oidc;
32
- }
33
- async getConfiguration() {
34
- const [jwks, adapter] = await Promise.all([this.oidcJwks.getJwks(), this.adapters.createAdapterClass()]);
35
- const { issuer, jwksPath, secureKey, proxy, Accounts, secureCookies = this.env == core_1.Env.PROD, Adapter, connectionName, render, ...options } = this.oidc;
36
- const configuration = {
37
- interactions: {
38
- /* istanbul ignore next */
39
- url: (ctx, interaction) => `interaction/${interaction.uid}`
40
- },
41
- ...options,
42
- adapter,
43
- jwks
44
- };
45
- if (Accounts) {
46
- configuration.findAccount = (ctx, id, token) => this.injector.get(Accounts).findAccount(id, token);
47
- }
48
- if (secureCookies) {
49
- (0, core_1.setValue)(configuration, "cookies.short.secure", true);
50
- (0, core_1.setValue)(configuration, "cookies.long.secure", true);
51
- }
52
- const policy = this.oidcPolicy.getPolicy();
53
- if (policy) {
54
- (0, core_1.setValue)(configuration, "interactions.policy", policy);
55
- }
56
- const url = this.getInteractionsUrl();
57
- if (url) {
58
- (0, core_1.setValue)(configuration, "interactions.url", url);
59
- }
60
- return configuration;
61
- }
62
- getIssuer() {
63
- if (this.issuer) {
64
- return this.issuer;
65
- }
66
- // istanbul ignore next
67
- if (this.httpsPort) {
68
- return `https://localhost:${this.httpsPort}`;
69
- }
70
- return `http://localhost:${this.httpPort}`;
71
- }
72
- get() {
73
- return this.raw;
74
- }
75
- /**
76
- * Create a new instance of OidcProvider
77
- */
78
- async create() {
79
- const { proxy = this.env === core_1.Env.PROD, secureKey, allowHttpLocalhost = this.env !== core_1.Env.PROD } = this.oidc;
80
- const configuration = await this.getConfiguration();
81
- await this.injector.alterAsync("$alterOidcConfiguration", configuration);
82
- const oidcProvider = new this.module.Provider(this.getIssuer(), configuration);
83
- if (proxy) {
84
- // istanbul ignore next
85
- switch (this.platformName) {
86
- default:
87
- case "express":
88
- oidcProvider.proxy = true;
89
- break;
90
- case "koa":
91
- this.app.rawApp.proxy = true;
92
- break;
93
- }
94
- }
95
- if (secureKey) {
96
- oidcProvider.app.keys = secureKey;
97
- }
98
- this.raw = oidcProvider;
99
- if (allowHttpLocalhost) {
100
- this.allowHttpLocalhost();
101
- }
102
- events_js_1.OIDC_ERROR_EVENTS.map((event) => {
103
- this.raw.on(event, this.createErrorHandler(event));
104
- });
105
- await this.injector.emit("$onCreateOIDC", this.raw);
106
- return this.raw;
107
- }
108
- createErrorHandler(event) {
109
- return (ctx, error, accountId, sid) => {
110
- this.logger.error({
111
- event: "OIDC_ERROR",
112
- type: event,
113
- error: mapError(error),
114
- account_id: accountId,
115
- params: ctx.oidc.params,
116
- headers: ctx.headers,
117
- sid
118
- });
119
- // TODO see if we need to call platformExceptions
120
- // this.platformExceptions.catch(error, ctx.request.$ctx);
121
- };
122
- }
123
- getInteractionsUrl() {
124
- const provider = this.injector.getProviders().find((provider) => provider.subType === constants_js_1.INTERACTIONS);
125
- if (provider) {
126
- return (ctx, interaction) => {
127
- // eslint-disable-line no-unused-vars
128
- return provider.path.replace(/:uid/, interaction.uid);
129
- };
130
- }
131
- }
132
- allowHttpLocalhost() {
133
- const { invalidate: orig } = this.raw.Client.Schema.prototype;
134
- this.raw.Client.Schema.prototype.invalidate = function invalidate(message, code) {
135
- if (code === "implicit-force-https" || code === "implicit-forbid-localhost") {
136
- return;
137
- }
138
- /* istanbul ignore next */
139
- return orig.call(this, message);
140
- };
141
- }
142
- };
143
- tslib_1.__decorate([
144
- (0, di_1.Constant)("env"),
145
- tslib_1.__metadata("design:type", String)
146
- ], OidcProvider.prototype, "env", void 0);
147
- tslib_1.__decorate([
148
- (0, di_1.Constant)("httpPort"),
149
- tslib_1.__metadata("design:type", Object)
150
- ], OidcProvider.prototype, "httpPort", void 0);
151
- tslib_1.__decorate([
152
- (0, di_1.Constant)("httpsPort"),
153
- tslib_1.__metadata("design:type", Object)
154
- ], OidcProvider.prototype, "httpsPort", void 0);
155
- tslib_1.__decorate([
156
- (0, di_1.Constant)("oidc.issuer", ""),
157
- tslib_1.__metadata("design:type", String)
158
- ], OidcProvider.prototype, "issuer", void 0);
159
- tslib_1.__decorate([
160
- (0, di_1.Constant)("oidc"),
161
- tslib_1.__metadata("design:type", Object)
162
- ], OidcProvider.prototype, "oidc", void 0);
163
- tslib_1.__decorate([
164
- (0, di_1.Constant)("PLATFORM_NAME"),
165
- tslib_1.__metadata("design:type", String)
166
- ], OidcProvider.prototype, "platformName", void 0);
167
- tslib_1.__decorate([
168
- (0, di_1.Inject)(),
169
- tslib_1.__metadata("design:type", OidcJwks_js_1.OidcJwks)
170
- ], OidcProvider.prototype, "oidcJwks", void 0);
171
- tslib_1.__decorate([
172
- (0, di_1.Inject)(),
173
- tslib_1.__metadata("design:type", OidcInteractions_js_1.OidcInteractions)
174
- ], OidcProvider.prototype, "oidcInteractions", void 0);
175
- tslib_1.__decorate([
176
- (0, di_1.Inject)(),
177
- tslib_1.__metadata("design:type", OidcPolicy_js_1.OidcPolicy)
178
- ], OidcProvider.prototype, "oidcPolicy", void 0);
179
- tslib_1.__decorate([
180
- (0, di_1.Inject)(),
181
- tslib_1.__metadata("design:type", OidcAdapters_js_1.OidcAdapters)
182
- ], OidcProvider.prototype, "adapters", void 0);
183
- tslib_1.__decorate([
184
- (0, di_1.Inject)(),
185
- tslib_1.__metadata("design:type", di_1.InjectorService)
186
- ], OidcProvider.prototype, "injector", void 0);
187
- tslib_1.__decorate([
188
- (0, di_1.Inject)(),
189
- tslib_1.__metadata("design:type", common_1.PlatformApplication)
190
- ], OidcProvider.prototype, "app", void 0);
191
- tslib_1.__decorate([
192
- (0, common_1.InjectContext)(),
193
- tslib_1.__metadata("design:type", common_1.PlatformContext)
194
- ], OidcProvider.prototype, "$ctx", void 0);
195
- OidcProvider = tslib_1.__decorate([
196
- (0, di_1.Injectable)(),
197
- tslib_1.__param(0, (0, di_1.Inject)(OidcProviderNodeModule_js_1.OIDC_PROVIDER_NODE_MODULE)),
198
- tslib_1.__metadata("design:paramtypes", [Object])
199
- ], OidcProvider);
200
- exports.OidcProvider = OidcProvider;
201
- //# sourceMappingURL=OidcProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OidcProvider.js","sourceRoot":"","sources":["../../../src/services/OidcProvider.ts"],"names":[],"mappings":";;;;AAAA,yCAAiF;AACjF,qCAAyC;AACzC,iCAAuE;AAGvE,4DAAuD;AAGvD,kDAAqD;AACrD,uDAA+C;AAC/C,+DAAuD;AACvD,+CAAuC;AACvC,mDAA2C;AAC3C,2EAAgF;AAEhF,SAAS,QAAQ,CAAC,KAAU;IAC1B,OAAO,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,GAAG,EAAE,EAAE;QAChE,OAAO;YACL,GAAG,GAAG;YACN,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC;SAClB,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;IA0CvB,YAAyD,MAAiC;QAAjC,WAAM,GAAN,MAAM,CAA2B;IAAG,CAAC;IAE9F,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IACnD,CAAC;IAED,gBAAgB;QACd,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,K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AY;IADxB,IAAA,eAAU,GAAE;IA2CE,mBAAA,IAAA,WAAM,EAAC,qDAAyB,CAAC,CAAA;;GA1CnC,YAAY,CAwMxB;AAxMY,oCAAY"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OIDC_PROVIDER_NODE_MODULE = void 0;
4
- const di_1 = require("@tsed/di");
5
- exports.OIDC_PROVIDER_NODE_MODULE = Symbol.for("oidc:provider:node:module");
6
- (0, di_1.registerProvider)({
7
- provide: exports.OIDC_PROVIDER_NODE_MODULE,
8
- async useAsyncFactory() {
9
- const mod = await import("oidc-provider");
10
- return {
11
- ...mod,
12
- Provider: mod.default || mod.Provider
13
- };
14
- }
15
- });
16
- //# sourceMappingURL=OidcProviderNodeModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OidcProviderNodeModule.js","sourceRoot":"","sources":["../../../src/services/OidcProviderNodeModule.ts"],"names":[],"mappings":";;;AACA,iCAA0C;AAI7B,QAAA,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAMjF,IAAA,qBAAgB,EAAC;IACf,OAAO,EAAE,iCAAyB;IAClC,KAAK,CAAC,eAAe;QACnB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;QAE1C,OAAO;YACL,GAAG,GAAG;YACN,QAAQ,EAAE,GAAG,CAAC,OAAO,IAAK,GAAW,CAAC,QAAQ;SAC/C,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debug = void 0;
4
- const tslib_1 = require("tslib");
5
- const core_1 = require("@tsed/core");
6
- const querystring_1 = tslib_1.__importDefault(require("querystring"));
7
- const util_1 = require("util");
8
- const keys = new Set();
9
- function serialize(obj) {
10
- return Object.entries(obj).reduce((acc, [key, value]) => {
11
- keys.add(key);
12
- if ((0, core_1.isEmpty)(value)) {
13
- return acc;
14
- }
15
- acc[key] = (0, util_1.inspect)(value, { depth: null });
16
- return acc;
17
- }, {});
18
- }
19
- const debug = (obj) => querystring_1.default.stringify(serialize(obj), "<br/>", ": ", {
20
- encodeURIComponent(value) {
21
- return keys.has(value) ? `<strong>${value}</strong>` : value;
22
- }
23
- });
24
- exports.debug = debug;
25
- //# sourceMappingURL=debug.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/utils/debug.ts"],"names":[],"mappings":";;;;AAAA,qCAAmC;AACnC,sEAA6B;AAC7B,+BAA6B;AAE7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;AAEvB,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC3D,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEd,IAAI,IAAA,cAAO,EAAC,KAAK,CAAC,EAAE;YAClB,OAAO,GAAG,CAAC;SACZ;QAED,GAAG,CAAC,GAAG,CAAC,GAAG,IAAA,cAAO,EAAC,KAAK,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;QACzC,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAEM,MAAM,KAAK,GAAG,CAAC,GAAQ,EAAE,EAAE,CAChC,qBAAE,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;IAC1C,kBAAkB,CAAC,KAAK;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;IAC/D,CAAC;CACF,CAAC,CAAC;AALQ,QAAA,KAAK,SAKb"}
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OIDC_ERROR_EVENTS = exports.OIDC_EVENTS = void 0;
4
- /**
5
- * Exports all OIDC providers events
6
- */
7
- exports.OIDC_EVENTS = [
8
- "access_token.destroyed",
9
- "access_token.saved",
10
- "access_token.issued",
11
- "authorization_code.consumed",
12
- "authorization_code.destroyed",
13
- "authorization_code.saved",
14
- "authorization.accepted",
15
- "authorization.error",
16
- "authorization.success",
17
- "backchannel.error",
18
- "backchannel.success",
19
- "jwks.error",
20
- "client_credentials.destroyed",
21
- "client_credentials.saved",
22
- "client_credentials.issued",
23
- "device_code.consumed",
24
- "device_code.destroyed",
25
- "device_code.saved",
26
- "discovery.error",
27
- "end_session.error",
28
- "end_session.success",
29
- "grant.error",
30
- "grant.revoked",
31
- "grant.success",
32
- "initial_access_token.destroyed",
33
- "initial_access_token.saved",
34
- "interaction.destroyed",
35
- "interaction.ended",
36
- "interaction.saved",
37
- "interaction.started",
38
- "introspection.error",
39
- "replay_detection.destroyed",
40
- "replay_detection.saved",
41
- "pushed_authorization_request.error",
42
- "pushed_authorization_request.success",
43
- "pushed_authorization_request.destroyed",
44
- "pushed_authorization_request.saved",
45
- "refresh_token.consumed",
46
- "refresh_token.destroyed",
47
- "refresh_token.saved",
48
- "registration_access_token.destroyed",
49
- "registration_access_token.saved",
50
- "registration_create.error",
51
- "registration_create.success",
52
- "registration_delete.error",
53
- "registration_delete.success",
54
- "registration_read.error",
55
- "registration_update.error",
56
- "registration_update.success",
57
- "revocation.error",
58
- "server_error",
59
- "session.destroyed",
60
- "session.saved",
61
- "userinfo.error"
62
- ];
63
- exports.OIDC_ERROR_EVENTS = exports.OIDC_EVENTS.filter((e) => e.includes("error"));
64
- //# sourceMappingURL=events.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,WAAW,GAAG;IACzB,wBAAwB;IACxB,oBAAoB;IACpB,qBAAqB;IACrB,6BAA6B;IAC7B,8BAA8B;IAC9B,0BAA0B;IAC1B,wBAAwB;IACxB,qBAAqB;IACrB,uBAAuB;IACvB,mBAAmB;IACnB,qBAAqB;IACrB,YAAY;IACZ,8BAA8B;IAC9B,0BAA0B;IAC1B,2BAA2B;IAC3B,sBAAsB;IACtB,uBAAuB;IACvB,mBAAmB;IACnB,iBAAiB;IACjB,mBAAmB;IACnB,qBAAqB;IACrB,aAAa;IACb,eAAe;IACf,eAAe;IACf,gCAAgC;IAChC,4BAA4B;IAC5B,uBAAuB;IACvB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,qBAAqB;IACrB,4BAA4B;IAC5B,wBAAwB;IACxB,oCAAoC;IACpC,sCAAsC;IACtC,wCAAwC;IACxC,oCAAoC;IACpC,wBAAwB;IACxB,yBAAyB;IACzB,qBAAqB;IACrB,qCAAqC;IACrC,iCAAiC;IACjC,2BAA2B;IAC3B,6BAA6B;IAC7B,2BAA2B;IAC3B,6BAA6B;IAC7B,yBAAyB;IACzB,2BAA2B;IAC3B,6BAA6B;IAC7B,kBAAkB;IAClB,cAAc;IACd,mBAAmB;IACnB,eAAe;IACf,gBAAgB;CACjB,CAAC;AAEW,QAAA,iBAAiB,GAAG,mBAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,14 +0,0 @@
1
- import { InjectorService, PlatformApplication } from "@tsed/common";
2
- import { OidcProvider } from "./services/OidcProvider.js";
3
- export declare class OidcModule {
4
- protected app: PlatformApplication;
5
- protected platformName: string;
6
- protected basePath: string;
7
- protected oidcProvider: OidcProvider;
8
- protected injector: InjectorService;
9
- $onInit(): Promise<void>;
10
- $onRoutesInit(): Promise<void>;
11
- $afterRoutesInit(): void;
12
- $onReady(): void;
13
- private getRewriteMiddleware;
14
- }
@@ -1,10 +0,0 @@
1
- export declare const INTERACTION_CONTEXT = "interactionContext";
2
- export declare const INTERACTION_PARAMS = "interactionParams";
3
- export declare const INTERACTION_GRANT_ID = "interactionGrantId";
4
- export declare const INTERACTION_PROMPT = "interactionPrompt";
5
- export declare const INTERACTION_UID = "interactionUid";
6
- export declare const INTERACTION_SESSION = "interactionSession";
7
- export declare const INTERACTION_DETAILS = "interactionDetails";
8
- export declare const INTERACTION_OPTIONS = "interactionOptions";
9
- export declare const INTERACTION = "interaction";
10
- export declare const INTERACTIONS = "interactions";
@@ -1,2 +0,0 @@
1
- export declare function GrantId(): ParameterDecorator;
2
- export type GrantId = string;
@@ -1,5 +0,0 @@
1
- import { OidcInteractionOptions } from "../domain/OidcInteractionOptions.js";
2
- /**
3
- * @Oidc
4
- */
5
- export declare function Interaction(options: OidcInteractionOptions): ClassDecorator;
@@ -1,6 +0,0 @@
1
- import { Type } from "@tsed/core";
2
- export interface InteractionsOptions {
3
- path: string;
4
- children: Type<any>[];
5
- }
6
- export declare function Interactions(options: InteractionsOptions): ClassDecorator;
@@ -1 +0,0 @@
1
- export declare function NoCache(): ClassDecorator;
@@ -1,3 +0,0 @@
1
- import { OidcInteractionContext } from "../services/OidcInteractionContext.js";
2
- export declare function OidcCtx(): ParameterDecorator;
3
- export type OidcCtx = OidcInteractionContext;
@@ -1,6 +0,0 @@
1
- import type { default as Provider } from "oidc-provider";
2
- /**
3
- * @decorator
4
- */
5
- export declare function OidcSession(expression?: string): ParameterDecorator;
6
- export type OidcSession = InstanceType<Provider["Session"]>;
@@ -1,2 +0,0 @@
1
- export declare function Params(expression?: string): ParameterDecorator;
2
- export type Params = Record<string, any>;
@@ -1,3 +0,0 @@
1
- import type { PromptDetail as P } from "oidc-provider";
2
- export declare function Prompt(): ParameterDecorator;
3
- export type Prompt = P;
@@ -1,2 +0,0 @@
1
- export declare function Uid(): ParameterDecorator;
2
- export type Uid = string;
@@ -1,10 +0,0 @@
1
- import type { CanBePromise, interactionPolicy, KoaContextWithOIDC, UnknownObject } from "oidc-provider";
2
- export interface InteractionMethods {
3
- details?: (ctx: KoaContextWithOIDC) => CanBePromise<UnknownObject>;
4
- checks?: () => interactionPolicy.Check[];
5
- $onCreate?: (prompt: interactionPolicy.Prompt) => void | Promise<void>;
6
- /**
7
- * @param args Injectable parameters
8
- */
9
- $prompt?: (...args: any[]) => any | Promise<any>;
10
- }
@@ -1,5 +0,0 @@
1
- import type { Account } from "oidc-provider";
2
- import { AccessToken, AuthorizationCode, BackchannelAuthenticationRequest, DeviceCode } from "./interfaces.js";
3
- export interface OidcAccountsMethods {
4
- findAccount(id: string, token: AuthorizationCode | AccessToken | DeviceCode | BackchannelAuthenticationRequest | undefined): Promise<Account | undefined>;
5
- }
@@ -1,3 +0,0 @@
1
- import { BadRequest } from "@tsed/exceptions";
2
- export declare class OidcBadInteractionName extends BadRequest {
3
- }
@@ -1,3 +0,0 @@
1
- export interface OidcInteractionMethods {
2
- $prompts?(...args: unknown[]): void | unknown | Promise<unknown>;
3
- }
@@ -1,8 +0,0 @@
1
- import type { CanBePromise, interactionPolicy, KoaContextWithOIDC, UnknownObject } from "oidc-provider";
2
- export interface OidcInteractionOptions {
3
- name: string;
4
- requestable?: boolean | undefined;
5
- priority?: number;
6
- details?: (ctx: KoaContextWithOIDC) => CanBePromise<UnknownObject>;
7
- checks?: interactionPolicy.Check[];
8
- }
@@ -1,9 +0,0 @@
1
- import type { UnknownObject } from "oidc-provider";
2
- import { OidcClient } from "./interfaces.js";
3
- export type OidcInteractionPromptProps<Props = Record<string, any>> = {
4
- client: OidcClient;
5
- uid: string;
6
- grantId: string;
7
- details: UnknownObject;
8
- params: Record<string, any>;
9
- } & Props;
@@ -1,67 +0,0 @@
1
- import type { Type } from "@tsed/core";
2
- import type { JwksKeyParameters } from "@tsed/jwks";
3
- import type { Configuration } from "oidc-provider";
4
- import type { Adapter } from "@tsed/adapters";
5
- import type { OidcAccountsMethods } from "./OidcAccountsMethods.js";
6
- export interface OidcSettings extends Configuration {
7
- /**
8
- * force the secure cookie. By default, in dev mode it's disabled and in production it's enabled.
9
- */
10
- secureCookies?: boolean;
11
- /**
12
- * Path on which the oidc-provider instance is mounted.
13
- */
14
- path?: string;
15
- /**
16
- * Issuer URI. By default, Ts.ED create issuer with http://localhost:${httpPort}
17
- */
18
- issuer?: string;
19
- /**
20
- * Path to store jwks keys.
21
- */
22
- jwksPath?: string;
23
- /**
24
- * Generate jwks from given certificates
25
- */
26
- certificates?: JwksKeyParameters[];
27
- /**
28
- * Secure keys.
29
- */
30
- secureKey?: string[];
31
- /**
32
- * Enable proxy.
33
- */
34
- proxy?: boolean;
35
- /**
36
- * Allow redirect_uri on HTTP protocol and localhost domain.
37
- */
38
- allowHttpLocalhost?: boolean;
39
- /**
40
- * Injectable service to manage accounts.
41
- */
42
- Accounts?: Type<OidcAccountsMethods>;
43
- /**
44
- * Injectable adapter to manage database connexion.
45
- */
46
- Adapter?: Type<Adapter>;
47
- /**
48
- * Use the connection name for the OIDCRedisAdapter.
49
- */
50
- connectionName?: string;
51
- plugins?: TsED.OIDCPluginSettings;
52
- render?: {
53
- /**
54
- * By default ["clientSecret"] is omitted
55
- */
56
- omitClientProps?: string[];
57
- };
58
- }
59
- declare global {
60
- namespace TsED {
61
- interface OIDCPluginSettings {
62
- }
63
- interface Configuration {
64
- oidc: OidcSettings;
65
- }
66
- }
67
- }