@toa.io/extensions.exposition 1.0.0-alpha.272 → 1.0.0-alpha.274
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 +211 -0
- package/components/exposition.atom/manifest.toa.yaml +3 -1
- package/components/exposition.octets/manifest.toa.yaml +28 -10
- package/components/exposition.octets/operations/put.js +20 -5
- package/components/identity.bans/manifest.toa.yaml +26 -7
- package/components/identity.bans/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/manifest.toa.yaml +106 -30
- package/components/identity.basic/operations/authenticate.js +7 -4
- package/components/identity.basic/operations/authenticate.js.map +1 -1
- package/components/identity.basic/operations/incept.js +3 -2
- package/components/identity.basic/operations/incept.js.map +1 -1
- package/components/identity.basic/operations/transit.js +17 -6
- 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 -2
- package/components/identity.basic/source/authenticate.ts +8 -4
- package/components/identity.basic/source/incept.ts +3 -2
- package/components/identity.basic/source/transit.ts +20 -6
- package/components/identity.basic/source/types.ts +2 -2
- package/components/identity.credentials/manifest.toa.yaml +34 -13
- package/components/identity.credentials/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/manifest.toa.yaml +120 -28
- package/components/identity.federation/operations/authenticate.js +3 -2
- package/components/identity.federation/operations/authenticate.js.map +1 -1
- package/components/identity.federation/operations/create.js +4 -2
- package/components/identity.federation/operations/create.js.map +1 -1
- package/components/identity.federation/operations/lib/errors.d.ts +70 -11
- package/components/identity.federation/operations/lib/errors.js +40 -11
- package/components/identity.federation/operations/lib/errors.js.map +1 -1
- package/components/identity.federation/operations/lib/exchange.js +2 -2
- package/components/identity.federation/operations/lib/exchange.js.map +1 -1
- package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/types/configuration.d.ts +3 -2
- package/components/identity.federation/source/authenticate.ts +3 -2
- package/components/identity.federation/source/create.ts +4 -2
- package/components/identity.federation/source/lib/errors.ts +49 -12
- package/components/identity.federation/source/lib/exchange.ts +2 -2
- package/components/identity.federation/source/types/configuration.ts +4 -2
- package/components/identity.keys/manifest.toa.yaml +14 -6
- package/components/identity.keys/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.otp/manifest.toa.yaml +44 -15
- package/components/identity.otp/operations/authenticate.js +9 -4
- package/components/identity.otp/operations/authenticate.js.map +1 -1
- package/components/identity.otp/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.otp/source/authenticate.ts +11 -4
- package/components/identity.passkeys/manifest.toa.yaml +38 -8
- package/components/identity.passkeys/operations/authenticate.js +3 -2
- package/components/identity.passkeys/operations/authenticate.js.map +1 -1
- package/components/identity.passkeys/operations/create.js +6 -3
- package/components/identity.passkeys/operations/create.js.map +1 -1
- package/components/identity.passkeys/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.passkeys/operations/use.js +6 -3
- package/components/identity.passkeys/operations/use.js.map +1 -1
- package/components/identity.passkeys/source/authenticate.ts +3 -2
- package/components/identity.passkeys/source/create.ts +7 -3
- package/components/identity.passkeys/source/use.ts +7 -3
- package/components/identity.roles/manifest.toa.yaml +41 -10
- package/components/identity.roles/operations/grant.js +3 -2
- package/components/identity.roles/operations/grant.js.map +1 -1
- package/components/identity.roles/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.roles/source/grant.ts +3 -2
- package/components/identity.tokens/manifest.toa.yaml +99 -39
- package/components/identity.tokens/operations/authenticate.js +6 -3
- package/components/identity.tokens/operations/authenticate.js.map +1 -1
- package/components/identity.tokens/operations/decrypt.js +10 -5
- package/components/identity.tokens/operations/decrypt.js.map +1 -1
- package/components/identity.tokens/operations/encrypt.js +4 -3
- package/components/identity.tokens/operations/encrypt.js.map +1 -1
- package/components/identity.tokens/operations/lib/types.d.ts +3 -2
- package/components/identity.tokens/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.tokens/source/authenticate.test.ts +7 -2
- package/components/identity.tokens/source/authenticate.ts +7 -3
- package/components/identity.tokens/source/decrypt.test.ts +13 -7
- package/components/identity.tokens/source/decrypt.ts +12 -5
- package/components/identity.tokens/source/encrypt.test.ts +9 -4
- package/components/identity.tokens/source/encrypt.ts +4 -3
- package/components/identity.tokens/source/lib/types.ts +3 -2
- package/context.toa.yaml +2 -2
- package/documentation/components.md +1 -1
- package/documentation/identity.md +4 -1
- package/features/configuration.feature +207 -0
- package/features/cors.feature +1 -1
- package/features/dev.feature +1 -1
- package/features/identity.federation.feature +18 -9
- package/features/{identtiy.tokens.custom.feature → identity.tokens.custom.feature} +39 -0
- package/features/introspection.map.feature +16 -0
- package/features/map.feature +1 -1
- package/features/octets.download.feature +1 -1
- package/features/octets.meta.feature +1 -1
- package/features/passkeys.feature +8 -8
- package/features/require.feature +2 -2
- package/features/response.feature +3 -3
- package/features/steps/Components.ts +41 -4
- package/features/steps/Gateway.ts +61 -23
- package/features/steps/HTTP.ts +3 -5
- package/features/steps/Parameters.ts +2 -3
- package/features/steps/Realtime.ts +4 -4
- package/features/steps/Workspace.ts +8 -3
- package/features/steps/components/audit/manifest.toa.yaml +12 -5
- package/features/steps/components/echo/manifest.toa.yaml +33 -8
- package/features/steps/components/notify/manifest.toa.yaml +12 -5
- package/features/steps/components/octets.tester/manifest.toa.yaml +43 -14
- package/features/steps/components/orders/manifest.toa.yaml +22 -5
- package/features/steps/components/pots/manifest.toa.yaml +71 -17
- package/features/steps/components/pricing/manifest.toa.yaml +8 -2
- package/features/steps/components/sequences/manifest.toa.yaml +3 -1
- package/features/steps/components/users/manifest.toa.yaml +18 -3
- package/features/steps/components/users.properties/manifest.toa.yaml +12 -2
- package/package.json +5 -6
- package/schemas/annotation.cos.yaml +37 -17
- package/schemas/directive.cos.yaml +7 -3
- package/schemas/io/throttle.cos.yaml +47 -8
- package/schemas/method.cos.yaml +21 -9
- package/schemas/node.cos.yaml +22 -7
- package/schemas/octets/delete.cos.yaml +15 -2
- package/schemas/octets/get.cos.yaml +5 -2
- package/schemas/octets/put.cos.yaml +6 -3
- package/schemas/octets/workflow.cos.yaml +0 -1
- package/schemas/query.cos.yaml +31 -14
- package/schemas/querystring.cos.yaml +19 -9
- package/schemas/range.cos.yaml +10 -2
- package/schemas/route.cos.yaml +6 -2
- package/source/Branch.test.ts +37 -0
- package/source/Branch.ts +37 -0
- package/source/Factory.ts +5 -5
- package/source/Gateway.ts +20 -13
- package/source/HTTP/formats/yaml.test.ts +10 -2
- package/source/HTTP/formats/yaml.ts +21 -1
- package/source/RTD/Tree.ts +4 -1
- package/source/Tenant.ts +3 -3
- package/source/deployment.ts +3 -4
- package/source/directives/map/Headers.ts +8 -1
- package/source/directives/octets/Put.ts +6 -3
- package/source/root.ts +2 -2
- package/transpiled/Branch.d.ts +23 -0
- package/transpiled/Branch.js +16 -0
- package/transpiled/Branch.js.map +1 -1
- package/transpiled/Factory.js +4 -4
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Gateway.js +17 -7
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/formats/yaml.js +15 -1
- package/transpiled/HTTP/formats/yaml.js.map +1 -1
- package/transpiled/RTD/Tree.js +4 -1
- package/transpiled/RTD/Tree.js.map +1 -1
- package/transpiled/Tenant.d.ts +1 -1
- package/transpiled/Tenant.js +1 -1
- package/transpiled/Tenant.js.map +1 -1
- package/transpiled/deployment.js +3 -4
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/directives/map/Headers.js +7 -1
- package/transpiled/directives/map/Headers.js.map +1 -1
- package/transpiled/directives/octets/Put.js.map +1 -1
- package/transpiled/root.js +1 -1
- package/transpiled/root.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
|
@@ -36,40 +36,94 @@ operations:
|
|
|
36
36
|
transit:
|
|
37
37
|
concurrency: retry
|
|
38
38
|
input:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
properties:
|
|
40
|
+
authority:
|
|
41
|
+
type: string
|
|
42
|
+
iss:
|
|
43
|
+
type: string
|
|
44
|
+
sub:
|
|
45
|
+
type: string
|
|
46
|
+
identity:
|
|
47
|
+
type: string
|
|
48
|
+
type: object
|
|
49
|
+
required:
|
|
50
|
+
- authority
|
|
51
|
+
- iss
|
|
52
|
+
- sub
|
|
53
|
+
- identity
|
|
43
54
|
create:
|
|
44
55
|
input:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
properties:
|
|
57
|
+
scheme:
|
|
58
|
+
type: string
|
|
59
|
+
enum:
|
|
60
|
+
- bearer
|
|
61
|
+
- code
|
|
62
|
+
authority:
|
|
63
|
+
type: string
|
|
64
|
+
credentials:
|
|
65
|
+
type: string
|
|
66
|
+
id:
|
|
67
|
+
type: string
|
|
68
|
+
type: object
|
|
69
|
+
required:
|
|
70
|
+
- scheme
|
|
71
|
+
- authority
|
|
72
|
+
- credentials
|
|
73
|
+
- id
|
|
49
74
|
errors:
|
|
50
75
|
- EXISTS
|
|
51
76
|
incept:
|
|
52
77
|
input:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
78
|
+
properties:
|
|
79
|
+
scheme:
|
|
80
|
+
type: string
|
|
81
|
+
enum:
|
|
82
|
+
- bearer
|
|
83
|
+
- code
|
|
84
|
+
authority:
|
|
85
|
+
type: string
|
|
86
|
+
credentials:
|
|
87
|
+
type: string
|
|
88
|
+
id:
|
|
89
|
+
type: string
|
|
90
|
+
type: object
|
|
91
|
+
required:
|
|
92
|
+
- scheme
|
|
93
|
+
- authority
|
|
94
|
+
- credentials
|
|
95
|
+
- id
|
|
57
96
|
output:
|
|
58
|
-
|
|
97
|
+
properties:
|
|
98
|
+
id:
|
|
99
|
+
type: string
|
|
100
|
+
type: object
|
|
59
101
|
errors:
|
|
60
102
|
- EXISTS
|
|
61
103
|
authenticate:
|
|
62
104
|
input:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
105
|
+
properties:
|
|
106
|
+
scheme:
|
|
107
|
+
type: string
|
|
108
|
+
enum:
|
|
109
|
+
- bearer
|
|
110
|
+
- code
|
|
111
|
+
authority:
|
|
112
|
+
type: string
|
|
113
|
+
credentials:
|
|
114
|
+
type: string
|
|
115
|
+
type: object
|
|
116
|
+
required:
|
|
117
|
+
- scheme
|
|
118
|
+
- authority
|
|
119
|
+
- credentials
|
|
66
120
|
output:
|
|
67
121
|
properties:
|
|
68
122
|
identity:
|
|
69
123
|
properties:
|
|
70
124
|
id:
|
|
71
125
|
type: string
|
|
72
|
-
claims:
|
|
126
|
+
claims:
|
|
73
127
|
properties:
|
|
74
128
|
iss:
|
|
75
129
|
type: string
|
|
@@ -81,23 +135,55 @@ operations:
|
|
|
81
135
|
required:
|
|
82
136
|
- iss
|
|
83
137
|
- sub
|
|
138
|
+
type: object
|
|
84
139
|
required:
|
|
85
140
|
- id
|
|
86
141
|
- claims
|
|
142
|
+
type: object
|
|
143
|
+
type: object
|
|
87
144
|
errors:
|
|
88
145
|
- ERR_NOT_FOUND
|
|
89
146
|
decode:
|
|
90
|
-
input:
|
|
91
|
-
|
|
147
|
+
input:
|
|
148
|
+
type: string
|
|
149
|
+
output:
|
|
150
|
+
properties:
|
|
151
|
+
iss:
|
|
152
|
+
type: string
|
|
153
|
+
aud:
|
|
154
|
+
type: string
|
|
155
|
+
sub:
|
|
156
|
+
type: string
|
|
157
|
+
additionalProperties: true
|
|
158
|
+
required:
|
|
159
|
+
- iss
|
|
160
|
+
- sub
|
|
161
|
+
type: object
|
|
92
162
|
list:
|
|
93
163
|
input:
|
|
94
|
-
|
|
95
|
-
|
|
164
|
+
properties:
|
|
165
|
+
authority:
|
|
166
|
+
type: string
|
|
167
|
+
identity:
|
|
168
|
+
type: string
|
|
169
|
+
type: object
|
|
170
|
+
required:
|
|
171
|
+
- authority
|
|
172
|
+
- identity
|
|
96
173
|
delete:
|
|
97
174
|
input:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
175
|
+
properties:
|
|
176
|
+
authority:
|
|
177
|
+
type: string
|
|
178
|
+
identity:
|
|
179
|
+
type: string
|
|
180
|
+
credential:
|
|
181
|
+
type: string
|
|
182
|
+
type: object
|
|
183
|
+
required:
|
|
184
|
+
- authority
|
|
185
|
+
- identity
|
|
186
|
+
- credential
|
|
101
187
|
|
|
102
188
|
configuration:
|
|
103
189
|
schema:
|
|
@@ -119,17 +205,23 @@ configuration:
|
|
|
119
205
|
anyOf:
|
|
120
206
|
- type: string
|
|
121
207
|
- type: array
|
|
122
|
-
items:
|
|
208
|
+
items:
|
|
209
|
+
type: string
|
|
123
210
|
uniqueItems: true
|
|
124
211
|
minItems: 1
|
|
125
212
|
signature:
|
|
126
213
|
properties:
|
|
127
|
-
iss:
|
|
128
|
-
|
|
214
|
+
iss:
|
|
215
|
+
type: string
|
|
216
|
+
kid:
|
|
217
|
+
type: string
|
|
129
218
|
key:
|
|
130
219
|
description: PKCS8 private key in PEM form
|
|
131
220
|
type: string
|
|
132
|
-
required:
|
|
221
|
+
required:
|
|
222
|
+
- iss
|
|
223
|
+
- kid
|
|
224
|
+
- key
|
|
133
225
|
secret:
|
|
134
226
|
description: Client secret for the Identity Provider. Required for Authorization Code Flow.
|
|
135
227
|
type: string
|
|
@@ -1,7 +1,6 @@
|
|
|
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 generic_1 = require("@toa.io/generic");
|
|
6
5
|
const lib_1 = require("./lib");
|
|
7
6
|
async function effect({ scheme, authority, credentials }, context) {
|
|
@@ -25,5 +24,7 @@ async function effect({ scheme, authority, credentials }, context) {
|
|
|
25
24
|
return { identity: { id: credential.identity, claims } };
|
|
26
25
|
}
|
|
27
26
|
exports.effect = effect;
|
|
28
|
-
const ERR_NOT_FOUND = new
|
|
27
|
+
const ERR_NOT_FOUND = new (class NotFoundError extends Error {
|
|
28
|
+
code = 'NOT_FOUND';
|
|
29
|
+
})();
|
|
29
30
|
//# sourceMappingURL=authenticate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../source/authenticate.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../source/authenticate.ts"],"names":[],"mappings":";;;AAAA,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,CAAC,MAAM,aAAc,SAAQ,KAAK;IAC1C,IAAI,GAAG,WAAW,CAAA;CACnC,CAAC,EAAE,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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
6
|
const claims = await (0, lib_1.resolve)(input.scheme, input.credentials, context);
|
|
@@ -23,5 +22,8 @@ async function effect(input, context) {
|
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
24
|
exports.effect = effect;
|
|
26
|
-
const ERR_EXISTS = new
|
|
25
|
+
const ERR_EXISTS = new (class ExistsError extends Error {
|
|
26
|
+
code = 'EXISTS';
|
|
27
|
+
message = 'Federation credentials are associated with another Identity';
|
|
28
|
+
})();
|
|
27
29
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../source/create.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../source/create.ts"],"names":[],"mappings":";;;AAAA,+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,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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
export declare const ERR_TRUST: {
|
|
2
|
+
readonly code: "TRUST";
|
|
3
|
+
readonly message: "Issuer not trusted";
|
|
4
|
+
name: string;
|
|
5
|
+
stack?: string | undefined;
|
|
6
|
+
cause?: unknown;
|
|
7
|
+
};
|
|
8
|
+
export declare const ERR_RESPONSE: {
|
|
9
|
+
readonly code: "RESPONSE";
|
|
10
|
+
readonly message: "Request to IDP failed";
|
|
11
|
+
name: string;
|
|
12
|
+
stack?: string | undefined;
|
|
13
|
+
cause?: unknown;
|
|
14
|
+
};
|
|
15
|
+
export declare const ERR_CONFIG: {
|
|
16
|
+
readonly code: "CONFIG";
|
|
17
|
+
readonly message: "Invalid OpenID configuration";
|
|
18
|
+
name: string;
|
|
19
|
+
stack?: string | undefined;
|
|
20
|
+
cause?: unknown;
|
|
21
|
+
};
|
|
22
|
+
export declare const ERR_NO_TOKEN: {
|
|
23
|
+
readonly code: "NO_TOKEN";
|
|
24
|
+
readonly message: "No ID token received";
|
|
25
|
+
name: string;
|
|
26
|
+
stack?: string | undefined;
|
|
27
|
+
cause?: unknown;
|
|
28
|
+
};
|
|
29
|
+
export declare const ERR_ISS: {
|
|
30
|
+
readonly code: "ISS";
|
|
31
|
+
readonly message: "Invalid issuer claim";
|
|
32
|
+
name: string;
|
|
33
|
+
stack?: string | undefined;
|
|
34
|
+
cause?: unknown;
|
|
35
|
+
};
|
|
36
|
+
export declare const ERR_SUB: {
|
|
37
|
+
readonly code: "SUB";
|
|
38
|
+
readonly message: "Invalid subject claim";
|
|
39
|
+
name: string;
|
|
40
|
+
stack?: string | undefined;
|
|
41
|
+
cause?: unknown;
|
|
42
|
+
};
|
|
43
|
+
export declare const ERR_EXP: {
|
|
44
|
+
readonly code: "EXP";
|
|
45
|
+
readonly message: "Token does not have an expiration time";
|
|
46
|
+
name: string;
|
|
47
|
+
stack?: string | undefined;
|
|
48
|
+
cause?: unknown;
|
|
49
|
+
};
|
|
50
|
+
export declare const ERR_REPLAY: {
|
|
51
|
+
readonly code: "REPLAY";
|
|
52
|
+
readonly message: "Token has already been used";
|
|
53
|
+
name: string;
|
|
54
|
+
stack?: string | undefined;
|
|
55
|
+
cause?: unknown;
|
|
56
|
+
};
|
|
57
|
+
export declare const ERR_CODE_NOT_ENABLED: {
|
|
58
|
+
readonly code: "CODE_NOT_ENABLED";
|
|
59
|
+
readonly message: "Authorization code flow is not configured";
|
|
60
|
+
name: string;
|
|
61
|
+
stack?: string | undefined;
|
|
62
|
+
cause?: unknown;
|
|
63
|
+
};
|
|
64
|
+
export declare const ERR_CODE_SCHEMA: {
|
|
65
|
+
readonly code: "CODE_SCHEMA";
|
|
66
|
+
readonly message: "Invalid code credentials";
|
|
67
|
+
name: string;
|
|
68
|
+
stack?: string | undefined;
|
|
69
|
+
cause?: unknown;
|
|
70
|
+
};
|
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ERR_CODE_SCHEMA = exports.ERR_CODE_NOT_ENABLED = exports.ERR_REPLAY = exports.ERR_EXP = exports.ERR_SUB = exports.ERR_ISS = exports.ERR_NO_TOKEN = exports.ERR_CONFIG = exports.ERR_RESPONSE = exports.ERR_TRUST = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
exports.ERR_TRUST = new (class TrustError extends Error {
|
|
5
|
+
code = 'TRUST';
|
|
6
|
+
message = 'Issuer not trusted';
|
|
7
|
+
})();
|
|
8
|
+
exports.ERR_RESPONSE = new (class ResponseError extends Error {
|
|
9
|
+
code = 'RESPONSE';
|
|
10
|
+
message = 'Request to IDP failed';
|
|
11
|
+
})();
|
|
12
|
+
exports.ERR_CONFIG = new (class ConfigError extends Error {
|
|
13
|
+
code = 'CONFIG';
|
|
14
|
+
message = 'Invalid OpenID configuration';
|
|
15
|
+
})();
|
|
16
|
+
exports.ERR_NO_TOKEN = new (class NoTokenError extends Error {
|
|
17
|
+
code = 'NO_TOKEN';
|
|
18
|
+
message = 'No ID token received';
|
|
19
|
+
})();
|
|
20
|
+
exports.ERR_ISS = new (class IssError extends Error {
|
|
21
|
+
code = 'ISS';
|
|
22
|
+
message = 'Invalid issuer claim';
|
|
23
|
+
})();
|
|
24
|
+
exports.ERR_SUB = new (class SubError extends Error {
|
|
25
|
+
code = 'SUB';
|
|
26
|
+
message = 'Invalid subject claim';
|
|
27
|
+
})();
|
|
28
|
+
exports.ERR_EXP = new (class ExpError extends Error {
|
|
29
|
+
code = 'EXP';
|
|
30
|
+
message = 'Token does not have an expiration time';
|
|
31
|
+
})();
|
|
32
|
+
exports.ERR_REPLAY = new (class ReplayError extends Error {
|
|
33
|
+
code = 'REPLAY';
|
|
34
|
+
message = 'Token has already been used';
|
|
35
|
+
})();
|
|
36
|
+
exports.ERR_CODE_NOT_ENABLED = new (class CodeNotEnabledError extends Error {
|
|
37
|
+
code = 'CODE_NOT_ENABLED';
|
|
38
|
+
message = 'Authorization code flow is not configured';
|
|
39
|
+
})();
|
|
40
|
+
exports.ERR_CODE_SCHEMA = new (class CodeSchemaError extends Error {
|
|
41
|
+
code = 'CODE_SCHEMA';
|
|
42
|
+
message = 'Invalid code credentials';
|
|
43
|
+
})();
|
|
15
44
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../source/lib/errors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../source/lib/errors.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,IAAI,CAAC,MAAM,UAAW,SAAQ,KAAK;IAC1C,IAAI,G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A;CAC/E,CAAC,EAAE,CAAA;AAES,QAAA,eAAe,GAAG,IAAI,CAAC,MAAM,eAAgB,SAAQ,KAAK;IACrD,IAAI,GAAG,aAAa,CAAA;IACX,OAAO,GAAG,0BAA0B,CAAA;CAC9D,CAAC,EAAE,CAAA"}
|
|
@@ -43,7 +43,7 @@ async function exchange(credentials, ctx) {
|
|
|
43
43
|
return errors.ERR_CONFIG;
|
|
44
44
|
// array actually is not expected here, but it is a valid format
|
|
45
45
|
const aud = Array.isArray(trusted.aud) ? trusted.aud[0] : trusted.aud;
|
|
46
|
-
const secret = trusted.secret
|
|
46
|
+
const secret = trusted.secret === undefined ? await sign(trusted) : trusted.secret.unwrap();
|
|
47
47
|
const params = new URLSearchParams();
|
|
48
48
|
params.append('grant_type', 'authorization_code');
|
|
49
49
|
params.append('code', code);
|
|
@@ -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(signature.key, 'ES256');
|
|
97
|
+
const key = await jose.importPKCS8(signature.key.unwrap(), '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,CAAC,WAAW,CAAC,CAAA;IAEtC,IAAI,UAAU,YAAY,KAAK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