@tsed/oidc-provider 8.37.1 → 8.38.0-beta.2
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.
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { INTERACTION,
|
|
3
|
-
import {
|
|
2
|
+
import { INTERACTION, INTERACTION_OPTIONS, INTERACTIONS } from "../constants/constants.js";
|
|
3
|
+
import { constant, inject, Injectable, injector } from "@tsed/di";
|
|
4
4
|
import { PlatformHandler } from "@tsed/platform-http";
|
|
5
5
|
import { s } from "@tsed/schema";
|
|
6
6
|
let OidcInteractions = class OidcInteractions {
|
|
7
7
|
constructor() {
|
|
8
|
-
this.injector = injector();
|
|
9
8
|
this.env = constant("env");
|
|
10
9
|
this.interactions = new Map();
|
|
11
10
|
}
|
|
12
11
|
$onInit() {
|
|
13
|
-
const platformHandler =
|
|
12
|
+
const platformHandler = inject(PlatformHandler);
|
|
14
13
|
this.getInteractions().forEach((provider) => {
|
|
15
14
|
const { name } = provider.store.get(INTERACTION_OPTIONS);
|
|
16
15
|
this.interactions.set(name, provider);
|
|
17
|
-
if (
|
|
16
|
+
if (inject(provider.token)?.$prompt) {
|
|
18
17
|
provider.store.set("$prompt", platformHandler.createCustomHandler(provider, "$prompt"));
|
|
19
18
|
}
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
21
|
getInteractions() {
|
|
23
|
-
const interactionsProvider =
|
|
22
|
+
const interactionsProvider = injector()
|
|
23
|
+
.providers.getMany()
|
|
24
|
+
.find((provider) => provider.subType === INTERACTIONS);
|
|
24
25
|
/* istanbul ignore next */
|
|
25
26
|
if (!interactionsProvider) {
|
|
26
27
|
return [];
|
|
27
28
|
}
|
|
28
29
|
return interactionsProvider.children
|
|
29
|
-
.map((token) =>
|
|
30
|
+
.map((token) => injector().providers.get(token))
|
|
30
31
|
.filter((provider) => provider?.subType === INTERACTION);
|
|
31
32
|
}
|
|
32
33
|
getInteractionProvider(name) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { Env, setValue } from "@tsed/core";
|
|
3
|
-
import {
|
|
3
|
+
import { constant, context, inject, Injectable, InjectorService } from "@tsed/di";
|
|
4
4
|
import { PlatformApplication } from "@tsed/platform-http";
|
|
5
5
|
import Provider from "oidc-provider";
|
|
6
6
|
import { $asyncAlter } from "@tsed/hooks";
|
|
@@ -131,7 +131,7 @@ let OidcProvider = class OidcProvider {
|
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
getInteractionsUrl() {
|
|
134
|
-
const provider = this.injector.
|
|
134
|
+
const provider = this.injector.providers.getMany().find((provider) => provider.subType === INTERACTIONS);
|
|
135
135
|
if (provider) {
|
|
136
136
|
return (ctx, interaction) => {
|
|
137
137
|
return provider.path.replace(/:uid/, interaction.uid);
|
|
@@ -2,7 +2,6 @@ import { Provider } from "@tsed/di";
|
|
|
2
2
|
import { PlatformContext } from "@tsed/platform-http";
|
|
3
3
|
import { Env } from "@tsed/core";
|
|
4
4
|
export declare class OidcInteractions {
|
|
5
|
-
protected injector: import("@tsed/di").InjectorService;
|
|
6
5
|
protected env: Env | undefined;
|
|
7
6
|
protected interactions: Map<string, Provider>;
|
|
8
7
|
$onInit(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/oidc-provider",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.38.0-beta.2",
|
|
4
4
|
"description": "OIDC provider package for Ts.ED framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@tsed/adapters": "8.
|
|
27
|
+
"@tsed/adapters": "8.38.0-beta.2",
|
|
28
28
|
"express-urlrewrite": "^2.0.3",
|
|
29
29
|
"jose2": "npm:jose@^2.0.4",
|
|
30
30
|
"koa-mount": "^4.0.0",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"uuid": "^14.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tsed/barrels": "8.
|
|
38
|
-
"@tsed/core": "8.
|
|
39
|
-
"@tsed/di": "8.
|
|
40
|
-
"@tsed/exceptions": "8.
|
|
41
|
-
"@tsed/jwks": "8.
|
|
42
|
-
"@tsed/platform-http": "8.
|
|
43
|
-
"@tsed/typescript": "8.
|
|
37
|
+
"@tsed/barrels": "8.38.0-beta.2",
|
|
38
|
+
"@tsed/core": "8.38.0-beta.2",
|
|
39
|
+
"@tsed/di": "8.38.0-beta.2",
|
|
40
|
+
"@tsed/exceptions": "8.38.0-beta.2",
|
|
41
|
+
"@tsed/jwks": "8.38.0-beta.2",
|
|
42
|
+
"@tsed/platform-http": "8.38.0-beta.2",
|
|
43
|
+
"@tsed/typescript": "8.38.0-beta.2",
|
|
44
44
|
"@types/lowdb": "1.0.15",
|
|
45
45
|
"@types/oidc-provider": "8.5.2",
|
|
46
46
|
"@types/uuid": "10.0.0",
|
|
@@ -85,5 +85,8 @@
|
|
|
85
85
|
},
|
|
86
86
|
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/security/oidc-provider",
|
|
87
87
|
"author": "Romain Lenzotti",
|
|
88
|
-
"license": "MIT"
|
|
88
|
+
"license": "MIT",
|
|
89
|
+
"publishConfig": {
|
|
90
|
+
"tag": "beta"
|
|
91
|
+
}
|
|
89
92
|
}
|