@toa.io/extensions.exposition 1.0.0-alpha.195 → 1.0.0-alpha.197
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/components/identity.basic/manifest.toa.yaml +1 -0
- package/components/identity.federation/manifest.toa.yaml +2 -2
- package/components/identity.federation/operations/incept.d.ts +1 -1
- package/components/identity.federation/operations/incept.js +8 -9
- package/components/identity.federation/operations/incept.js.map +1 -1
- package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/source/incept.ts +13 -13
- package/components/identity.otp/manifest.toa.yaml +1 -0
- package/components/identity.otp/operations/authenticate.js +4 -3
- package/components/identity.otp/operations/authenticate.js.map +1 -1
- package/components/identity.otp/operations/issue.js +3 -2
- package/components/identity.otp/operations/issue.js.map +1 -1
- package/components/identity.otp/operations/lib/Entity.d.ts +1 -0
- package/components/identity.otp/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.otp/source/authenticate.ts +5 -3
- package/components/identity.otp/source/issue.ts +2 -2
- package/components/identity.otp/source/lib/Entity.ts +1 -0
- package/package.json +2 -4
|
@@ -32,7 +32,7 @@ operations:
|
|
|
32
32
|
sub*: string
|
|
33
33
|
incept:
|
|
34
34
|
input:
|
|
35
|
-
scheme
|
|
35
|
+
scheme*: [bearer, code]
|
|
36
36
|
authority*: string
|
|
37
37
|
credentials*: string
|
|
38
38
|
id: string
|
|
@@ -131,6 +131,6 @@ exposition:
|
|
|
131
131
|
POST:
|
|
132
132
|
map:authority: authority
|
|
133
133
|
auth:id: id
|
|
134
|
-
io:input: [credentials]
|
|
134
|
+
io:input: [scheme, credentials]
|
|
135
135
|
io:output: false
|
|
136
136
|
endpoint: incept
|
|
@@ -2,8 +2,8 @@ import type { Context, Scheme } from './types';
|
|
|
2
2
|
export declare function effect(input: Input, context: Context): Promise<Output | Error>;
|
|
3
3
|
export interface Input {
|
|
4
4
|
authority: string;
|
|
5
|
+
scheme: Scheme;
|
|
5
6
|
credentials: string;
|
|
6
|
-
scheme?: Scheme;
|
|
7
7
|
id?: string;
|
|
8
8
|
}
|
|
9
9
|
export interface Output {
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.effect = void 0;
|
|
4
|
-
const error_value_1 = require("error-value");
|
|
5
4
|
const lib_1 = require("./lib");
|
|
6
5
|
async function effect(input, context) {
|
|
7
|
-
|
|
8
|
-
return ERR_SCHEME;
|
|
9
|
-
const payload = await (0, lib_1.decode)(input.credentials, {
|
|
6
|
+
const ctx = {
|
|
10
7
|
trust: context.configuration.trust,
|
|
11
8
|
logs: context.logs
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
};
|
|
10
|
+
const claims = input.scheme === 'bearer'
|
|
11
|
+
? await (0, lib_1.decode)(input.credentials, ctx)
|
|
12
|
+
: await (0, lib_1.exchange)(input.credentials, ctx);
|
|
13
|
+
if (claims instanceof Error)
|
|
14
|
+
return claims;
|
|
15
|
+
const { iss, sub } = claims;
|
|
16
16
|
const request = { input: { authority: input.authority, iss, sub } };
|
|
17
17
|
if (input.id !== undefined)
|
|
18
18
|
request.query = { id: input.id };
|
|
19
19
|
return await context.local.transit(request);
|
|
20
20
|
}
|
|
21
21
|
exports.effect = effect;
|
|
22
|
-
const ERR_SCHEME = new error_value_1.Err('ERR_SCHEME', 'Unsupported scheme');
|
|
23
22
|
//# sourceMappingURL=incept.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incept.js","sourceRoot":"","sources":["../source/incept.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"incept.js","sourceRoot":"","sources":["../source/incept.ts"],"names":[],"mappings":";;;AAAA,+BAAkD;AAI3C,KAAK,UAAU,MAAM,CAAE,KAAY,EAAE,OAAgB;IAC1D,MAAM,GAAG,GAAQ;QACf,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK;QAClC,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAA;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,KAAK,QAAQ;QACtC,CAAC,CAAC,MAAM,IAAA,YAAM,EAAC,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC;QACtC,CAAC,CAAC,MAAM,IAAA,cAAQ,EAAC,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC,CAAA;IAG1C,IAAI,MAAM,YAAY,KAAK;QACzB,OAAO,MAAM,CAAA;IAEf,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;IAC3B,MAAM,OAAO,GAA0B,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAA;IAE1F,IAAI,KAAK,CAAC,EAAE,KAAK,SAAS;QACxB,OAAO,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAA;IAElC,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;AAC7C,CAAC;AArBD,wBAqBC"}
|