@tsed/oidc-provider 6.102.7 → 6.102.8
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/lib/cjs/constants/{index.js → constants.js} +1 -1
- package/lib/cjs/constants/constants.js.map +1 -0
- package/lib/cjs/decorators/grantId.js +1 -1
- package/lib/cjs/decorators/grantId.js.map +1 -1
- package/lib/cjs/decorators/interaction.js +1 -1
- package/lib/cjs/decorators/interaction.js.map +1 -1
- package/lib/cjs/decorators/interactions.js +1 -1
- package/lib/cjs/decorators/interactions.js.map +1 -1
- package/lib/cjs/decorators/oidcCtx.js +1 -1
- package/lib/cjs/decorators/oidcCtx.js.map +1 -1
- package/lib/cjs/decorators/oidcSession.js +1 -1
- package/lib/cjs/decorators/oidcSession.js.map +1 -1
- package/lib/cjs/decorators/params.js +1 -1
- package/lib/cjs/decorators/params.js.map +1 -1
- package/lib/cjs/decorators/prompt.js +1 -1
- package/lib/cjs/decorators/prompt.js.map +1 -1
- package/lib/cjs/decorators/uid.js +1 -1
- package/lib/cjs/decorators/uid.js.map +1 -1
- package/lib/cjs/domain/interfaces.js +3 -0
- package/lib/cjs/domain/interfaces.js.map +1 -0
- package/lib/cjs/index.js +22 -4
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/middlewares/OidcInteractionMiddleware.js +1 -1
- package/lib/cjs/middlewares/OidcInteractionMiddleware.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/services/OidcInteractionContext.js.map +1 -1
- package/lib/cjs/services/OidcInteractions.js +1 -1
- package/lib/cjs/services/OidcInteractions.js.map +1 -1
- package/lib/cjs/services/OidcProvider.js +1 -1
- package/lib/cjs/services/OidcProvider.js.map +1 -1
- package/lib/esm/OidcModule.js +3 -3
- package/lib/esm/constants/{index.js → constants.js} +1 -1
- package/lib/esm/constants/constants.js.map +1 -0
- package/lib/esm/decorators/grantId.js +1 -1
- package/lib/esm/decorators/grantId.js.map +1 -1
- package/lib/esm/decorators/interaction.js +1 -1
- package/lib/esm/decorators/interaction.js.map +1 -1
- package/lib/esm/decorators/interactions.js +3 -3
- package/lib/esm/decorators/interactions.js.map +1 -1
- package/lib/esm/decorators/noCache.js +1 -1
- package/lib/esm/decorators/oidcCtx.js +1 -1
- package/lib/esm/decorators/oidcCtx.js.map +1 -1
- package/lib/esm/decorators/oidcSession.js +1 -1
- package/lib/esm/decorators/oidcSession.js.map +1 -1
- package/lib/esm/decorators/params.js +1 -1
- package/lib/esm/decorators/params.js.map +1 -1
- package/lib/esm/decorators/prompt.js +1 -1
- package/lib/esm/decorators/prompt.js.map +1 -1
- package/lib/esm/decorators/uid.js +1 -1
- package/lib/esm/decorators/uid.js.map +1 -1
- package/lib/esm/domain/interfaces.js +2 -0
- package/lib/esm/domain/interfaces.js.map +1 -0
- package/lib/esm/index.js +29 -11
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/middlewares/OidcInteractionMiddleware.js +3 -3
- package/lib/esm/middlewares/OidcInteractionMiddleware.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/OidcInteractionContext.js +3 -3
- package/lib/esm/services/OidcInteractionContext.js.map +1 -1
- package/lib/esm/services/OidcInteractions.js +1 -1
- package/lib/esm/services/OidcInteractions.js.map +1 -1
- package/lib/esm/services/OidcProvider.js +4 -4
- package/lib/esm/services/OidcProvider.js.map +1 -1
- package/lib/types/constants/{index.d.ts → constants.d.ts} +0 -0
- package/lib/types/decorators/interaction.d.ts +1 -1
- package/lib/types/domain/interfaces.d.ts +3 -0
- package/lib/types/index.d.ts +22 -4
- package/lib/types/services/OidcInteractionContext.d.ts +3 -2
- package/lib/types/services/OidcInteractions.d.ts +1 -1
- package/lib/types/services/OidcProvider.d.ts +1 -1
- package/package.json +17 -15
- package/readme.md +1 -3
- package/lib/cjs/constants/index.js.map +0 -1
- package/lib/cjs/decorators/index.js +0 -13
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/domain/index.js +0 -9
- package/lib/cjs/domain/index.js.map +0 -1
- package/lib/esm/constants/index.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -10
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/domain/index.js +0 -6
- package/lib/esm/domain/index.js.map +0 -1
- package/lib/types/decorators/index.d.ts +0 -9
- package/lib/types/domain/index.d.ts +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,oBAAoB,CAAC;AAC3C,QAAA,kBAAkB,GAAG,mBAAmB,CAAC;AACzC,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAC5C,QAAA,kBAAkB,GAAG,mBAAmB,CAAC;AACzC,QAAA,eAAe,GAAG,gBAAgB,CAAC;AACnC,QAAA,mBAAmB,GAAG,oBAAoB,CAAC;AAC3C,QAAA,mBAAmB,GAAG,oBAAoB,CAAC;AAC3C,QAAA,mBAAmB,GAAG,oBAAoB,CAAC;AAC3C,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QAAA,YAAY,GAAG,cAAc,CAAC","sourcesContent":["export const INTERACTION_CONTEXT = \"interactionContext\";\nexport const INTERACTION_PARAMS = \"interactionParams\";\nexport const INTERACTION_GRANT_ID = \"interactionGrantId\";\nexport const INTERACTION_PROMPT = \"interactionPrompt\";\nexport const INTERACTION_UID = \"interactionUid\";\nexport const INTERACTION_SESSION = \"interactionSession\";\nexport const INTERACTION_DETAILS = \"interactionDetails\";\nexport const INTERACTION_OPTIONS = \"interactionOptions\";\nexport const INTERACTION = \"interaction\";\nexport const INTERACTIONS = \"interactions\";\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GrantId = void 0;
|
|
4
4
|
const common_1 = require("@tsed/common");
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
6
|
+
const constants_1 = require("../constants/constants");
|
|
7
7
|
function GrantId() {
|
|
8
8
|
return (0, core_1.useDecorators)((0, common_1.Context)(constants_1.INTERACTION_GRANT_ID));
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantId.js","sourceRoot":"","sources":["../../../src/decorators/grantId.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"grantId.js","sourceRoot":"","sources":["../../../src/decorators/grantId.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AACzC,sDAAgF;AAEhF,SAAgB,OAAO;IACrB,OAAO,IAAA,oBAAa,EAAC,IAAA,gBAAO,EAAC,gCAAoB,CAAC,CAAC,CAAC;AACtD,CAAC;AAFD,0BAEC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {INTERACTION_GRANT_ID, INTERACTION_PARAMS} from \"../constants/constants\";\n\nexport function GrantId(): ParameterDecorator {\n return useDecorators(Context(INTERACTION_GRANT_ID));\n}\n\nexport type GrantId = string;\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Interaction = void 0;
|
|
4
4
|
const common_1 = require("@tsed/common");
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
6
|
+
const constants_1 = require("../constants/constants");
|
|
7
7
|
/**
|
|
8
8
|
* @Oidc
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../../src/decorators/interaction.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AACxC,qCAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../../src/decorators/interaction.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AACxC,qCAAqD;AACrD,sDAAwE;AAGxE;;GAEG;AACH,SAAgB,WAAW,CAAC,OAA+B;IACzD,OAAO,IAAA,oBAAa,EAClB,IAAA,mBAAU,EAAC;QACT,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,uBAAW;KACrB,CAAC,EACF,IAAA,iBAAU,EAAC,+BAAmB,EAAE,OAAO,CAAC,CACzC,CAAC;AACJ,CAAC;AARD,kCAQC","sourcesContent":["import {Controller} from \"@tsed/common\";\nimport {StoreMerge, useDecorators} from \"@tsed/core\";\nimport {INTERACTION, INTERACTION_OPTIONS} from \"../constants/constants\";\nimport {OidcInteractionOptions} from \"../domain/OidcInteractionOptions\";\n\n/**\n * @Oidc\n */\nexport function Interaction(options: OidcInteractionOptions): ClassDecorator {\n return useDecorators(\n Controller({\n path: \"/\",\n subType: INTERACTION\n }),\n StoreMerge(INTERACTION_OPTIONS, options)\n );\n}\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Interactions = void 0;
|
|
4
4
|
const common_1 = require("@tsed/common");
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
6
|
+
const constants_1 = require("../constants/constants");
|
|
7
7
|
const OidcInteractionMiddleware_1 = require("../middlewares/OidcInteractionMiddleware");
|
|
8
8
|
const noCache_1 = require("./noCache");
|
|
9
9
|
function Interactions(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../../src/decorators/interactions.ts"],"names":[],"mappings":";;;AAAA,yCAAmD;AACnD,qCAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../../src/decorators/interactions.ts"],"names":[],"mappings":";;;AAAA,yCAAmD;AACnD,qCAA+C;AAC/C,sDAAoD;AACpD,wFAAmF;AACnF,uCAAkC;AAOlC,SAAgB,YAAY,CAAC,OAA4B;IACvD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;IACvB,OAAO,IAAA,oBAAa,EAClB,IAAA,mBAAU,EAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,wBAAY,EAAC,CAAC,EACrE,IAAA,iBAAO,GAAE,EACT,IAAA,kBAAS,EAAC,qDAAyB,CAAC,CACrC,CAAC;AACJ,CAAC;AAPD,oCAOC","sourcesContent":["import {Controller, UseBefore} from \"@tsed/common\";\nimport {Type, useDecorators} from \"@tsed/core\";\nimport {INTERACTIONS} from \"../constants/constants\";\nimport {OidcInteractionMiddleware} from \"../middlewares/OidcInteractionMiddleware\";\nimport {NoCache} from \"./noCache\";\n\nexport interface InteractionsOptions {\n path: string;\n children: Type<any>[];\n}\n\nexport function Interactions(options: InteractionsOptions): ClassDecorator {\n const {path} = options;\n return useDecorators(\n Controller({path, children: options.children, subType: INTERACTIONS}),\n NoCache(),\n UseBefore(OidcInteractionMiddleware)\n );\n}\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OidcCtx = void 0;
|
|
4
4
|
const common_1 = require("@tsed/common");
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
6
|
+
const constants_1 = require("../constants/constants");
|
|
7
7
|
function OidcCtx() {
|
|
8
8
|
return (0, core_1.useDecorators)((0, common_1.Context)(constants_1.INTERACTION_CONTEXT));
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidcCtx.js","sourceRoot":"","sources":["../../../src/decorators/oidcCtx.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"oidcCtx.js","sourceRoot":"","sources":["../../../src/decorators/oidcCtx.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AACzC,sDAA2D;AAG3D,SAAgB,OAAO;IACrB,OAAO,IAAA,oBAAa,EAAC,IAAA,gBAAO,EAAC,+BAAmB,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,0BAEC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {INTERACTION_CONTEXT} from \"../constants/constants\";\nimport {OidcInteractionContext} from \"../services/OidcInteractionContext\";\n\nexport function OidcCtx(): ParameterDecorator {\n return useDecorators(Context(INTERACTION_CONTEXT));\n}\n\nexport type OidcCtx = OidcInteractionContext;\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OidcSession = void 0;
|
|
4
4
|
const common_1 = require("@tsed/common");
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
6
|
+
const constants_1 = require("../constants/constants");
|
|
7
7
|
/**
|
|
8
8
|
* @decorator
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidcSession.js","sourceRoot":"","sources":["../../../src/decorators/oidcSession.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AAEzC,
|
|
1
|
+
{"version":3,"file":"oidcSession.js","sourceRoot":"","sources":["../../../src/decorators/oidcSession.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AAEzC,sDAA2D;AAE3D;;GAEG;AACH,SAAgB,WAAW,CAAC,UAAmB;IAC7C,OAAO,IAAA,oBAAa,EAAC,IAAA,gBAAO,EAAC,CAAC,+BAAmB,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7F,CAAC;AAFD,kCAEC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {Provider} from \"oidc-provider\";\nimport {INTERACTION_SESSION} from \"../constants/constants\";\n\n/**\n * @decorator\n */\nexport function OidcSession(expression?: string): ParameterDecorator {\n return useDecorators(Context([INTERACTION_SESSION, expression].filter(Boolean).join(\".\")));\n}\n\nexport type OidcSession = InstanceType<Provider[\"Session\"]>;\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Params = void 0;
|
|
4
4
|
const common_1 = require("@tsed/common");
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
6
|
+
const constants_1 = require("../constants/constants");
|
|
7
7
|
function Params(expression) {
|
|
8
8
|
return (0, core_1.useDecorators)((0, common_1.Context)([constants_1.INTERACTION_PARAMS, expression].filter(Boolean).join(".")));
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../../src/decorators/params.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../../src/decorators/params.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AACzC,sDAA0D;AAE1D,SAAgB,MAAM,CAAC,UAAmB;IACxC,OAAO,IAAA,oBAAa,EAAC,IAAA,gBAAO,EAAC,CAAC,8BAAkB,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC;AAFD,wBAEC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {INTERACTION_PARAMS} from \"../constants/constants\";\n\nexport function Params(expression?: string): ParameterDecorator {\n return useDecorators(Context([INTERACTION_PARAMS, expression].filter(Boolean).join(\".\")));\n}\n\nexport type Params = Record<string, any>;\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Prompt = void 0;
|
|
4
4
|
const common_1 = require("@tsed/common");
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
6
|
+
const constants_1 = require("../constants/constants");
|
|
7
7
|
function Prompt() {
|
|
8
8
|
return (0, core_1.useDecorators)((0, common_1.Context)(constants_1.INTERACTION_PROMPT));
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/decorators/prompt.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AAEzC,
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/decorators/prompt.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AAEzC,sDAA0D;AAE1D,SAAgB,MAAM;IACpB,OAAO,IAAA,oBAAa,EAAC,IAAA,gBAAO,EAAC,8BAAkB,CAAC,CAAC,CAAC;AACpD,CAAC;AAFD,wBAEC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {PromptDetail as P} from \"oidc-provider\";\nimport {INTERACTION_PROMPT} from \"../constants/constants\";\n\nexport function Prompt(): ParameterDecorator {\n return useDecorators(Context(INTERACTION_PROMPT));\n}\n\nexport type Prompt = P;\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Uid = void 0;
|
|
4
4
|
const common_1 = require("@tsed/common");
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
6
|
+
const constants_1 = require("../constants/constants");
|
|
7
7
|
function Uid() {
|
|
8
8
|
return (0, core_1.useDecorators)((0, common_1.Context)(constants_1.INTERACTION_UID));
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uid.js","sourceRoot":"","sources":["../../../src/decorators/uid.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"uid.js","sourceRoot":"","sources":["../../../src/decorators/uid.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qCAAyC;AACzC,sDAAuD;AAEvD,SAAgB,GAAG;IACjB,OAAO,IAAA,oBAAa,EAAC,IAAA,gBAAO,EAAC,2BAAe,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,kBAEC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {INTERACTION_UID} from \"../constants/constants\";\n\nexport function Uid(): ParameterDecorator {\n return useDecorators(Context(INTERACTION_UID));\n}\n\nexport type Uid = string;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/domain/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {interactionPolicy, Provider} from \"oidc-provider\";\n\nexport type OidcClient = InstanceType<Provider[\"Client\"]>;\nexport type DefaultPolicy = interactionPolicy.DefaultPolicy;\n"]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Automatically generated by barrelsby.
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./OidcModule"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./constants/constants"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./decorators/grantId"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./decorators/interaction"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./decorators/interactions"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./decorators/noCache"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./decorators/oidcCtx"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./decorators/oidcSession"), exports);
|
|
15
|
+
(0, tslib_1.__exportStar)(require("./decorators/params"), exports);
|
|
16
|
+
(0, tslib_1.__exportStar)(require("./decorators/prompt"), exports);
|
|
17
|
+
(0, tslib_1.__exportStar)(require("./decorators/uid"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./domain/OidcAccountsMethods"), exports);
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./domain/OidcInteraction"), exports);
|
|
20
|
+
(0, tslib_1.__exportStar)(require("./domain/OidcInteractionMethods"), exports);
|
|
21
|
+
(0, tslib_1.__exportStar)(require("./domain/OidcInteractionOptions"), exports);
|
|
22
|
+
(0, tslib_1.__exportStar)(require("./domain/OidcSettings"), exports);
|
|
23
|
+
(0, tslib_1.__exportStar)(require("./domain/interfaces"), exports);
|
|
6
24
|
(0, tslib_1.__exportStar)(require("./middlewares/OidcInteractionMiddleware"), exports);
|
|
7
25
|
(0, tslib_1.__exportStar)(require("./middlewares/OidcNoCacheMiddleware"), exports);
|
|
8
26
|
(0, tslib_1.__exportStar)(require("./middlewares/OidcSecureMiddleware"), exports);
|
|
9
27
|
(0, tslib_1.__exportStar)(require("./services/OidcAdapters"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./services/OidcInteractions"), exports);
|
|
11
28
|
(0, tslib_1.__exportStar)(require("./services/OidcInteractionContext"), exports);
|
|
29
|
+
(0, tslib_1.__exportStar)(require("./services/OidcInteractions"), exports);
|
|
12
30
|
(0, tslib_1.__exportStar)(require("./services/OidcJwks"), exports);
|
|
13
31
|
(0, tslib_1.__exportStar)(require("./services/OidcProvider"), exports);
|
|
14
|
-
(0, tslib_1.__exportStar)(require("./
|
|
32
|
+
(0, tslib_1.__exportStar)(require("./utils/debug"), exports);
|
|
15
33
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4DAA6B;AAC7B,qEAAsC;AACtC,oEAAqC;AACrC,wEAAyC;AACzC,yEAA0C;AAC1C,oEAAqC;AACrC,oEAAqC;AACrC,wEAAyC;AACzC,mEAAoC;AACpC,mEAAoC;AACpC,gEAAiC;AACjC,4EAA6C;AAC7C,wEAAyC;AACzC,+EAAgD;AAChD,+EAAgD;AAChD,qEAAsC;AACtC,mEAAoC;AACpC,uFAAwD;AACxD,mFAAoD;AACpD,kFAAmD;AACnD,uEAAwC;AACxC,iFAAkD;AAClD,2EAA4C;AAC5C,mEAAoC;AACpC,uEAAwC;AACxC,6DAA8B","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./OidcModule\";\nexport * from \"./constants/constants\";\nexport * from \"./decorators/grantId\";\nexport * from \"./decorators/interaction\";\nexport * from \"./decorators/interactions\";\nexport * from \"./decorators/noCache\";\nexport * from \"./decorators/oidcCtx\";\nexport * from \"./decorators/oidcSession\";\nexport * from \"./decorators/params\";\nexport * from \"./decorators/prompt\";\nexport * from \"./decorators/uid\";\nexport * from \"./domain/OidcAccountsMethods\";\nexport * from \"./domain/OidcInteraction\";\nexport * from \"./domain/OidcInteractionMethods\";\nexport * from \"./domain/OidcInteractionOptions\";\nexport * from \"./domain/OidcSettings\";\nexport * from \"./domain/interfaces\";\nexport * from \"./middlewares/OidcInteractionMiddleware\";\nexport * from \"./middlewares/OidcNoCacheMiddleware\";\nexport * from \"./middlewares/OidcSecureMiddleware\";\nexport * from \"./services/OidcAdapters\";\nexport * from \"./services/OidcInteractionContext\";\nexport * from \"./services/OidcInteractions\";\nexport * from \"./services/OidcJwks\";\nexport * from \"./services/OidcProvider\";\nexport * from \"./utils/debug\";\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OidcInteractionMiddleware = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const common_1 = require("@tsed/common");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
6
|
+
const constants_1 = require("../constants/constants");
|
|
7
7
|
const OidcInteractionContext_1 = require("../services/OidcInteractionContext");
|
|
8
8
|
const OidcInteractions_1 = require("../services/OidcInteractions");
|
|
9
9
|
let OidcInteractionMiddleware = class OidcInteractionMiddleware {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcInteractionMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/OidcInteractionMiddleware.ts"],"names":[],"mappings":";;;;AAAA,yCAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"OidcInteractionMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/OidcInteractionMiddleware.ts"],"names":[],"mappings":";;;;AAAA,yCAA0E;AAC1E,sDAQgC;AAChC,+EAA0E;AAC1E,mEAA8D;AAG9D,IAAa,yBAAyB,GAAtC,MAAa,yBAAyB;IAOpC,KAAK,CAAC,GAAG,CAAY,OAAgB;QACnC,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAyB,+CAAsB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QAChH,MAAM,kBAAkB,GAAG,MAAM,eAAe,CAAC,kBAAkB,EAAE,CAAC;QACtE,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAC,GAAG,kBAAyB,CAAC;QAE1E,OAAO,CAAC,GAAG,CAAC,+BAAmB,EAAE,eAAe,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,+BAAmB,EAAE,kBAAkB,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,2BAAe,EAAE,GAAG,CAAC,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,8BAAkB,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,8BAAkB,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,gCAAoB,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,+BAAmB,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;CACF,CAAA;AAlBC;IADC,IAAA,eAAM,GAAE;2CACmB,mCAAgB;mEAAC;AAG7C;IADC,IAAA,eAAM,GAAE;2CACW,wBAAe;2DAAC;AAEpC;IAAW,wBAAA,IAAA,gBAAO,GAAE,CAAA;;;;oDAYnB;AAnBU,yBAAyB;IADrC,IAAA,mBAAU,GAAE;GACA,yBAAyB,CAoBrC;AApBY,8DAAyB","sourcesContent":["import {Context, Inject, InjectorService, Middleware} from \"@tsed/common\";\nimport {\n INTERACTION_CONTEXT,\n INTERACTION_DETAILS,\n INTERACTION_PARAMS,\n INTERACTION_GRANT_ID,\n INTERACTION_PROMPT,\n INTERACTION_SESSION,\n INTERACTION_UID\n} from \"../constants/constants\";\nimport {OidcInteractionContext} from \"../services/OidcInteractionContext\";\nimport {OidcInteractions} from \"../services/OidcInteractions\";\n\n@Middleware()\nexport class OidcInteractionMiddleware {\n @Inject()\n protected oidcInteractions: OidcInteractions;\n\n @Inject()\n protected injector: InjectorService;\n\n async use(@Context() context: Context) {\n const oidcInteraction = this.injector.invoke<OidcInteractionContext>(OidcInteractionContext, context.container);\n const interactionDetails = await oidcInteraction.interactionDetails();\n const {uid, prompt, params, session, grantId} = interactionDetails as any;\n\n context.set(INTERACTION_CONTEXT, oidcInteraction);\n context.set(INTERACTION_DETAILS, interactionDetails);\n context.set(INTERACTION_UID, uid);\n context.set(INTERACTION_PROMPT, prompt);\n context.set(INTERACTION_PARAMS, params);\n context.set(INTERACTION_GRANT_ID, grantId);\n context.set(INTERACTION_SESSION, session);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcInteractionContext.js","sourceRoot":"","sources":["../../../src/services/OidcInteractionContext.ts"],"names":[],"mappings":";;;;AAAA,yCAA6E;AAC7E,qCAA+B;AAC/B,iCAA4C;
|
|
1
|
+
{"version":3,"file":"OidcInteractionContext.js","sourceRoot":"","sources":["../../../src/services/OidcInteractionContext.ts"],"names":[],"mappings":";;;;AAAA,yCAA6E;AAC7E,qCAA+B;AAC/B,iCAA4C;AAK5C,0CAAqC;AACrC,yDAAoD;AACpD,iDAA4C;AAI5C,IAAa,sBAAsB,GAAnC,MAAa,sBAAsB;IAejC,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,GAAG,CAAC,OAAc,CAAC;IACjC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACtB,CAAC;IAED,IAAI,OAAO;QACT,OAAQ,IAAI,CAAC,GAAW,CAAC,OAAO,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAAe,IAAI,CAAC,MAAM,CAAC,IAAI;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAElE,IAAI,OAAO,EAAE;YACX,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC7B;IACH,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,IAAI,CAAC,GAAG,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAE1G,OAAO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ACJ,CAAC;CACF,CAAA;AAhHC;IADC,IAAA,iBAAQ,EAAC,KAAK,CAAC;;mDACP;AAGT;IADC,IAAA,WAAM,GAAE;2CACe,2BAAY;4DAAC;AAGrC;IADC,IAAA,WAAM,GAAE;2CACmB,mCAAgB;gEAAC;AAG7C;IADC,IAAA,WAAM,GAAE;2CACU,wBAAe;uDAAC;AAXxB,sBAAsB;IAFlC,IAAA,eAAU,GAAE;IACZ,IAAA,cAAK,EAAC,sBAAa,CAAC,OAAO,CAAC;GAChB,sBAAsB,CAkHlC;AAlHY,wDAAsB","sourcesContent":["import {Constant, PlatformContext, ProviderScope, Scope} from \"@tsed/common\";\nimport {Env} from \"@tsed/core\";\nimport {Inject, Injectable} from \"@tsed/di\";\nimport {Account, InteractionResults, PromptDetail, Provider} from \"oidc-provider\";\nimport {OidcSession} from \"../decorators/oidcSession\";\nimport {OidcClient} from \"../domain/interfaces\";\nimport {OidcInteraction} from \"../domain/OidcInteraction\";\nimport {debug} from \"../utils/debug\";\nimport {OidcInteractions} from \"./OidcInteractions\";\nimport {OidcProvider} from \"./OidcProvider\";\n\n@Injectable()\n@Scope(ProviderScope.REQUEST)\nexport class OidcInteractionContext {\n @Constant(\"env\")\n env: Env;\n\n @Inject()\n protected oidcProvider: OidcProvider;\n\n @Inject()\n protected oidcInteractions: OidcInteractions;\n\n @Inject()\n protected context: PlatformContext;\n\n protected raw: OidcInteraction;\n\n get session(): OidcSession | undefined {\n return this.raw.session as any;\n }\n\n get prompt(): PromptDetail {\n return this.raw.prompt;\n }\n\n get params(): Record<string, any> {\n return this.raw.params;\n }\n\n get uid(): string {\n return this.raw.uid;\n }\n\n get grantId(): string {\n return (this.raw as any).grantId;\n }\n\n async runInteraction(name: string = this.prompt.name) {\n const handler = this.oidcInteractions.getInteractionHandler(name);\n\n if (handler) {\n await handler(this.context);\n }\n }\n\n async interactionDetails(): Promise<OidcInteraction> {\n this.raw = await this.oidcProvider.get().interactionDetails(this.context.getReq(), this.context.getRes());\n\n return this.raw;\n }\n\n async interactionFinished(result: InteractionResults, options: {mergeWithLastSubmission?: boolean} = {mergeWithLastSubmission: false}) {\n return this.oidcProvider.get().interactionFinished(this.context.getReq(), this.context.getRes(), result, options);\n }\n\n async interactionResult(result: InteractionResults, options: {mergeWithLastSubmission?: boolean} = {mergeWithLastSubmission: false}) {\n return this.oidcProvider.get().interactionResult(this.context.getReq(), this.context.getRes(), result, options);\n }\n\n async render(view: string, result: any): Promise<string> {\n return this.context.response.render(view, result);\n }\n\n async save(ttl: number): Promise<string> {\n return this.raw.save(ttl);\n }\n\n async findClient(clientId: string = this.params.client_id): Promise<OidcClient | undefined> {\n return this.oidcProvider.get().Client.find(clientId);\n }\n\n async findAccount(sub?: string, token?: any): Promise<Account | undefined> {\n if (!sub && this.session) {\n sub = this.session?.accountId as any;\n }\n\n if (!sub) {\n return;\n }\n\n return this.oidcProvider.get().Account.findAccount(undefined as any, sub!, token);\n }\n\n async getGrant(): Promise<InstanceType<Provider[\"Grant\"]>> {\n const {Grant} = this.oidcProvider.get() as any;\n\n if (this.grantId) {\n // we'll be modifying existing grant in existing session\n // @ts-ignore\n return await (this.oidcProvider.get().find || Grant.find)(this.grantId);\n }\n\n return new Grant({\n accountId: this.session?.accountId,\n clientId: this.params.client_id\n });\n }\n\n debug(obj?: any): any {\n /* istanbul ignore next */\n if (this.env === Env.PROD) {\n return {session: undefined, dbg: {params: undefined, prompt: undefined}};\n }\n\n if (obj) {\n return debug(obj);\n }\n\n return {\n session: this.session ? this.debug(this.session) : undefined,\n dbg: {\n params: this.debug(this.params),\n prompt: this.debug(this.prompt)\n }\n };\n }\n}\n"]}
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const common_1 = require("@tsed/common");
|
|
6
6
|
const core_1 = require("@tsed/core");
|
|
7
7
|
const di_1 = require("@tsed/di");
|
|
8
|
-
const constants_1 = require("../constants");
|
|
8
|
+
const constants_1 = require("../constants/constants");
|
|
9
9
|
let OidcInteractions = class OidcInteractions {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.interactions = new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcInteractions.js","sourceRoot":"","sources":["../../../src/services/OidcInteractions.ts"],"names":[],"mappings":";;;;AAAA,yCAAmH;AACnH,qCAA+B;AAC/B,iCAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"OidcInteractions.js","sourceRoot":"","sources":["../../../src/services/OidcInteractions.ts"],"names":[],"mappings":";;;;AAAA,yCAAmH;AACnH,qCAA+B;AAC/B,iCAA6D;AAC7D,sDAAsF;AAKtF,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAA7B;QAUY,iBAAY,GAA0B,IAAI,GAAG,EAAE,CAAC;IA4C5D,CAAC;IA1CC,OAAO;QACL,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAkB,wBAAe,CAAE,CAAC;QAE7E,IAAI,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,CAAC,QAAkB,EAAE,EAAE;;YACpD,MAAM,EAAC,IAAI,EAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAyB,+BAAmB,CAAC,CAAC;YAC/E,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAEtC,IAAI,MAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,0CAAE,OAAO,EAAE;gBAC9C,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,mBAAmB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;aACzF;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,eAAe;QACb,MAAM,oBAAoB,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,KAAK,wBAAY,CAAC,CAAC;QAEhH,0BAA0B;QAC1B,IAAI,CAAC,oBAAoB,EAAE;YACzB,OAAO,EAAE,CAAC;SACX;QAED,OAAO,oBAAoB,CAAC,QAAQ;aACjC,GAAG,CAAC,CAAC,KAAoB,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAE,CAAC;aAChE,MAAM,CAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,MAAK,uBAAW,CAAC,CAAC;IACvE,CAAC;IAED,sBAAsB,CAAC,IAAY;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,qBAAqB,CAAC,IAAY;QAChC,MAAM,WAAW,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAEtD,IAAI,WAAW,EAAE;YACf,OAAO,CAAC,GAAoB,EAAE,EAAE;gBAC9B,uCAAuC;gBACvC,GAAG,CAAC,QAAQ,GAAG,yBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBAErE,OAAO,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC;YAC/C,CAAC,CAAC;SACH;IACH,CAAC;CACF,CAAA;AApDC;IADC,IAAA,WAAM,GAAE;2CACC,oBAAe;kDAAC;AAG1B;IADC,IAAA,iBAAQ,EAAC,KAAK,CAAC;;6CACP;AAGT;IADC,IAAA,iBAAQ,EAAC,MAAM,CAAC;;sDACU;AARhB,gBAAgB;IAD5B,IAAA,eAAU,GAAE;GACA,gBAAgB,CAsD5B;AAtDY,4CAAgB","sourcesContent":["import {Constant, EndpointMetadata, PlatformContext, PlatformHandler, Provider, TokenProvider} from \"@tsed/common\";\nimport {Env} from \"@tsed/core\";\nimport {Inject, Injectable, InjectorService} from \"@tsed/di\";\nimport {INTERACTION, INTERACTION_OPTIONS, INTERACTIONS} from \"../constants/constants\";\nimport {OidcInteractionOptions} from \"../domain/OidcInteractionOptions\";\nimport {OidcSettings} from \"../domain/OidcSettings\";\n\n@Injectable()\nexport class OidcInteractions {\n @Inject()\n injector: InjectorService;\n\n @Constant(\"env\")\n env: Env;\n\n @Constant(\"oidc\")\n oidcSettings: OidcSettings;\n\n protected interactions: Map<string, Provider> = new Map();\n\n $onInit(): void {\n const platformHandler = this.injector.get<PlatformHandler>(PlatformHandler)!;\n\n this.getInteractions().forEach((provider: Provider) => {\n const {name} = provider.store.get<OidcInteractionOptions>(INTERACTION_OPTIONS);\n this.interactions.set(name, provider);\n\n if (this.injector.get(provider.token)?.$prompt) {\n provider.store.set(\"$prompt\", platformHandler.createCustomHandler(provider, \"$prompt\"));\n }\n });\n }\n\n getInteractions(): Provider[] {\n const interactionsProvider = this.injector.getProviders().find((provider) => provider.subType === INTERACTIONS);\n\n /* istanbul ignore next */\n if (!interactionsProvider) {\n return [];\n }\n\n return interactionsProvider.children\n .map((token: TokenProvider) => this.injector.getProvider(token)!)\n .filter((provider: Provider) => provider?.subType === INTERACTION);\n }\n\n getInteractionProvider(name: string): Provider | undefined {\n return this.interactions.get(name);\n }\n\n getInteractionHandler(name: string) {\n const interaction = this.getInteractionProvider(name);\n\n if (interaction) {\n return (ctx: PlatformContext) => {\n // Add current endpoint metadata to ctx\n ctx.endpoint = EndpointMetadata.get(interaction.useClass, \"$prompt\");\n\n return interaction.store.get(\"$prompt\")(ctx);\n };\n }\n }\n}\n"]}
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
6
|
const di_1 = require("@tsed/di");
|
|
7
7
|
const oidc_provider_1 = require("oidc-provider");
|
|
8
|
-
const constants_1 = require("../constants");
|
|
8
|
+
const constants_1 = require("../constants/constants");
|
|
9
9
|
const OidcAdapters_1 = require("./OidcAdapters");
|
|
10
10
|
const OidcInteractions_1 = require("./OidcInteractions");
|
|
11
11
|
const OidcJwks_1 = require("./OidcJwks");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcProvider.js","sourceRoot":"","sources":["../../../src/services/OidcProvider.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AACzC,iCAAuE;AACvE,iDAAyF;AACzF,
|
|
1
|
+
{"version":3,"file":"OidcProvider.js","sourceRoot":"","sources":["../../../src/services/OidcProvider.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AACzC,iCAAuE;AACvE,iDAAyF;AACzF,sDAAoD;AACpD,iDAA4C;AAC5C,yDAAoD;AACpD,yCAAoC;AACpC,yCAAiD;AAKjD,IAAa,YAAY,GAAzB,MAAa,YAAY;IAoCvB,gBAAgB;QACd,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC;QACzG,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAE7E,MAAM,aAAa,GAAkB;YACnC,YAAY,EAAE;gBACZ,0BAA0B;gBAC1B,GAAG,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE,CAAC,eAAe,WAAW,CAAC,GAAG,EAAE;aAC5D;YACD,GAAG,OAAO;YACV,OAAO;YACP,IAAI;SACL,CAAC;QAEF,IAAI,QAAQ,EAAE;YACZ,aAAa,CAAC,WAAW,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAC7C,IAAI,CAA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ACG;AAGnB;IADC,IAAA,aAAQ,EAAC,UAAU,CAAC;;8CACe;AAGpC;IADC,IAAA,aAAQ,EAAC,WAAW,CAAC;;+CACe;AAGrC;IADC,IAAA,aAAQ,EAAC,aAAa,EAAE,EAAE,CAAC;;4CACH;AAGzB;IADC,IAAA,aAAQ,EAAC,MAAM,CAAC;;0CACY;AAG7B;IADC,IAAA,aAAQ,EAAC,eAAe,CAAC;;kDACK;AAG/B;IADC,IAAA,WAAM,GAAE;2CACW,mBAAQ;8CAAC;AAG7B;IADC,IAAA,WAAM,GAAE;2CACmB,mCAAgB;sDAAC;AAG7C;IADC,IAAA,WAAM,GAAE;2CACW,2BAAY;8CAAC;AAGjC;IADC,IAAA,WAAM,GAAE;2CACW,oBAAe;8CAAC;AAGpC;IADC,IAAA,WAAM,GAAE;2CACM,4BAAmB;yCAAC;AAlCxB,YAAY;IADxB,IAAA,eAAU,GAAE;GACA,YAAY,CAqLxB;AArLY,oCAAY","sourcesContent":["import {Env, setValue} from \"@tsed/core\";\nimport {Constant, Inject, Injectable, InjectorService} from \"@tsed/di\";\nimport {Provider as OIDCProvider, Configuration, interactionPolicy} from \"oidc-provider\";\nimport {INTERACTIONS} from \"../constants/constants\";\nimport {OidcAdapters} from \"./OidcAdapters\";\nimport {OidcInteractions} from \"./OidcInteractions\";\nimport {OidcJwks} from \"./OidcJwks\";\nimport {PlatformApplication} from \"@tsed/common\";\nimport {OidcSettings} from \"../domain/OidcSettings\";\nimport {OidcAccountsMethods} from \"../domain/OidcAccountsMethods\";\n\n@Injectable()\nexport class OidcProvider {\n raw: OIDCProvider;\n\n @Constant(\"env\")\n protected env: Env;\n\n @Constant(\"httpPort\")\n protected httpPort: number | string;\n\n @Constant(\"httpsPort\")\n protected httpsPort: number | string;\n\n @Constant(\"oidc.issuer\", \"\")\n protected issuer: string;\n\n @Constant(\"oidc\")\n protected oidc: OidcSettings;\n\n @Constant(\"PLATFORM_NAME\")\n protected platformName: string;\n\n @Inject()\n protected oidcJwks: OidcJwks;\n\n @Inject()\n protected oidcInteractions: OidcInteractions;\n\n @Inject()\n protected adapters: OidcAdapters;\n\n @Inject()\n protected injector: InjectorService;\n\n @Inject()\n protected app: PlatformApplication;\n\n hasConfiguration() {\n return !!this.oidc;\n }\n\n async getConfiguration(): Promise<Configuration> {\n const [jwks, adapter] = await Promise.all([this.oidcJwks.getJwks(), this.adapters.createAdapterClass()]);\n const {issuer, jwksPath, secureKey, proxy, Accounts, ...options} = this.oidc;\n\n const configuration: Configuration = {\n interactions: {\n /* istanbul ignore next */\n url: (ctx, interaction) => `interaction/${interaction.uid}`\n },\n ...options,\n adapter,\n jwks\n };\n\n if (Accounts) {\n configuration.findAccount = (ctx, id, token) =>\n this.injector.get<OidcAccountsMethods>(Accounts)!.findAccount(id, token, (ctx.req as any).$ctx);\n }\n\n if (this.env === Env.PROD) {\n setValue(configuration, \"cookies.short.secure\", true);\n setValue(configuration, \"cookies.long.secure\", true);\n }\n\n const policy = this.getPolicy();\n if (policy) {\n setValue(configuration, \"interactions.policy\", policy);\n }\n\n const url = this.getInteractionsUrl();\n if (url) {\n setValue(configuration, \"interactions.url\", url);\n }\n\n return configuration;\n }\n\n getIssuer() {\n if (this.issuer) {\n return this.issuer;\n }\n\n // istanbul ignore next\n if (this.httpsPort) {\n return `https://localhost:${this.httpsPort}`;\n }\n\n return `http://localhost:${this.httpPort}`;\n }\n\n get(): OIDCProvider {\n return this.raw;\n }\n\n /**\n * Create a new instance of OidcProvider\n */\n async create(): Promise<void | OIDCProvider> {\n const {proxy, secureKey} = this.oidc;\n const configuration = await this.getConfiguration();\n const oidcProvider = new OIDCProvider(this.getIssuer(), configuration);\n\n if (proxy || this.env === Env.PROD) {\n // istanbul ignore next\n switch (this.platformName) {\n default:\n case \"express\":\n oidcProvider.proxy = true;\n break;\n case \"koa\":\n (this.app.rawApp as any).proxy = true;\n break;\n }\n }\n\n if (secureKey) {\n oidcProvider.app.keys = secureKey;\n }\n\n this.raw = oidcProvider;\n\n if (this.env !== Env.PROD) {\n this.allowHttpLocalhost();\n }\n\n await this.injector.emit(\"$onCreateOIDC\", this.raw);\n\n return this.raw;\n }\n\n private getInteractionsUrl() {\n const provider = this.injector.getProviders().find((provider) => provider.subType === INTERACTIONS);\n\n if (provider) {\n return (ctx: any, interaction: any) => {\n // eslint-disable-line no-unused-vars\n return provider.path.replace(/:uid/, interaction.uid);\n };\n }\n }\n\n private allowHttpLocalhost() {\n const {invalidate: orig} = (this.raw.Client as any).Schema.prototype;\n\n (this.raw.Client as any).Schema.prototype.invalidate = function invalidate(message: string, code: string) {\n if (code === \"implicit-force-https\" || code === \"implicit-forbid-localhost\") {\n return;\n }\n\n /* istanbul ignore next */\n return orig.call(this, message);\n };\n }\n\n private getPolicy() {\n const policy = interactionPolicy.base();\n const interactions = this.oidcInteractions.getInteractions();\n\n if (interactions.length) {\n interactions.forEach((provider) => {\n const {name, ...options} = provider.store.get(\"interactionOptions\");\n\n if (!policy.get(name)) {\n policy.add(\n new interactionPolicy.Prompt({\n name,\n ...options\n })\n );\n }\n\n const instance = this.injector.get(provider.token);\n\n if (instance.$onCreate) {\n instance.$onCreate(policy.get(name));\n }\n });\n }\n\n return this.injector.alter(\"$alterOidcPolicy\", policy);\n }\n}\n"]}
|
package/lib/esm/OidcModule.js
CHANGED
|
@@ -2,9 +2,9 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import { Inject, InjectorService, PlatformApplication } from "@tsed/common";
|
|
3
3
|
import { Constant, Module } from "@tsed/di";
|
|
4
4
|
import koaMount from "koa-mount";
|
|
5
|
-
import { OidcAdapters } from "./services/OidcAdapters";
|
|
6
|
-
import { OidcJwks } from "./services/OidcJwks";
|
|
7
|
-
import { OidcProvider } from "./services/OidcProvider";
|
|
5
|
+
import { OidcAdapters } from "./services/OidcAdapters.js";
|
|
6
|
+
import { OidcJwks } from "./services/OidcJwks.js";
|
|
7
|
+
import { OidcProvider } from "./services/OidcProvider.js";
|
|
8
8
|
let OidcModule = class OidcModule {
|
|
9
9
|
async $onInit() {
|
|
10
10
|
if (this.oidcProvider.hasConfiguration()) {
|
|
@@ -8,4 +8,4 @@ export const INTERACTION_DETAILS = "interactionDetails";
|
|
|
8
8
|
export const INTERACTION_OPTIONS = "interactionOptions";
|
|
9
9
|
export const INTERACTION = "interaction";
|
|
10
10
|
export const INTERACTIONS = "interactions";
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AACzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC","sourcesContent":["export const INTERACTION_CONTEXT = \"interactionContext\";\nexport const INTERACTION_PARAMS = \"interactionParams\";\nexport const INTERACTION_GRANT_ID = \"interactionGrantId\";\nexport const INTERACTION_PROMPT = \"interactionPrompt\";\nexport const INTERACTION_UID = \"interactionUid\";\nexport const INTERACTION_SESSION = \"interactionSession\";\nexport const INTERACTION_DETAILS = \"interactionDetails\";\nexport const INTERACTION_OPTIONS = \"interactionOptions\";\nexport const INTERACTION = \"interaction\";\nexport const INTERACTIONS = \"interactions\";\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "@tsed/common";
|
|
2
2
|
import { useDecorators } from "@tsed/core";
|
|
3
|
-
import { INTERACTION_GRANT_ID } from "../constants";
|
|
3
|
+
import { INTERACTION_GRANT_ID } from "../constants/constants.js";
|
|
4
4
|
export function GrantId() {
|
|
5
5
|
return useDecorators(Context(INTERACTION_GRANT_ID));
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantId.js","sourceRoot":"","sources":["../../../src/decorators/grantId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,oBAAoB,EAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"grantId.js","sourceRoot":"","sources":["../../../src/decorators/grantId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,oBAAoB,EAAqB,MAAM,wBAAwB,CAAC;AAEhF,MAAM,UAAU,OAAO;IACrB,OAAO,aAAa,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {INTERACTION_GRANT_ID, INTERACTION_PARAMS} from \"../constants/constants\";\n\nexport function GrantId(): ParameterDecorator {\n return useDecorators(Context(INTERACTION_GRANT_ID));\n}\n\nexport type GrantId = string;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Controller } from "@tsed/common";
|
|
2
2
|
import { StoreMerge, useDecorators } from "@tsed/core";
|
|
3
|
-
import { INTERACTION, INTERACTION_OPTIONS } from "../constants";
|
|
3
|
+
import { INTERACTION, INTERACTION_OPTIONS } from "../constants/constants.js";
|
|
4
4
|
/**
|
|
5
5
|
* @Oidc
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../../src/decorators/interaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACrD,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../../src/decorators/interaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACrD,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAGxE;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,OAA+B;IACzD,OAAO,aAAa,CAClB,UAAU,CAAC;QACT,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,WAAW;KACrB,CAAC,EACF,UAAU,CAAC,mBAAmB,EAAE,OAAO,CAAC,CACzC,CAAC;AACJ,CAAC","sourcesContent":["import {Controller} from \"@tsed/common\";\nimport {StoreMerge, useDecorators} from \"@tsed/core\";\nimport {INTERACTION, INTERACTION_OPTIONS} from \"../constants/constants\";\nimport {OidcInteractionOptions} from \"../domain/OidcInteractionOptions\";\n\n/**\n * @Oidc\n */\nexport function Interaction(options: OidcInteractionOptions): ClassDecorator {\n return useDecorators(\n Controller({\n path: \"/\",\n subType: INTERACTION\n }),\n StoreMerge(INTERACTION_OPTIONS, options)\n );\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Controller, UseBefore } from "@tsed/common";
|
|
2
2
|
import { useDecorators } from "@tsed/core";
|
|
3
|
-
import { INTERACTIONS } from "../constants";
|
|
4
|
-
import { OidcInteractionMiddleware } from "../middlewares/OidcInteractionMiddleware";
|
|
5
|
-
import { NoCache } from "./noCache";
|
|
3
|
+
import { INTERACTIONS } from "../constants/constants.js";
|
|
4
|
+
import { OidcInteractionMiddleware } from "../middlewares/OidcInteractionMiddleware.js";
|
|
5
|
+
import { NoCache } from "./noCache.js";
|
|
6
6
|
export function Interactions(options) {
|
|
7
7
|
const { path } = options;
|
|
8
8
|
return useDecorators(Controller({ path, children: options.children, subType: INTERACTIONS }), NoCache(), UseBefore(OidcInteractionMiddleware));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../../src/decorators/interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AACnD,OAAO,EAAO,aAAa,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../../src/decorators/interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AACnD,OAAO,EAAO,aAAa,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAC,yBAAyB,EAAC,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAOlC,MAAM,UAAU,YAAY,CAAC,OAA4B;IACvD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;IACvB,OAAO,aAAa,CAClB,UAAU,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAC,CAAC,EACrE,OAAO,EAAE,EACT,SAAS,CAAC,yBAAyB,CAAC,CACrC,CAAC;AACJ,CAAC","sourcesContent":["import {Controller, UseBefore} from \"@tsed/common\";\nimport {Type, useDecorators} from \"@tsed/core\";\nimport {INTERACTIONS} from \"../constants/constants\";\nimport {OidcInteractionMiddleware} from \"../middlewares/OidcInteractionMiddleware\";\nimport {NoCache} from \"./noCache\";\n\nexport interface InteractionsOptions {\n path: string;\n children: Type<any>[];\n}\n\nexport function Interactions(options: InteractionsOptions): ClassDecorator {\n const {path} = options;\n return useDecorators(\n Controller({path, children: options.children, subType: INTERACTIONS}),\n NoCache(),\n UseBefore(OidcInteractionMiddleware)\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseBefore } from "@tsed/common";
|
|
2
|
-
import { OidcNoCacheMiddleware } from "../middlewares/OidcNoCacheMiddleware";
|
|
2
|
+
import { OidcNoCacheMiddleware } from "../middlewares/OidcNoCacheMiddleware.js";
|
|
3
3
|
export function NoCache() {
|
|
4
4
|
return UseBefore(OidcNoCacheMiddleware);
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "@tsed/common";
|
|
2
2
|
import { useDecorators } from "@tsed/core";
|
|
3
|
-
import { INTERACTION_CONTEXT } from "../constants";
|
|
3
|
+
import { INTERACTION_CONTEXT } from "../constants/constants.js";
|
|
4
4
|
export function OidcCtx() {
|
|
5
5
|
return useDecorators(Context(INTERACTION_CONTEXT));
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidcCtx.js","sourceRoot":"","sources":["../../../src/decorators/oidcCtx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,mBAAmB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oidcCtx.js","sourceRoot":"","sources":["../../../src/decorators/oidcCtx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAG3D,MAAM,UAAU,OAAO;IACrB,OAAO,aAAa,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {INTERACTION_CONTEXT} from \"../constants/constants\";\nimport {OidcInteractionContext} from \"../services/OidcInteractionContext\";\n\nexport function OidcCtx(): ParameterDecorator {\n return useDecorators(Context(INTERACTION_CONTEXT));\n}\n\nexport type OidcCtx = OidcInteractionContext;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidcSession.js","sourceRoot":"","sources":["../../../src/decorators/oidcSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,mBAAmB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oidcSession.js","sourceRoot":"","sources":["../../../src/decorators/oidcSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAE3D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,UAAmB;IAC7C,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7F,CAAC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {Provider} from \"oidc-provider\";\nimport {INTERACTION_SESSION} from \"../constants/constants\";\n\n/**\n * @decorator\n */\nexport function OidcSession(expression?: string): ParameterDecorator {\n return useDecorators(Context([INTERACTION_SESSION, expression].filter(Boolean).join(\".\")));\n}\n\nexport type OidcSession = InstanceType<Provider[\"Session\"]>;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "@tsed/common";
|
|
2
2
|
import { useDecorators } from "@tsed/core";
|
|
3
|
-
import { INTERACTION_PARAMS } from "../constants";
|
|
3
|
+
import { INTERACTION_PARAMS } from "../constants/constants.js";
|
|
4
4
|
export function Params(expression) {
|
|
5
5
|
return useDecorators(Context([INTERACTION_PARAMS, expression].filter(Boolean).join(".")));
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../../src/decorators/params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,kBAAkB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../../src/decorators/params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAE1D,MAAM,UAAU,MAAM,CAAC,UAAmB;IACxC,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {INTERACTION_PARAMS} from \"../constants/constants\";\n\nexport function Params(expression?: string): ParameterDecorator {\n return useDecorators(Context([INTERACTION_PARAMS, expression].filter(Boolean).join(\".\")));\n}\n\nexport type Params = Record<string, any>;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "@tsed/common";
|
|
2
2
|
import { useDecorators } from "@tsed/core";
|
|
3
|
-
import { INTERACTION_PROMPT } from "../constants";
|
|
3
|
+
import { INTERACTION_PROMPT } from "../constants/constants.js";
|
|
4
4
|
export function Prompt() {
|
|
5
5
|
return useDecorators(Context(INTERACTION_PROMPT));
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/decorators/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,kBAAkB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/decorators/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAE1D,MAAM,UAAU,MAAM;IACpB,OAAO,aAAa,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {PromptDetail as P} from \"oidc-provider\";\nimport {INTERACTION_PROMPT} from \"../constants/constants\";\n\nexport function Prompt(): ParameterDecorator {\n return useDecorators(Context(INTERACTION_PROMPT));\n}\n\nexport type Prompt = P;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "@tsed/common";
|
|
2
2
|
import { useDecorators } from "@tsed/core";
|
|
3
|
-
import { INTERACTION_UID } from "../constants";
|
|
3
|
+
import { INTERACTION_UID } from "../constants/constants.js";
|
|
4
4
|
export function Uid() {
|
|
5
5
|
return useDecorators(Context(INTERACTION_UID));
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uid.js","sourceRoot":"","sources":["../../../src/decorators/uid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"uid.js","sourceRoot":"","sources":["../../../src/decorators/uid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAEvD,MAAM,UAAU,GAAG;IACjB,OAAO,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {useDecorators} from \"@tsed/core\";\nimport {INTERACTION_UID} from \"../constants/constants\";\n\nexport function Uid(): ParameterDecorator {\n return useDecorators(Context(INTERACTION_UID));\n}\n\nexport type Uid = string;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/domain/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {interactionPolicy, Provider} from \"oidc-provider\";\n\nexport type OidcClient = InstanceType<Provider[\"Client\"]>;\nexport type DefaultPolicy = interactionPolicy.DefaultPolicy;\n"]}
|