@toa.io/extensions.exposition 1.0.0-alpha.273 → 1.0.0-alpha.276
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 +209 -0
- package/components/identity.basic/manifest.toa.yaml +1 -1
- package/components/identity.basic/operations/authenticate.js +1 -1
- package/components/identity.basic/operations/authenticate.js.map +1 -1
- package/components/identity.basic/operations/transit.js +1 -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 -2
- package/components/identity.basic/source/authenticate.ts +1 -1
- package/components/identity.basic/source/transit.ts +1 -1
- package/components/identity.basic/source/types.ts +2 -2
- package/components/identity.credentials/operations/tsconfig.tsbuildinfo +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/lib/exchange.ts +2 -2
- package/components/identity.federation/source/types/configuration.ts +4 -2
- package/components/identity.keys/operations/tsconfig.tsbuildinfo +1 -1
- 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/operations/decrypt.js +1 -1
- package/components/identity.tokens/operations/decrypt.js.map +1 -1
- package/components/identity.tokens/operations/encrypt.js +1 -1
- 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/decrypt.test.ts +13 -7
- package/components/identity.tokens/source/decrypt.ts +1 -1
- package/components/identity.tokens/source/encrypt.test.ts +9 -4
- package/components/identity.tokens/source/encrypt.ts +1 -1
- package/components/identity.tokens/source/lib/types.ts +3 -2
- package/context.toa.yaml +2 -2
- package/documentation/components.md +1 -1
- package/documentation/protocol.md +24 -0
- package/features/configuration.feature +207 -0
- package/features/identity.federation.feature +15 -7
- package/features/introspection.map.feature +16 -0
- package/features/octets.cloudinary.feature +8 -2
- package/features/octets.download.feature +3 -1
- package/features/probes.feature +8 -4
- package/features/steps/Common.ts +24 -1
- package/features/steps/Components.ts +29 -0
- package/features/steps/Gateway.ts +57 -11
- package/features/steps/Parameters.ts +4 -0
- package/features/steps/Probe.ts +34 -0
- package/package.json +4 -3
- package/readme.md +7 -13
- package/schemas/annotation.cos.yaml +11 -0
- package/source/Annotation.ts +11 -0
- package/source/HTTP/Context.ts +1 -6
- package/source/HTTP/Probe.ts +112 -0
- package/source/HTTP/Server.ts +123 -74
- package/source/HTTP/Timing.ts +1 -1
- package/source/HTTP/formats/yaml.test.ts +6 -0
- package/source/HTTP/formats/yaml.ts +21 -1
- package/source/HTTP/index.ts +2 -0
- package/source/HTTP/messages.test.ts +2 -5
- package/source/HTTP/messages.ts +38 -42
- package/source/HTTP/types.ts +39 -0
- package/source/deployment.ts +12 -4
- package/source/directives/octets/Get.ts +3 -3
- package/transpiled/Annotation.d.ts +10 -0
- package/transpiled/HTTP/Context.d.ts +1 -6
- package/transpiled/HTTP/Context.js.map +1 -1
- package/transpiled/HTTP/Probe.d.ts +36 -0
- package/transpiled/HTTP/Probe.js +117 -0
- package/transpiled/HTTP/Probe.js.map +1 -0
- package/transpiled/HTTP/Server.d.ts +11 -7
- package/transpiled/HTTP/Server.js +92 -58
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/HTTP/Timing.d.ts +1 -2
- package/transpiled/HTTP/formats/yaml.js +15 -1
- package/transpiled/HTTP/formats/yaml.js.map +1 -1
- package/transpiled/HTTP/index.d.ts +2 -0
- package/transpiled/HTTP/index.js +2 -0
- package/transpiled/HTTP/index.js.map +1 -1
- package/transpiled/HTTP/messages.d.ts +8 -3
- package/transpiled/HTTP/messages.js +31 -37
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/HTTP/types.d.ts +40 -0
- package/transpiled/HTTP/types.js +3 -0
- package/transpiled/HTTP/types.js.map +1 -0
- package/transpiled/deployment.js +8 -2
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/directives/octets/Get.js +3 -3
- package/transpiled/directives/octets/Get.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Secret } from '@toa.io/types';
|
|
1
2
|
export interface Configuration {
|
|
2
3
|
trust: Trust[];
|
|
3
4
|
principal?: Principal;
|
|
@@ -6,11 +7,11 @@ export interface Configuration {
|
|
|
6
7
|
export interface Trust {
|
|
7
8
|
iss: string;
|
|
8
9
|
aud?: string | [string, ...string[]];
|
|
9
|
-
secret?:
|
|
10
|
+
secret?: Secret;
|
|
10
11
|
signature?: {
|
|
11
12
|
iss: string;
|
|
12
13
|
kid: string;
|
|
13
|
-
key:
|
|
14
|
+
key: Secret;
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
interface Principal {
|
|
@@ -29,7 +29,7 @@ export async function exchange (credentials: string, ctx: Ctx): Promise<Payload
|
|
|
29
29
|
|
|
30
30
|
// array actually is not expected here, but it is a valid format
|
|
31
31
|
const aud = Array.isArray(trusted.aud) ? trusted.aud[0] : trusted.aud
|
|
32
|
-
const secret = trusted.secret
|
|
32
|
+
const secret = trusted.secret === undefined ? await sign(trusted) : trusted.secret.unwrap()
|
|
33
33
|
const params = new URLSearchParams()
|
|
34
34
|
|
|
35
35
|
params.append('grant_type', 'authorization_code')
|
|
@@ -95,7 +95,7 @@ async function sign (trust: Trust): Promise<string> {
|
|
|
95
95
|
const signature = trust.signature!
|
|
96
96
|
const aud = Array.isArray(trust.aud) ? trust.aud[0] : trust.aud!
|
|
97
97
|
const now = Math.floor(Date.now() / 1000)
|
|
98
|
-
const key = await jose.importPKCS8(signature.key, 'ES256')
|
|
98
|
+
const key = await jose.importPKCS8(signature.key.unwrap(), 'ES256')
|
|
99
99
|
|
|
100
100
|
return await new jose.SignJWT({})
|
|
101
101
|
.setProtectedHeader({ alg: 'ES256', kid: signature.kid })
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Secret } from '@toa.io/types'
|
|
2
|
+
|
|
1
3
|
export interface Configuration {
|
|
2
4
|
trust: Trust[]
|
|
3
5
|
principal?: Principal
|
|
@@ -7,11 +9,11 @@ export interface Configuration {
|
|
|
7
9
|
export interface Trust {
|
|
8
10
|
iss: string
|
|
9
11
|
aud?: string | [string, ...string[]]
|
|
10
|
-
secret?:
|
|
12
|
+
secret?: Secret
|
|
11
13
|
signature?: {
|
|
12
14
|
iss: string
|
|
13
15
|
kid: string
|
|
14
|
-
key:
|
|
16
|
+
key: Secret
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
|