@tsed/oidc-provider 7.20.0 → 7.21.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.
- package/jest.config.js +4 -4
- package/lib/cjs/index.js +2 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/services/OidcInteractionContext.js.map +1 -1
- package/lib/cjs/services/OidcInteractions.js.map +1 -1
- package/lib/cjs/services/OidcPolicy.js +78 -0
- package/lib/cjs/services/OidcPolicy.js.map +1 -0
- package/lib/cjs/services/OidcProvider.js +16 -30
- package/lib/cjs/services/OidcProvider.js.map +1 -1
- package/lib/cjs/services/OidcProviderNodeModule.js +16 -0
- package/lib/cjs/services/OidcProviderNodeModule.js.map +1 -0
- package/lib/esm/index.js +2 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/services/OidcInteractionContext.js.map +1 -1
- package/lib/esm/services/OidcInteractions.js.map +1 -1
- package/lib/esm/services/OidcPolicy.js +75 -0
- package/lib/esm/services/OidcPolicy.js.map +1 -0
- package/lib/esm/services/OidcProvider.js +17 -31
- package/lib/esm/services/OidcProvider.js.map +1 -1
- package/lib/esm/services/OidcProviderNodeModule.js +13 -0
- package/lib/esm/services/OidcProviderNodeModule.js.map +1 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/domain/OidcAccountsMethods.d.ts +2 -7
- package/lib/types/domain/OidcSettings.d.ts +3 -0
- package/lib/types/domain/interfaces.d.ts +8 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/services/OidcInteractionContext.d.ts +1 -2
- package/lib/types/services/OidcInteractions.d.ts +3 -3
- package/lib/types/services/OidcPolicy.d.ts +16 -0
- package/lib/types/services/OidcProvider.d.ts +9 -8
- package/lib/types/services/OidcProviderNodeModule.d.ts +7 -0
- package/package.json +16 -16
- package/readme.md +8 -0
- package/lib/cjs/domain/OidcInteraction.js +0 -3
- package/lib/cjs/domain/OidcInteraction.js.map +0 -1
- package/lib/esm/domain/OidcInteraction.js +0 -2
- package/lib/esm/domain/OidcInteraction.js.map +0 -1
- package/lib/types/domain/OidcInteraction.d.ts +0 -2
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export type AccessToken = InstanceType<Provider["AccessToken"]>;
|
|
4
|
-
export type DeviceCode = InstanceType<Provider["DeviceCode"]>;
|
|
5
|
-
export type RefreshToken = InstanceType<Provider["RefreshToken"]>;
|
|
6
|
-
export type Client = InstanceType<Provider["Client"]>;
|
|
7
|
-
export type BackchannelAuthenticationRequest = InstanceType<Provider["BackchannelAuthenticationRequest"]>;
|
|
1
|
+
import type { Account } from "oidc-provider";
|
|
2
|
+
import { AccessToken, AuthorizationCode, BackchannelAuthenticationRequest, DeviceCode } from "./interfaces";
|
|
8
3
|
export interface OidcAccountsMethods {
|
|
9
4
|
findAccount(id: string, token: AuthorizationCode | AccessToken | DeviceCode | BackchannelAuthenticationRequest | undefined): Promise<Account | undefined>;
|
|
10
5
|
}
|
|
@@ -48,9 +48,12 @@ export interface OidcSettings extends Configuration {
|
|
|
48
48
|
* Use the connection name for the OIDCRedisAdapter.
|
|
49
49
|
*/
|
|
50
50
|
connectionName?: string;
|
|
51
|
+
plugins?: TsED.OIDCPluginSettings;
|
|
51
52
|
}
|
|
52
53
|
declare global {
|
|
53
54
|
namespace TsED {
|
|
55
|
+
interface OIDCPluginSettings {
|
|
56
|
+
}
|
|
54
57
|
interface Configuration {
|
|
55
58
|
oidc: OidcSettings;
|
|
56
59
|
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import type { interactionPolicy, default as Provider } from "oidc-provider";
|
|
2
|
+
export type OIDCContext = InstanceType<Provider["OIDCContext"]>;
|
|
2
3
|
export type OidcClient = InstanceType<Provider["Client"]>;
|
|
3
4
|
export type DefaultPolicy = interactionPolicy.DefaultPolicy;
|
|
5
|
+
export type AuthorizationCode = InstanceType<Provider["AuthorizationCode"]>;
|
|
6
|
+
export type AccessToken = InstanceType<Provider["AccessToken"]>;
|
|
7
|
+
export type DeviceCode = InstanceType<Provider["DeviceCode"]>;
|
|
8
|
+
export type RefreshToken = InstanceType<Provider["RefreshToken"]>;
|
|
9
|
+
export type BackchannelAuthenticationRequest = InstanceType<Provider["BackchannelAuthenticationRequest"]>;
|
|
10
|
+
export type Grant = InstanceType<Provider["Grant"]>;
|
|
11
|
+
export type OidcInteraction = InstanceType<Provider["Interaction"]>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export * from "./decorators/uid";
|
|
|
15
15
|
export * from "./domain/InteractionMethods";
|
|
16
16
|
export * from "./domain/OidcAccountsMethods";
|
|
17
17
|
export * from "./domain/OidcBadInteractionName";
|
|
18
|
-
export * from "./domain/OidcInteraction";
|
|
19
18
|
export * from "./domain/OidcInteractionMethods";
|
|
20
19
|
export * from "./domain/OidcInteractionOptions";
|
|
21
20
|
export * from "./domain/OidcInteractionPromptProps";
|
|
@@ -28,6 +27,8 @@ export * from "./services/OidcAdapters";
|
|
|
28
27
|
export * from "./services/OidcInteractionContext";
|
|
29
28
|
export * from "./services/OidcInteractions";
|
|
30
29
|
export * from "./services/OidcJwks";
|
|
30
|
+
export * from "./services/OidcPolicy";
|
|
31
31
|
export * from "./services/OidcProvider";
|
|
32
|
+
export * from "./services/OidcProviderNodeModule";
|
|
32
33
|
export * from "./utils/debug";
|
|
33
34
|
export * from "./utils/events";
|
|
@@ -2,8 +2,7 @@ import { PlatformContext } from "@tsed/common";
|
|
|
2
2
|
import { Env } from "@tsed/core";
|
|
3
3
|
import type { Account, InteractionResults, PromptDetail, default as Provider } from "oidc-provider";
|
|
4
4
|
import { OidcSession } from "../decorators/oidcSession";
|
|
5
|
-
import { OidcClient } from "../domain/interfaces";
|
|
6
|
-
import { OidcInteraction } from "../domain/OidcInteraction";
|
|
5
|
+
import { OidcClient, OidcInteraction } from "../domain/interfaces";
|
|
7
6
|
import { OidcInteractionPromptProps } from "../domain/OidcInteractionPromptProps";
|
|
8
7
|
import { OidcInteractions } from "./OidcInteractions";
|
|
9
8
|
import { OidcProvider } from "./OidcProvider";
|
|
@@ -3,9 +3,9 @@ import { Env } from "@tsed/core";
|
|
|
3
3
|
import { InjectorService } from "@tsed/di";
|
|
4
4
|
import { OidcSettings } from "../domain/OidcSettings";
|
|
5
5
|
export declare class OidcInteractions {
|
|
6
|
-
injector: InjectorService;
|
|
7
|
-
env: Env;
|
|
8
|
-
oidcSettings: OidcSettings;
|
|
6
|
+
protected injector: InjectorService;
|
|
7
|
+
protected env: Env;
|
|
8
|
+
protected oidcSettings: OidcSettings;
|
|
9
9
|
protected interactions: Map<string, Provider>;
|
|
10
10
|
$onInit(): void;
|
|
11
11
|
getInteractions(): Provider[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InjectorService } from "@tsed/di";
|
|
2
|
+
import { interactionPolicy } from "oidc-provider";
|
|
3
|
+
import { InteractionMethods } from "../domain/InteractionMethods";
|
|
4
|
+
import { OidcInteractionOptions } from "../domain/OidcInteractionOptions";
|
|
5
|
+
import { OidcInteractions } from "./OidcInteractions";
|
|
6
|
+
import { OIDC_PROVIDER_NODE_MODULE } from "./OidcProviderNodeModule";
|
|
7
|
+
import Prompt = interactionPolicy.Prompt;
|
|
8
|
+
export declare class OidcPolicy {
|
|
9
|
+
protected module: OIDC_PROVIDER_NODE_MODULE;
|
|
10
|
+
protected injector: InjectorService;
|
|
11
|
+
protected oidcInteractions: OidcInteractions;
|
|
12
|
+
constructor(module: OIDC_PROVIDER_NODE_MODULE);
|
|
13
|
+
getPolicy(): any;
|
|
14
|
+
createPrompt(instance: InteractionMethods, options: OidcInteractionOptions): Prompt;
|
|
15
|
+
private getInteractions;
|
|
16
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { PlatformApplication, PlatformContext } from "@tsed/common";
|
|
2
2
|
import { Env } from "@tsed/core";
|
|
3
3
|
import { InjectorService } from "@tsed/di";
|
|
4
|
-
import type { Configuration
|
|
5
|
-
import { InteractionMethods } from "../domain/InteractionMethods";
|
|
6
|
-
import { OidcInteractionOptions } from "../domain/OidcInteractionOptions";
|
|
4
|
+
import type { Configuration } from "oidc-provider";
|
|
7
5
|
import { OidcSettings } from "../domain/OidcSettings";
|
|
8
6
|
import { OidcAdapters } from "./OidcAdapters";
|
|
9
7
|
import { OidcInteractions } from "./OidcInteractions";
|
|
10
8
|
import { OidcJwks } from "./OidcJwks";
|
|
9
|
+
import { OidcPolicy } from "./OidcPolicy";
|
|
10
|
+
import { OIDC_PROVIDER_NODE_MODULE, Provider } from "./OidcProviderNodeModule";
|
|
11
11
|
export declare class OidcProvider {
|
|
12
|
-
|
|
12
|
+
protected module: OIDC_PROVIDER_NODE_MODULE;
|
|
13
|
+
raw: Provider;
|
|
13
14
|
protected env: Env;
|
|
14
15
|
protected httpPort: number | string;
|
|
15
16
|
protected httpsPort: number | string;
|
|
@@ -18,22 +19,22 @@ export declare class OidcProvider {
|
|
|
18
19
|
protected platformName: string;
|
|
19
20
|
protected oidcJwks: OidcJwks;
|
|
20
21
|
protected oidcInteractions: OidcInteractions;
|
|
22
|
+
protected oidcPolicy: OidcPolicy;
|
|
21
23
|
protected adapters: OidcAdapters;
|
|
22
24
|
protected injector: InjectorService;
|
|
23
25
|
protected app: PlatformApplication;
|
|
24
26
|
protected $ctx?: PlatformContext;
|
|
27
|
+
constructor(module: OIDC_PROVIDER_NODE_MODULE);
|
|
25
28
|
get logger(): import("@tsed/common").DILogger;
|
|
26
29
|
hasConfiguration(): boolean;
|
|
27
30
|
getConfiguration(): Promise<Configuration>;
|
|
28
31
|
getIssuer(): string;
|
|
29
|
-
get():
|
|
32
|
+
get(): Provider;
|
|
30
33
|
/**
|
|
31
34
|
* Create a new instance of OidcProvider
|
|
32
35
|
*/
|
|
33
|
-
create(): Promise<void |
|
|
34
|
-
createPrompt(instance: InteractionMethods, options: OidcInteractionOptions): Promise<interactionPolicy.Prompt>;
|
|
36
|
+
create(): Promise<void | Provider>;
|
|
35
37
|
private createErrorHandler;
|
|
36
38
|
private getInteractionsUrl;
|
|
37
39
|
private allowHttpLocalhost;
|
|
38
|
-
private getPolicy;
|
|
39
40
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import type Provider from "oidc-provider";
|
|
3
|
+
export declare const OIDC_PROVIDER_NODE_MODULE: unique symbol;
|
|
4
|
+
export type OIDC_PROVIDER_NODE_MODULE = {
|
|
5
|
+
Provider: Type<Provider>;
|
|
6
|
+
} & typeof import("oidc-provider");
|
|
7
|
+
export { Provider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/oidc-provider",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.21.0",
|
|
4
4
|
"description": "OIDC provider package for Ts.ED framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"lint:fix": "eslint '**/*.{ts,js}' --fix"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tsed/adapters": "7.
|
|
26
|
+
"@tsed/adapters": "7.21.0",
|
|
27
27
|
"express-urlrewrite": "^1.4.0",
|
|
28
28
|
"jose2": "npm:jose@^2.0.4",
|
|
29
29
|
"koa-mount": "^4.0.0",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"uuid": "8.3.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@tsed/common": "7.
|
|
36
|
-
"@tsed/core": "7.
|
|
37
|
-
"@tsed/di": "7.
|
|
38
|
-
"@tsed/eslint": "7.
|
|
39
|
-
"@tsed/exceptions": "7.
|
|
40
|
-
"@tsed/jwks": "7.
|
|
41
|
-
"@tsed/typescript": "7.
|
|
35
|
+
"@tsed/common": "7.21.0",
|
|
36
|
+
"@tsed/core": "7.21.0",
|
|
37
|
+
"@tsed/di": "7.21.0",
|
|
38
|
+
"@tsed/eslint": "7.21.0",
|
|
39
|
+
"@tsed/exceptions": "7.21.0",
|
|
40
|
+
"@tsed/jwks": "7.21.0",
|
|
41
|
+
"@tsed/typescript": "7.21.0",
|
|
42
42
|
"@types/lowdb": "1.0.11",
|
|
43
43
|
"@types/oidc-provider": "8.1.1",
|
|
44
44
|
"@types/uuid": "8.3.4",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"oidc-provider": "8.1.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@tsed/ajv": "^7.
|
|
51
|
-
"@tsed/common": "^7.
|
|
52
|
-
"@tsed/core": "^7.
|
|
53
|
-
"@tsed/di": "^7.
|
|
54
|
-
"@tsed/json-mapper": "^7.
|
|
55
|
-
"@tsed/schema": "^7.
|
|
56
|
-
"oidc-provider": ">=
|
|
50
|
+
"@tsed/ajv": "^7.21.0",
|
|
51
|
+
"@tsed/common": "^7.21.0",
|
|
52
|
+
"@tsed/core": "^7.21.0",
|
|
53
|
+
"@tsed/di": "^7.21.0",
|
|
54
|
+
"@tsed/json-mapper": "^7.21.0",
|
|
55
|
+
"@tsed/schema": "^7.21.0",
|
|
56
|
+
"oidc-provider": ">=8.0.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@tsed/common": {
|
package/readme.md
CHANGED
|
@@ -30,6 +30,14 @@
|
|
|
30
30
|
|
|
31
31
|
A package of Ts.ED framework. See website: https://tsed.io/tutorials/oidc-provider
|
|
32
32
|
|
|
33
|
+
## OIDC compatibility
|
|
34
|
+
|
|
35
|
+
- For OIDC v7, use @tsed/oidc-provider v7.19 and under
|
|
36
|
+
- For OIDC v8, use @tsed/oidc-provider v7.20 and higher
|
|
37
|
+
|
|
38
|
+
Since the v8, have changed the exported Provider (named by default) and the entire is under ESM convention, Ts.ED isn't
|
|
39
|
+
able to maintain the v7 and v8 at the same time.
|
|
40
|
+
|
|
33
41
|
## Feature
|
|
34
42
|
|
|
35
43
|
Currently, `@tsed/oidc-provider` allows you:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OidcInteraction.js","sourceRoot":"","sources":["../../../src/domain/OidcInteraction.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OidcInteraction.js","sourceRoot":"","sources":["../../../src/domain/OidcInteraction.ts"],"names":[],"mappings":""}
|