@toa.io/extensions.exposition 1.0.0-alpha.256 → 1.0.0-alpha.258
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/CHANGELOG.md +34 -0
- package/components/identity.basic/manifest.toa.yaml +7 -1
- package/components/identity.basic/operations/add.js +2 -1
- package/components/identity.basic/operations/add.js.map +1 -1
- package/components/identity.basic/operations/transit.js +2 -1
- package/components/identity.basic/operations/transit.js.map +1 -1
- package/components/identity.basic/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/operations/types.d.ts +2 -0
- package/components/identity.basic/source/add.ts +2 -1
- package/components/identity.basic/source/transit.ts +2 -1
- package/components/identity.basic/source/types.ts +3 -0
- package/components/identity.federation/events/principal.js +2 -2
- package/components/identity.federation/manifest.toa.yaml +18 -7
- package/components/identity.federation/operations/authenticate.js +13 -15
- package/components/identity.federation/operations/authenticate.js.map +1 -1
- package/components/identity.federation/operations/create.d.ts +8 -0
- package/components/identity.federation/operations/create.js +27 -0
- package/components/identity.federation/operations/create.js.map +1 -0
- package/components/identity.federation/operations/delete.js +1 -1
- package/components/identity.federation/operations/delete.js.map +1 -1
- package/components/identity.federation/operations/incept.d.ts +1 -1
- package/components/identity.federation/operations/incept.js +3 -26
- package/components/identity.federation/operations/incept.js.map +1 -1
- package/components/identity.federation/operations/lib/exchange.js +1 -1
- package/components/identity.federation/operations/lib/exchange.js.map +1 -1
- package/components/identity.federation/operations/lib/index.d.ts +1 -0
- package/components/identity.federation/operations/lib/index.js +3 -1
- package/components/identity.federation/operations/lib/index.js.map +1 -1
- package/components/identity.federation/operations/lib/resolve.d.ts +3 -0
- package/components/identity.federation/operations/lib/resolve.js +17 -0
- package/components/identity.federation/operations/lib/resolve.js.map +1 -0
- package/components/identity.federation/operations/list.js +1 -5
- 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 -5
- package/components/identity.federation/operations/types/entity.d.ts +2 -1
- package/components/identity.federation/source/authenticate.ts +15 -18
- package/components/identity.federation/source/create.ts +39 -0
- package/components/identity.federation/source/delete.ts +1 -1
- package/components/identity.federation/source/incept.ts +5 -37
- package/components/identity.federation/source/lib/exchange.ts +1 -1
- package/components/identity.federation/source/lib/index.ts +1 -0
- package/components/identity.federation/source/lib/resolve.ts +17 -0
- package/components/identity.federation/source/list.test.ts +3 -5
- package/components/identity.federation/source/list.ts +1 -8
- package/components/identity.federation/source/types/context.ts +2 -6
- package/components/identity.federation/source/types/entity.ts +2 -1
- package/components/identity.roles/receivers/identity.federation.principal.js +6 -0
- package/documentation/credentials.md +5 -2
- package/documentation/identity.md +1 -1
- package/features/identity.basic.feature +54 -0
- package/features/identity.federation.feature +100 -2
- package/features/map.feature +2 -1
- package/package.json +3 -3
|
@@ -9,6 +9,7 @@ export async function effect (input: AddInput, context: Context): Promise<Maybe<
|
|
|
9
9
|
password: input.password,
|
|
10
10
|
inception: true
|
|
11
11
|
},
|
|
12
|
-
|
|
12
|
+
// `delete` leaves a tombstone, which the transition revives
|
|
13
|
+
query: { id: input.id, deleted: true }
|
|
13
14
|
})
|
|
14
15
|
}
|
|
@@ -22,7 +22,8 @@ export class Transition implements Operation {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
public async execute (input: TransitInput, object: Entity): Promise<Maybe<IdOutput>> {
|
|
25
|
-
const
|
|
25
|
+
const deleted = object._deleted !== undefined && object._deleted !== null
|
|
26
|
+
const existent = object._version !== 0 && !deleted
|
|
26
27
|
|
|
27
28
|
if (existent) {
|
|
28
29
|
if (input.inception === true)
|
|
@@ -15,8 +15,8 @@ exports.condition = function (event, context) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @param {{ state: import('../source/types').Entity
|
|
18
|
+
* @param {{ state: import('../source/types').Entity }} event
|
|
19
19
|
*/
|
|
20
20
|
exports.payload = function (event) {
|
|
21
|
-
return {
|
|
21
|
+
return { identity: event.state.identity }
|
|
22
22
|
}
|
|
@@ -2,7 +2,6 @@ namespace: identity
|
|
|
2
2
|
name: federation
|
|
3
3
|
|
|
4
4
|
entity:
|
|
5
|
-
associated: true
|
|
6
5
|
schema:
|
|
7
6
|
type: object
|
|
8
7
|
properties:
|
|
@@ -22,9 +21,11 @@ entity:
|
|
|
22
21
|
- authority
|
|
23
22
|
- iss
|
|
24
23
|
- sub
|
|
24
|
+
- identity
|
|
25
25
|
additionalProperties: false
|
|
26
26
|
unique:
|
|
27
27
|
token: [authority, iss, sub]
|
|
28
|
+
identity: [authority, iss, identity]
|
|
28
29
|
index:
|
|
29
30
|
list:
|
|
30
31
|
authority: asc
|
|
@@ -38,13 +39,21 @@ operations:
|
|
|
38
39
|
authority*: string
|
|
39
40
|
iss*: string
|
|
40
41
|
sub*: string
|
|
41
|
-
identity
|
|
42
|
+
identity*: string
|
|
43
|
+
create:
|
|
44
|
+
input:
|
|
45
|
+
scheme*: [bearer, code]
|
|
46
|
+
authority*: string
|
|
47
|
+
credentials*: string
|
|
48
|
+
id*: string
|
|
49
|
+
errors:
|
|
50
|
+
- EXISTS
|
|
42
51
|
incept:
|
|
43
52
|
input:
|
|
44
53
|
scheme*: [bearer, code]
|
|
45
54
|
authority*: string
|
|
46
55
|
credentials*: string
|
|
47
|
-
id
|
|
56
|
+
id*: string
|
|
48
57
|
output:
|
|
49
58
|
id: string
|
|
50
59
|
errors:
|
|
@@ -117,7 +126,9 @@ configuration:
|
|
|
117
126
|
properties:
|
|
118
127
|
iss: { type: string }
|
|
119
128
|
kid: { type: string }
|
|
120
|
-
key:
|
|
129
|
+
key:
|
|
130
|
+
description: PKCS8 private key in PEM form
|
|
131
|
+
type: string
|
|
121
132
|
required: [iss, kid, key]
|
|
122
133
|
secret:
|
|
123
134
|
description: Client secret for the Identity Provider. Required for Authorization Code Flow.
|
|
@@ -152,13 +163,13 @@ exposition:
|
|
|
152
163
|
POST:
|
|
153
164
|
map:authority: authority
|
|
154
165
|
io:input: [scheme, credentials]
|
|
155
|
-
io:output:
|
|
156
|
-
endpoint:
|
|
166
|
+
io:output: &credential [id, iss, _created]
|
|
167
|
+
endpoint: create
|
|
157
168
|
GET:
|
|
158
169
|
map:authority: authority
|
|
159
170
|
map:segments:
|
|
160
171
|
identity: id
|
|
161
|
-
io:output:
|
|
172
|
+
io:output: *credential
|
|
162
173
|
endpoint: list
|
|
163
174
|
/:credential:
|
|
164
175
|
DELETE:
|
|
@@ -2,29 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.effect = void 0;
|
|
4
4
|
const error_value_1 = require("error-value");
|
|
5
|
+
const generic_1 = require("@toa.io/generic");
|
|
5
6
|
const lib_1 = require("./lib");
|
|
6
7
|
async function effect({ scheme, authority, credentials }, context) {
|
|
7
8
|
context.logs.debug('Authenticating', { scheme, authority, credentials });
|
|
8
|
-
const
|
|
9
|
-
trust: context.configuration.trust,
|
|
10
|
-
logs: context.logs,
|
|
11
|
-
fetch: context.fetch
|
|
12
|
-
};
|
|
13
|
-
const claims = scheme === 'bearer'
|
|
14
|
-
? await (0, lib_1.decode)(credentials, ctx)
|
|
15
|
-
: await (0, lib_1.exchange)(credentials, ctx);
|
|
9
|
+
const claims = await (0, lib_1.resolve)(scheme, credentials, context);
|
|
16
10
|
if (claims instanceof Error)
|
|
17
11
|
return claims;
|
|
18
12
|
const { iss, sub } = claims;
|
|
19
13
|
context.logs.debug('Token claims', claims);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
const query = { criteria: `authority==${authority};iss==${iss};sub==${sub}` };
|
|
15
|
+
const credential = context.configuration.assert !== false
|
|
16
|
+
? await context.local.ensure({
|
|
17
|
+
query,
|
|
18
|
+
entity: { authority, iss, sub, identity: (0, generic_1.newid)() }
|
|
19
|
+
})
|
|
20
|
+
: await context.local.observe({ query });
|
|
21
|
+
if (credential === null)
|
|
24
22
|
return ERR_NOT_FOUND;
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
27
|
-
return { identity: { id:
|
|
23
|
+
if (credential instanceof Error)
|
|
24
|
+
return credential;
|
|
25
|
+
return { identity: { id: credential.identity, claims } };
|
|
28
26
|
}
|
|
29
27
|
exports.effect = effect;
|
|
30
28
|
const ERR_NOT_FOUND = new error_value_1.Err('NOT_FOUND');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../source/authenticate.ts"],"names":[],"mappings":";;;AAAA,6CAAiC;AACjC,+
|
|
1
|
+
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../source/authenticate.ts"],"names":[],"mappings":";;;AAAA,6CAAiC;AACjC,6CAAuC;AACvC,+BAA+B;AAKxB,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,MAAM,GAAG,MAAM,IAAA,aAAO,EAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;IAE1D,IAAI,MAAM,YAAY,KAAK;QACzB,OAAO,MAAM,CAAA;IAEf,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;IAE3B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;IAE1C,MAAM,KAAK,GAAG,EAAE,QAAQ,EAAE,cAAc,SAAS,SAAS,GAAG,SAAS,GAAG,EAAE,EAAE,CAAA;IAE7E,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,KAAK,KAAK;QACvD,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;YAC3B,KAAK;YACL,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAA,eAAK,GAAE,EAAE;SACnD,CAAC;QACF,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IAE1C,IAAI,UAAU,KAAK,IAAI;QACrB,OAAO,aAAa,CAAA;IAEtB,IAAI,UAAU,YAAY,KAAK;QAC7B,OAAO,UAAU,CAAA;IAEnB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAA;AAC1D,CAAC;AA5BD,wBA4BC;AAED,MAAM,aAAa,GAAG,IAAI,iBAAG,CAAC,WAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.effect = void 0;
|
|
4
|
+
const error_value_1 = require("error-value");
|
|
5
|
+
const lib_1 = require("./lib");
|
|
6
|
+
async function effect(input, context) {
|
|
7
|
+
const claims = await (0, lib_1.resolve)(input.scheme, input.credentials, context);
|
|
8
|
+
if (claims instanceof Error)
|
|
9
|
+
return claims;
|
|
10
|
+
const { iss, sub } = claims;
|
|
11
|
+
const existent = await context.local.observe({
|
|
12
|
+
query: { criteria: `authority==${input.authority};iss==${iss};sub==${sub}`, deleted: true }
|
|
13
|
+
});
|
|
14
|
+
const record = { authority: input.authority, iss, sub, identity: input.id };
|
|
15
|
+
if (existent === null)
|
|
16
|
+
return await context.local.transit({ input: record });
|
|
17
|
+
if (existent._deleted === undefined || existent._deleted === null)
|
|
18
|
+
return existent.identity === input.id ? existent : ERR_EXISTS;
|
|
19
|
+
// a deleted record still occupies the unique index, so the transition revives it
|
|
20
|
+
return await context.local.transit({
|
|
21
|
+
input: record,
|
|
22
|
+
query: { id: existent.id, deleted: true }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
exports.effect = effect;
|
|
26
|
+
const ERR_EXISTS = new error_value_1.Err('EXISTS', 'Federation credentials are associated with another Identity');
|
|
27
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../source/create.ts"],"names":[],"mappings":";;;AAAA,6CAAiC;AACjC,+BAA+B;AAGxB,KAAK,UAAU,MAAM,CAAE,KAAY,EAAE,OAAgB;IAC1D,MAAM,MAAM,GAAG,MAAM,IAAA,aAAO,EAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;IAEtE,IAAI,MAAM,YAAY,KAAK;QACzB,OAAO,MAAM,CAAA;IAEf,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;IAE3B,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,OAAO,EAAE,IAAI,EAAE;KAC5F,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE,CAAA;IAE3E,IAAI,QAAQ,KAAK,IAAI;QACnB,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;IAEvD,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,KAAK,IAAI;QAC/D,OAAO,QAAQ,CAAC,QAAQ,KAAK,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAA;IAE/D,iFAAiF;IACjF,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;QACjC,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC1C,CAAC,CAAA;AACJ,CAAC;AAzBD,wBAyBC;AASD,MAAM,UAAU,GAAG,IAAI,iBAAG,CAAC,QAAQ,EAAE,6DAA6D,CAAC,CAAA"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.effect = void 0;
|
|
4
4
|
async function effect({ authority, identity, credential }, context) {
|
|
5
5
|
const object = await context.local.observe({ query: { id: credential } });
|
|
6
|
-
if (object === null || object.authority !== authority ||
|
|
6
|
+
if (object === null || object.authority !== authority || object.identity !== identity)
|
|
7
7
|
return null;
|
|
8
8
|
return await context.local.terminate({ query: { id: credential } });
|
|
9
9
|
}
|
|
@@ -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,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,
|
|
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,MAAM,CAAC,QAAQ,KAAK,QAAQ;QACnF,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"}
|
|
@@ -1,33 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.effect = void 0;
|
|
4
|
-
const
|
|
5
|
-
const lib_1 = require("./lib");
|
|
4
|
+
const create_1 = require("./create");
|
|
6
5
|
async function effect(input, context) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
logs: context.logs,
|
|
10
|
-
fetch: context.fetch
|
|
11
|
-
};
|
|
12
|
-
const claims = input.scheme === 'bearer'
|
|
13
|
-
? await (0, lib_1.decode)(input.credentials, ctx)
|
|
14
|
-
: await (0, lib_1.exchange)(input.credentials, ctx);
|
|
15
|
-
if (claims instanceof Error)
|
|
16
|
-
return claims;
|
|
17
|
-
const { iss, sub } = claims;
|
|
18
|
-
if (input.id === undefined) {
|
|
19
|
-
const request = { input: { authority: input.authority, iss, sub } };
|
|
20
|
-
return await context.local.transit(request);
|
|
21
|
-
}
|
|
22
|
-
const existent = await context.local.observe({
|
|
23
|
-
query: { criteria: `authority==${input.authority};iss==${iss};sub==${sub}` }
|
|
24
|
-
});
|
|
25
|
-
if (existent !== null)
|
|
26
|
-
return (existent.identity ?? existent.id) === input.id ? { id: input.id } : ERR_EXISTS;
|
|
27
|
-
return await context.local.transit({
|
|
28
|
-
input: { authority: input.authority, iss, sub, identity: input.id }
|
|
29
|
-
});
|
|
6
|
+
const credential = await (0, create_1.effect)(input, context);
|
|
7
|
+
return credential instanceof Error ? credential : { id: credential.identity };
|
|
30
8
|
}
|
|
31
9
|
exports.effect = effect;
|
|
32
|
-
const ERR_EXISTS = new error_value_1.Err('EXISTS', 'Federation credentials are associated with another Identity');
|
|
33
10
|
//# 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,qCAA2C;AAGpC,KAAK,UAAU,MAAM,CAAE,KAAY,EAAE,OAAgB;IAC1D,MAAM,UAAU,GAAG,MAAM,IAAA,eAAM,EAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAE/C,OAAO,UAAU,YAAY,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAA;AAC/E,CAAC;AAJD,wBAIC"}
|
|
@@ -94,7 +94,7 @@ async function sign(trust) {
|
|
|
94
94
|
const signature = trust.signature;
|
|
95
95
|
const aud = Array.isArray(trust.aud) ? trust.aud[0] : trust.aud;
|
|
96
96
|
const now = Math.floor(Date.now() / 1000);
|
|
97
|
-
const key = await jose.importPKCS8(
|
|
97
|
+
const key = await jose.importPKCS8(signature.key, 'ES256');
|
|
98
98
|
return await new jose.SignJWT({})
|
|
99
99
|
.setProtectedHeader({ alg: 'ES256', kid: signature.kid })
|
|
100
100
|
.setIssuedAt(now)
|
|
@@ -1 +1 @@
|
|
|
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,C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,CAAC,GAAG,CAAC;SAChB,iBAAiB,CAAC,GAAG,GAAG,GAAG,CAAC;SAC5B,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC;SACxB,UAAU,CAAC,GAAG,CAAC;SACf,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC;SACtB,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAED,MAAM,qBAAqB,GAA4B,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exchange = exports.decode = void 0;
|
|
3
|
+
exports.resolve = exports.exchange = exports.decode = void 0;
|
|
4
4
|
var decode_1 = require("./decode");
|
|
5
5
|
Object.defineProperty(exports, "decode", { enumerable: true, get: function () { return decode_1.decode; } });
|
|
6
6
|
var exchange_1 = require("./exchange");
|
|
7
7
|
Object.defineProperty(exports, "exchange", { enumerable: true, get: function () { return exchange_1.exchange; } });
|
|
8
|
+
var resolve_1 = require("./resolve");
|
|
9
|
+
Object.defineProperty(exports, "resolve", { enumerable: true, get: function () { return resolve_1.resolve; } });
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/lib/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/lib/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,qCAAmC;AAA1B,kGAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolve = void 0;
|
|
4
|
+
const decode_1 = require("./decode");
|
|
5
|
+
const exchange_1 = require("./exchange");
|
|
6
|
+
async function resolve(scheme, credentials, context) {
|
|
7
|
+
const ctx = {
|
|
8
|
+
trust: context.configuration.trust,
|
|
9
|
+
logs: context.logs,
|
|
10
|
+
fetch: context.fetch
|
|
11
|
+
};
|
|
12
|
+
return scheme === 'bearer'
|
|
13
|
+
? await (0, decode_1.decode)(credentials, ctx)
|
|
14
|
+
: await (0, exchange_1.exchange)(credentials, ctx);
|
|
15
|
+
}
|
|
16
|
+
exports.resolve = resolve;
|
|
17
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../source/lib/resolve.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AACjC,yCAAqC;AAK9B,KAAK,UAAU,OAAO,CAAE,MAAc,EAAE,WAAmB,EAAE,OAAgB;IAClF,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,OAAO,MAAM,KAAK,QAAQ;QACxB,CAAC,CAAC,MAAM,IAAA,eAAM,EAAC,WAAW,EAAE,GAAG,CAAC;QAChC,CAAC,CAAC,MAAM,IAAA,mBAAQ,EAAC,WAAW,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAVD,0BAUC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.computation = void 0;
|
|
4
4
|
async function computation({ authority, identity }, context) {
|
|
5
|
-
|
|
5
|
+
return await context.local.enumerate({
|
|
6
6
|
query: {
|
|
7
7
|
criteria: `authority==${authority};identity==${identity}`,
|
|
8
8
|
projection: ['iss'],
|
|
@@ -10,10 +10,6 @@ async function computation({ authority, identity }, context) {
|
|
|
10
10
|
limit: 100
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
const legacy = await context.local.observe({ query: { id: identity } });
|
|
14
|
-
if (legacy !== null && legacy.authority === authority && legacy.identity === undefined)
|
|
15
|
-
objects.push(legacy);
|
|
16
|
-
return objects.sort((a, b) => b._created - a._created);
|
|
17
13
|
}
|
|
18
14
|
exports.computation = computation;
|
|
19
15
|
//# sourceMappingURL=list.js.map
|
|
@@ -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,
|
|
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,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;QACnC,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;AACJ,CAAC;AATD,kCASC"}
|