@toa.io/extensions.exposition 1.0.0-alpha.253 → 1.0.0-alpha.254
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/context.toa.yaml +6 -1
- package/components/identity.bans/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/manifest.toa.yaml +1 -1
- package/components/identity.basic/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.credentials/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/manifest.toa.yaml +4 -4
- package/components/identity.federation/operations/authenticate.js +2 -1
- package/components/identity.federation/operations/authenticate.js.map +1 -1
- package/components/identity.federation/operations/decode.js +2 -1
- package/components/identity.federation/operations/decode.js.map +1 -1
- package/components/identity.federation/operations/delete.d.ts +2 -2
- package/components/identity.federation/operations/delete.js +3 -3
- package/components/identity.federation/operations/delete.js.map +1 -1
- package/components/identity.federation/operations/incept.js +2 -1
- package/components/identity.federation/operations/incept.js.map +1 -1
- package/components/identity.federation/operations/lib/Ctx.d.ts +2 -0
- package/components/identity.federation/operations/lib/decode.js +4 -27
- package/components/identity.federation/operations/lib/decode.js.map +1 -1
- package/components/identity.federation/operations/lib/discovery.d.ts +4 -3
- package/components/identity.federation/operations/lib/discovery.js +21 -31
- package/components/identity.federation/operations/lib/discovery.js.map +1 -1
- package/components/identity.federation/operations/lib/exchange.js +7 -6
- package/components/identity.federation/operations/lib/exchange.js.map +1 -1
- package/components/identity.federation/operations/lib/jose.d.ts +41 -0
- package/components/identity.federation/operations/lib/jose.js +27 -0
- package/components/identity.federation/operations/lib/jose.js.map +1 -0
- package/components/identity.federation/operations/list.js +2 -1
- package/components/identity.federation/operations/list.js.map +1 -1
- package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/types/context.d.ts +2 -0
- package/components/identity.federation/source/authenticate.ts +2 -1
- package/components/identity.federation/source/decode.ts +2 -1
- package/components/identity.federation/source/delete.ts +4 -4
- package/components/identity.federation/source/incept.ts +2 -1
- package/components/identity.federation/source/lib/Ctx.ts +2 -0
- package/components/identity.federation/source/lib/decode.ts +4 -5
- package/components/identity.federation/source/lib/discovery.test.ts +45 -0
- package/components/identity.federation/source/lib/discovery.ts +27 -8
- package/components/identity.federation/source/lib/exchange.ts +7 -7
- package/components/identity.federation/source/lib/jose.d.ts +1 -0
- package/components/identity.federation/source/lib/jose.js +5 -0
- package/components/identity.federation/source/list.test.ts +2 -1
- package/components/identity.federation/source/list.ts +2 -1
- package/components/identity.federation/source/types/context.ts +3 -0
- package/components/identity.federation/tsconfig.json +1 -4
- package/components/identity.keys/manifest.toa.yaml +1 -0
- package/components/identity.keys/operations/create.js +2 -2
- package/components/identity.keys/operations/create.js.map +1 -1
- package/components/identity.keys/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.keys/source/create.ts +2 -2
- package/components/identity.otp/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.passkeys/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.roles/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.tokens/manifest.toa.yaml +21 -4
- package/components/identity.tokens/operations/decrypt.d.ts +4 -2
- package/components/identity.tokens/operations/decrypt.js +60 -12
- package/components/identity.tokens/operations/decrypt.js.map +1 -1
- package/components/identity.tokens/operations/encrypt.js +14 -13
- package/components/identity.tokens/operations/encrypt.js.map +1 -1
- package/components/identity.tokens/operations/lib/index.d.ts +1 -0
- package/components/identity.tokens/operations/lib/index.js +3 -0
- package/components/identity.tokens/operations/lib/index.js.map +1 -1
- package/components/identity.tokens/operations/lib/jose.d.ts +41 -0
- package/components/identity.tokens/operations/lib/jose.js +27 -0
- package/components/identity.tokens/operations/lib/jose.js.map +1 -0
- package/components/identity.tokens/operations/lib/key.d.ts +1 -0
- package/components/identity.tokens/operations/lib/key.js +11 -0
- package/components/identity.tokens/operations/lib/key.js.map +1 -0
- package/components/identity.tokens/operations/lib/types.d.ts +10 -1
- package/components/identity.tokens/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.tokens/source/authenticate.test.ts +4 -3
- package/components/identity.tokens/source/decrypt.test.ts +69 -8
- package/components/identity.tokens/source/decrypt.ts +72 -14
- package/components/identity.tokens/source/encrypt.test.ts +30 -3
- package/components/identity.tokens/source/encrypt.ts +18 -16
- package/components/identity.tokens/source/lib/index.ts +1 -0
- package/components/identity.tokens/source/lib/jose.d.ts +1 -0
- package/components/identity.tokens/source/lib/jose.js +5 -0
- package/components/identity.tokens/source/lib/key.ts +8 -0
- package/components/identity.tokens/source/lib/types.ts +12 -1
- package/documentation/authorities.md +1 -1
- package/documentation/components.md +70 -30
- package/documentation/identity.md +12 -14
- package/features/access.feature +1 -1
- package/features/cache.feature +5 -5
- package/features/cors.feature +4 -4
- package/features/credentials.feature +3 -3
- package/features/identity.basic.feature +1 -1
- package/features/identity.federation.feature +4 -5
- package/features/identity.roles.feature +1 -1
- package/features/identity.tokens.feature +3 -3
- package/features/steps/Gateway.ts +11 -3
- package/package.json +18 -21
- package/source/HTTP/formats/yaml.test.ts +9 -0
- package/source/HTTP/formats/yaml.ts +2 -1
- package/source/HTTP/messages.ts +1 -1
- package/source/directives/io/lib/throttle/Interval.ts +10 -1
- package/transpiled/HTTP/formats/yaml.js +2 -1
- package/transpiled/HTTP/formats/yaml.js.map +1 -1
- package/transpiled/HTTP/messages.js +24 -4
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/Interval.d.ts +1 -0
- package/transpiled/directives/io/lib/throttle/Interval.js +9 -1
- package/transpiled/directives/io/lib/throttle/Interval.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
|
@@ -88,7 +88,7 @@ operations:
|
|
|
88
88
|
input:
|
|
89
89
|
authority*: string
|
|
90
90
|
identity*: string
|
|
91
|
-
|
|
91
|
+
credential*: string
|
|
92
92
|
|
|
93
93
|
configuration:
|
|
94
94
|
schema:
|
|
@@ -157,14 +157,14 @@ exposition:
|
|
|
157
157
|
GET:
|
|
158
158
|
map:authority: authority
|
|
159
159
|
map:segments:
|
|
160
|
-
|
|
160
|
+
identity: id
|
|
161
161
|
io:output: [id, iss, _created]
|
|
162
162
|
endpoint: list
|
|
163
163
|
/:credential:
|
|
164
164
|
DELETE:
|
|
165
165
|
map:authority: authority
|
|
166
166
|
map:segments:
|
|
167
|
-
|
|
168
|
-
credential:
|
|
167
|
+
identity: id
|
|
168
|
+
credential: credential
|
|
169
169
|
io:output: false
|
|
170
170
|
endpoint: delete
|
|
@@ -7,7 +7,8 @@ async function effect({ scheme, authority, credentials }, context) {
|
|
|
7
7
|
context.logs.debug('Authenticating', { scheme, authority, credentials });
|
|
8
8
|
const ctx = {
|
|
9
9
|
trust: context.configuration.trust,
|
|
10
|
-
logs: context.logs
|
|
10
|
+
logs: context.logs,
|
|
11
|
+
fetch: context.fetch
|
|
11
12
|
};
|
|
12
13
|
const claims = scheme === 'bearer'
|
|
13
14
|
? await (0, lib_1.decode)(credentials, ctx)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../source/authenticate.ts"],"names":[],"mappings":";;;AAAA,6CAAiC;AACjC,+BAAwC;AAMjC,KAAK,UAAU,MAAM,CAAE,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAS,EAAE,OAAgB;IACvF,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAA;IAExE,MAAM,GAAG,GAAQ;QACf,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK;QAClC,IAAI,EAAE,OAAO,CAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../source/authenticate.ts"],"names":[],"mappings":";;;AAAA,6CAAiC;AACjC,+BAAwC;AAMjC,KAAK,UAAU,MAAM,CAAE,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAS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E,MAAM,EAAE,EAAE,CAAA;AACvE,CAAC;AA/BD,wBA+BC;AAED,MAAM,aAAa,GAAG,IAAI,iBAAG,CAAC,WAAW,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decode.js","sourceRoot":"","sources":["../source/decode.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAIvB,KAAK,UAAU,MAAM,CAAE,KAAa,EAAE,OAAgB;IAC3D,OAAO,MAAM,IAAA,YAAM,EAAC,KAAK,EAAE;QACzB,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK;QAClC,IAAI,EAAE,OAAO,CAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"decode.js","sourceRoot":"","sources":["../source/decode.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAIvB,KAAK,UAAU,MAAM,CAAE,KAAa,EAAE,OAAgB;IAC3D,OAAO,MAAM,IAAA,YAAM,EAAC,KAAK,EAAE;QACzB,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK;QAClC,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAA;AACJ,CAAC;AAND,wBAMC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Context } from './types';
|
|
2
|
-
export declare function effect({ authority, identity,
|
|
2
|
+
export declare function effect({ authority, identity, credential }: Input, context: Context): Promise<void | null>;
|
|
3
3
|
interface Input {
|
|
4
4
|
authority: string;
|
|
5
5
|
identity: string;
|
|
6
|
-
|
|
6
|
+
credential: string;
|
|
7
7
|
}
|
|
8
8
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.effect = void 0;
|
|
4
|
-
async function effect({ authority, identity,
|
|
5
|
-
const object = await context.local.observe({ query: { id } });
|
|
4
|
+
async function effect({ authority, identity, credential }, context) {
|
|
5
|
+
const object = await context.local.observe({ query: { id: credential } });
|
|
6
6
|
if (object === null || object.authority !== authority || (object.identity ?? object.id) !== identity)
|
|
7
7
|
return null;
|
|
8
|
-
return await context.local.terminate({ query: { id } });
|
|
8
|
+
return await context.local.terminate({ query: { id: credential } });
|
|
9
9
|
}
|
|
10
10
|
exports.effect = effect;
|
|
11
11
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../source/delete.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,MAAM,CAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../source/delete.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,MAAM,CAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAS,EAAE,OAAgB;IACxF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,CAAA;IAEzE,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC,KAAK,QAAQ;QAClG,OAAO,IAAI,CAAA;IAEb,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,CAAA;AACrE,CAAC;AAPD,wBAOC"}
|
|
@@ -6,7 +6,8 @@ const lib_1 = require("./lib");
|
|
|
6
6
|
async function effect(input, context) {
|
|
7
7
|
const ctx = {
|
|
8
8
|
trust: context.configuration.trust,
|
|
9
|
-
logs: context.logs
|
|
9
|
+
logs: context.logs,
|
|
10
|
+
fetch: context.fetch
|
|
10
11
|
};
|
|
11
12
|
const claims = input.scheme === 'bearer'
|
|
12
13
|
? await (0, lib_1.decode)(input.credentials, ctx)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incept.js","sourceRoot":"","sources":["../source/incept.ts"],"names":[],"mappings":";;;AAAA,6CAAiC;AACjC,+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;
|
|
1
|
+
{"version":3,"file":"incept.js","sourceRoot":"","sources":["../source/incept.ts"],"names":[],"mappings":";;;AAAA,6CAAiC;AACjC,+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;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,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;IAE1C,IAAI,MAAM,YAAY,KAAK;QACzB,OAAO,MAAM,CAAA;IAEf,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;IAE3B,IAAI,KAAK,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,OAAO,GAA0B,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAA;QAE1F,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;QAC3C,KAAK,EAAE,EAAE,QAAQ,EAAE,cAAc,KAAK,CAAC,SAAS,SAAS,GAAG,SAAS,GAAG,EAAE,EAAE;KAC7E,CAAC,CAAA;IAEF,IAAI,QAAQ,KAAK,IAAI;QACnB,OAAO,CAAC,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAA;IAExF,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;QACjC,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE;KACpE,CAAC,CAAA;AACJ,CAAC;AAhCD,wBAgCC;AAaD,MAAM,UAAU,GAAG,IAAI,iBAAG,CAAC,QAAQ,EAAE,6DAA6D,CAAC,CAAA"}
|
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.decode = void 0;
|
|
27
|
-
const
|
|
4
|
+
const jose_1 = require("./jose");
|
|
28
5
|
const discovery_1 = require("./discovery");
|
|
29
6
|
const errors_1 = require("./errors");
|
|
30
|
-
const jwks = {};
|
|
31
7
|
async function decode(token, ctx) {
|
|
8
|
+
const jose = await (0, jose_1.load)();
|
|
32
9
|
const { iss, sub } = jose.decodeJwt(token);
|
|
33
10
|
if (typeof iss !== 'string')
|
|
34
11
|
return errors_1.ERR_ISS;
|
|
@@ -37,8 +14,8 @@ async function decode(token, ctx) {
|
|
|
37
14
|
const trusted = ctx.trust.find((trust) => trust.iss === iss);
|
|
38
15
|
if (trusted === undefined)
|
|
39
16
|
return errors_1.ERR_TRUST;
|
|
40
|
-
jwks
|
|
41
|
-
const { payload } = await jose.jwtVerify(token, jwks
|
|
17
|
+
const jwks = await (0, discovery_1.createRemoteJWKSet)(iss, ctx.fetch);
|
|
18
|
+
const { payload } = await jose.jwtVerify(token, jwks, { audience: trusted.aud });
|
|
42
19
|
return payload;
|
|
43
20
|
}
|
|
44
21
|
exports.decode = decode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decode.js","sourceRoot":"","sources":["../../source/lib/decode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decode.js","sourceRoot":"","sources":["../../source/lib/decode.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,2CAAgD;AAChD,qCAAsD;AAI/C,KAAK,UAAU,MAAM,CAAE,KAAa,EAAE,GAAQ;IACnD,MAAM,IAAI,GAAG,MAAM,IAAA,WAAI,GAAE,CAAA;IACzB,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAE1C,IAAI,OAAO,GAAG,KAAK,QAAQ;QACzB,OAAO,gBAAO,CAAA;IAEhB,IAAI,OAAO,GAAG,KAAK,QAAQ;QACzB,OAAO,gBAAO,CAAA;IAEhB,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,CAAA;IAE5D,IAAI,OAAO,KAAK,SAAS;QACvB,OAAO,kBAAS,CAAA;IAElB,MAAM,IAAI,GAAG,MAAM,IAAA,8BAAkB,EAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IAErD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IAEhF,OAAO,OAAkB,CAAA;AAC3B,CAAC;AApBD,wBAoBC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import * as jose from 'jose';
|
|
1
|
+
import type * as jose from 'jose';
|
|
2
2
|
import type { Configuration } from './Configuration';
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
3
|
+
import type { Fetch } from '../types/context';
|
|
4
|
+
export declare function discover(iss: string, fetch: Fetch): Promise<Configuration>;
|
|
5
|
+
export declare function createRemoteJWKSet(iss: string, fetch: Fetch): Promise<jose.RemoteJWKSet>;
|
|
@@ -1,49 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.createRemoteJWKSet = exports.discover = void 0;
|
|
27
|
-
const
|
|
4
|
+
const jose_1 = require("./jose");
|
|
28
5
|
const cache = new Map();
|
|
29
|
-
|
|
6
|
+
const resolvers = new WeakMap();
|
|
7
|
+
async function discover(iss, fetch) {
|
|
30
8
|
if (!cache.has(iss)) {
|
|
31
|
-
const configuration = await fetchConfiguration(iss);
|
|
9
|
+
const configuration = await fetchConfiguration(iss, fetch);
|
|
32
10
|
cache.set(iss, configuration);
|
|
33
11
|
}
|
|
34
12
|
return cache.get(iss);
|
|
35
13
|
}
|
|
36
14
|
exports.discover = discover;
|
|
37
|
-
async function fetchConfiguration(iss) {
|
|
15
|
+
async function fetchConfiguration(iss, fetch) {
|
|
38
16
|
const response = await fetch(`${iss}/.well-known/openid-configuration`);
|
|
39
17
|
if (!response.ok)
|
|
40
18
|
throw new Error('Failed to fetch OIDC configuration');
|
|
41
19
|
return await response.json();
|
|
42
20
|
}
|
|
43
|
-
async function createRemoteJWKSet(iss) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
21
|
+
async function createRemoteJWKSet(iss, fetch) {
|
|
22
|
+
let entries = resolvers.get(fetch);
|
|
23
|
+
if (entries === undefined) {
|
|
24
|
+
entries = new Map();
|
|
25
|
+
resolvers.set(fetch, entries);
|
|
26
|
+
}
|
|
27
|
+
if (!entries.has(iss))
|
|
28
|
+
entries.set(iss, create(iss, fetch));
|
|
29
|
+
return await entries.get(iss);
|
|
47
30
|
}
|
|
48
31
|
exports.createRemoteJWKSet = createRemoteJWKSet;
|
|
32
|
+
async function create(iss, fetch) {
|
|
33
|
+
const jose = await (0, jose_1.load)();
|
|
34
|
+
const configuration = await discover(iss, fetch);
|
|
35
|
+
return jose.createRemoteJWKSet(new URL(configuration.jwks_uri), {
|
|
36
|
+
[jose.customFetch]: fetch
|
|
37
|
+
});
|
|
38
|
+
}
|
|
49
39
|
//# sourceMappingURL=discovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../source/lib/discovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../source/lib/discovery.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAK7B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAA;AAC9C,MAAM,SAAS,GAAG,IAAI,OAAO,EAAkD,CAAA;AAExE,KAAK,UAAU,QAAQ,CAAE,GAAW,EAAE,KAAY;IACvD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,aAAa,GAAG,MAAM,kBAAkB,CAAC,GA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9D,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK;KAC1B,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -24,11 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.exchange = void 0;
|
|
27
|
-
const
|
|
27
|
+
const jose_1 = require("./jose");
|
|
28
28
|
const discovery_1 = require("./discovery");
|
|
29
29
|
const errors = __importStar(require("./errors"));
|
|
30
|
-
const jwks = {};
|
|
31
30
|
async function exchange(credentials, ctx) {
|
|
31
|
+
const jose = await (0, jose_1.load)();
|
|
32
32
|
const properties = decode(credentials);
|
|
33
33
|
if (properties instanceof Error)
|
|
34
34
|
return properties;
|
|
@@ -38,7 +38,7 @@ async function exchange(credentials, ctx) {
|
|
|
38
38
|
return errors.ERR_TRUST;
|
|
39
39
|
if (trusted.aud === undefined || (trusted.secret === undefined && trusted.signature === undefined))
|
|
40
40
|
return errors.ERR_CODE_NOT_ENABLED;
|
|
41
|
-
const configuration = await (0, discovery_1.discover)(iss);
|
|
41
|
+
const configuration = await (0, discovery_1.discover)(iss, ctx.fetch);
|
|
42
42
|
if (configuration.token_endpoint === undefined)
|
|
43
43
|
return errors.ERR_CONFIG;
|
|
44
44
|
// array actually is not expected here, but it is a valid format
|
|
@@ -57,7 +57,7 @@ async function exchange(credentials, ctx) {
|
|
|
57
57
|
auth: trusted.secret === undefined ? 'signature' : 'secret',
|
|
58
58
|
code
|
|
59
59
|
});
|
|
60
|
-
const response = await fetch(configuration.token_endpoint, {
|
|
60
|
+
const response = await ctx.fetch(configuration.token_endpoint, {
|
|
61
61
|
method: 'POST',
|
|
62
62
|
headers: {
|
|
63
63
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
@@ -71,8 +71,8 @@ async function exchange(credentials, ctx) {
|
|
|
71
71
|
const tokens = await response.json();
|
|
72
72
|
if (tokens.id_token === undefined)
|
|
73
73
|
return errors.ERR_NO_TOKEN;
|
|
74
|
-
jwks
|
|
75
|
-
const { payload } = await jose.jwtVerify(tokens.id_token, jwks
|
|
74
|
+
const jwks = await (0, discovery_1.createRemoteJWKSet)(iss, ctx.fetch);
|
|
75
|
+
const { payload } = await jose.jwtVerify(tokens.id_token, jwks, {
|
|
76
76
|
audience: trusted.aud,
|
|
77
77
|
issuer: iss
|
|
78
78
|
});
|
|
@@ -90,6 +90,7 @@ function decode(credentials) {
|
|
|
90
90
|
return properties;
|
|
91
91
|
}
|
|
92
92
|
async function sign(trust) {
|
|
93
|
+
const jose = await (0, jose_1.load)();
|
|
93
94
|
const signature = trust.signature;
|
|
94
95
|
const aud = Array.isArray(trust.aud) ? trust.aud[0] : trust.aud;
|
|
95
96
|
const now = Math.floor(Date.now() / 1000);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../source/lib/exchange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../source/lib/exchange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA6B;AAC7B,2CAA0D;AAC1D,iDAAkC;AAK3B,KAAK,UAAU,QAAQ,CAAE,WAAmB,EAAE,GAAQ;IAC3D,MAAM,IAAI,GAAG,MAAM,IAAA,WAAI,GAAE,CAAA;IACzB,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;IAEtC,IAAI,UAAU,YAAY,KAAK;QAC7B,OAAO,UAAU,CAAA;IAEnB,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAA;IAE/C,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,CAAA;IAE5D,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
1
|
+
export function load(): Promise<{
|
|
2
|
+
default: typeof import("jose");
|
|
3
|
+
compactDecrypt: typeof import("jose").compactDecrypt;
|
|
4
|
+
flattenedDecrypt: typeof import("jose").flattenedDecrypt;
|
|
5
|
+
generalDecrypt: typeof import("jose").generalDecrypt;
|
|
6
|
+
GeneralEncrypt: typeof import("jose").GeneralEncrypt;
|
|
7
|
+
compactVerify: typeof import("jose").compactVerify;
|
|
8
|
+
flattenedVerify: typeof import("jose").flattenedVerify;
|
|
9
|
+
generalVerify: typeof import("jose").generalVerify;
|
|
10
|
+
jwtVerify: typeof import("jose").jwtVerify;
|
|
11
|
+
jwtDecrypt: typeof import("jose").jwtDecrypt;
|
|
12
|
+
CompactEncrypt: typeof import("jose").CompactEncrypt;
|
|
13
|
+
FlattenedEncrypt: typeof import("jose").FlattenedEncrypt;
|
|
14
|
+
CompactSign: typeof import("jose").CompactSign;
|
|
15
|
+
FlattenedSign: typeof import("jose").FlattenedSign;
|
|
16
|
+
GeneralSign: typeof import("jose").GeneralSign;
|
|
17
|
+
SignJWT: typeof import("jose").SignJWT;
|
|
18
|
+
EncryptJWT: typeof import("jose").EncryptJWT;
|
|
19
|
+
calculateJwkThumbprint: typeof import("jose").calculateJwkThumbprint;
|
|
20
|
+
calculateJwkThumbprintUri: typeof import("jose").calculateJwkThumbprintUri;
|
|
21
|
+
EmbeddedJWK: typeof import("jose").EmbeddedJWK;
|
|
22
|
+
createLocalJWKSet: typeof import("jose").createLocalJWKSet;
|
|
23
|
+
createRemoteJWKSet: typeof import("jose").createRemoteJWKSet;
|
|
24
|
+
jwksCache: typeof import("jose").jwksCache;
|
|
25
|
+
customFetch: typeof import("jose").customFetch;
|
|
26
|
+
UnsecuredJWT: typeof import("jose").UnsecuredJWT;
|
|
27
|
+
exportPKCS8: typeof import("jose").exportPKCS8;
|
|
28
|
+
exportSPKI: typeof import("jose").exportSPKI;
|
|
29
|
+
exportJWK: typeof import("jose").exportJWK;
|
|
30
|
+
importSPKI: typeof import("jose").importSPKI;
|
|
31
|
+
importPKCS8: typeof import("jose").importPKCS8;
|
|
32
|
+
importX509: typeof import("jose").importX509;
|
|
33
|
+
importJWK: typeof import("jose").importJWK;
|
|
34
|
+
decodeProtectedHeader: typeof import("jose").decodeProtectedHeader;
|
|
35
|
+
decodeJwt: typeof import("jose").decodeJwt;
|
|
36
|
+
errors: typeof import("jose/dist/types/util/errors");
|
|
37
|
+
generateKeyPair: typeof import("jose").generateKeyPair;
|
|
38
|
+
generateSecret: typeof import("jose").generateSecret;
|
|
39
|
+
base64url: typeof import("jose/dist/types/util/base64url");
|
|
40
|
+
cryptoRuntime: "WebCryptoAPI";
|
|
41
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
const load = async () => await Promise.resolve().then(() => __importStar(require('jose')));
|
|
26
|
+
exports.load = load;
|
|
27
|
+
//# sourceMappingURL=jose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jose.js","sourceRoot":"","sources":["../../source/lib/jose.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AAEZ,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC,wDAAa,MAAM,GAAC,CAAA;AAE7C,OAAO,CAAC,IAAI,GAAG,IAAI,CAAA"}
|
|
@@ -6,7 +6,8 @@ async function computation({ authority, identity }, context) {
|
|
|
6
6
|
query: {
|
|
7
7
|
criteria: `authority==${authority};identity==${identity}`,
|
|
8
8
|
projection: ['iss'],
|
|
9
|
-
sort: ['_created:desc']
|
|
9
|
+
sort: ['_created:desc'],
|
|
10
|
+
limit: 100
|
|
10
11
|
}
|
|
11
12
|
});
|
|
12
13
|
const legacy = await context.local.observe({ query: { id: identity } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../source/list.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,WAAW,CAAE,EAAE,SAAS,EAAE,QAAQ,EAAS,EAAE,OAAgB;IACjF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;QAC5C,KAAK,EAAE;YACL,QAAQ,EAAE,cAAc,SAAS,cAAc,QAAQ,EAAE;YACzD,UAAU,EAAE,CAAC,KAAK,CAAC;YACnB,IAAI,EAAE,CAAC,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../source/list.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,WAAW,CAAE,EAAE,SAAS,EAAE,QAAQ,EAAS,EAAE,OAAgB;IACjF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;QAC5C,KAAK,EAAE;YACL,QAAQ,EAAE,cAAc,SAAS,cAAc,QAAQ,EAAE;YACzD,UAAU,EAAE,CAAC,KAAK,CAAC;YACnB,IAAI,EAAE,CAAC,eAAe,CAAC;YACvB,KAAK,EAAE,GAAG;SACX;KACF,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;IAEvE,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;QACpF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAEtB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAA;AACxD,CAAC;AAhBD,kCAgBC"}
|