@toa.io/extensions.exposition 1.0.0-alpha.285 → 1.0.0-alpha.286
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/exposition.octets/operations/delete.js +1 -1
- package/components/exposition.octets/operations/get.js +5 -2
- package/components/exposition.octets/operations/head.js +1 -1
- package/components/exposition.octets/operations/put.js +29 -37
- package/components/exposition.octets/types/toa.d.ts +1 -1
- package/components/identity.bans/manifest.toa.yaml +12 -13
- package/components/identity.bans/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.bans/operations/transit.js +1 -1
- package/components/identity.bans/source/transit.ts +1 -1
- package/components/identity.bans/tsconfig.tsbuildinfo +1 -1
- package/components/identity.bans/types/toa.d.ts +5 -5
- package/components/identity.basic/events/principal.js +3 -1
- package/components/identity.basic/manifest.toa.yaml +17 -23
- package/components/identity.basic/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.basic/migrations/0002-indexes.yaml +13 -0
- package/components/identity.basic/operations/add.js +1 -1
- package/components/identity.basic/operations/authenticate.js +2 -2
- package/components/identity.basic/operations/check.js +4 -2
- package/components/identity.basic/operations/delete.js +1 -1
- package/components/identity.basic/operations/incept.js +1 -1
- package/components/identity.basic/operations/info.js +1 -1
- package/components/identity.basic/operations/lib/credentials.js +1 -1
- package/components/identity.basic/operations/transit.js +7 -8
- package/components/identity.basic/source/add.ts +5 -2
- package/components/identity.basic/source/authenticate.ts +11 -13
- package/components/identity.basic/source/check.ts +9 -6
- package/components/identity.basic/source/delete.ts +4 -1
- package/components/identity.basic/source/incept.ts +13 -10
- package/components/identity.basic/source/info.ts +4 -1
- package/components/identity.basic/source/lib/credentials.ts +2 -3
- package/components/identity.basic/source/transit.ts +27 -21
- package/components/identity.basic/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/types/index.d.ts +7 -3
- package/components/identity.basic/types/toa.d.ts +5 -5
- package/components/identity.clients/manifest.toa.yaml +36 -40
- package/components/identity.clients/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.clients/migrations/0002-indexes.yaml +4 -0
- package/components/identity.clients/operations/describe.js +1 -1
- package/components/identity.clients/operations/lib/canonical.js +1 -1
- package/components/identity.clients/operations/lib/cimd.js +3 -2
- package/components/identity.clients/operations/lib/redirect.js +7 -4
- package/components/identity.clients/operations/register.js +2 -2
- package/components/identity.clients/source/describe.ts +6 -8
- package/components/identity.clients/source/lib/Context.ts +6 -3
- package/components/identity.clients/source/lib/Entity.ts +1 -1
- package/components/identity.clients/source/lib/canonical.ts +1 -1
- package/components/identity.clients/source/lib/cimd.test.ts +8 -6
- package/components/identity.clients/source/lib/cimd.ts +24 -19
- package/components/identity.clients/source/lib/redirect.test.ts +8 -2
- package/components/identity.clients/source/lib/redirect.ts +12 -8
- package/components/identity.clients/source/register.ts +18 -18
- package/components/identity.clients/tsconfig.tsbuildinfo +1 -1
- package/components/identity.clients/types/toa.d.ts +5 -5
- package/components/identity.credentials/manifest.toa.yaml +4 -4
- package/components/identity.credentials/operations/list.js +8 -4
- package/components/identity.credentials/source/list.test.ts +39 -20
- package/components/identity.credentials/source/list.ts +12 -8
- package/components/identity.credentials/tsconfig.tsbuildinfo +1 -1
- package/components/identity.credentials/types/toa.d.ts +2 -2
- package/components/identity.federation/manifest.toa.yaml +23 -32
- package/components/identity.federation/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.federation/migrations/0002-indexes.yaml +25 -0
- package/components/identity.federation/operations/authenticate.js +4 -2
- package/components/identity.federation/operations/create.js +2 -2
- package/components/identity.federation/operations/decode.js +1 -1
- package/components/identity.federation/operations/delete.js +1 -1
- package/components/identity.federation/operations/incept.js +1 -1
- package/components/identity.federation/operations/lib/decode.js +1 -1
- package/components/identity.federation/operations/lib/discovery.js +2 -2
- package/components/identity.federation/operations/lib/exchange.js +8 -4
- package/components/identity.federation/operations/lib/principal.js +1 -1
- package/components/identity.federation/operations/lib/resolve.js +1 -1
- package/components/identity.federation/operations/list.js +2 -2
- package/components/identity.federation/source/authenticate.ts +19 -17
- package/components/identity.federation/source/create.ts +6 -7
- package/components/identity.federation/source/decode.ts +4 -1
- package/components/identity.federation/source/delete.ts +4 -1
- package/components/identity.federation/source/incept.ts +2 -3
- package/components/identity.federation/source/lib/decode.ts +4 -7
- package/components/identity.federation/source/lib/discovery.test.ts +15 -5
- package/components/identity.federation/source/lib/discovery.ts +10 -9
- package/components/identity.federation/source/lib/exchange.ts +18 -15
- package/components/identity.federation/source/lib/jose.d.ts +1 -1
- package/components/identity.federation/source/lib/principal.ts +5 -3
- package/components/identity.federation/source/lib/resolve.ts +5 -1
- package/components/identity.federation/source/list.test.ts +26 -10
- package/components/identity.federation/source/list.ts +5 -2
- package/components/identity.federation/source/types/context.ts +5 -2
- package/components/identity.federation/source/types/entity.ts +2 -2
- package/components/identity.federation/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/types/toa.d.ts +5 -5
- package/components/identity.grants/manifest.toa.yaml +27 -31
- package/components/identity.grants/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.grants/migrations/0002-indexes.yaml +5 -0
- package/components/identity.grants/operations/authorize.js +1 -1
- package/components/identity.grants/operations/exchange.js +5 -2
- package/components/identity.grants/operations/lib/code.js +1 -1
- package/components/identity.grants/operations/lib/identify.js +1 -1
- package/components/identity.grants/operations/list.js +1 -1
- package/components/identity.grants/operations/revoke.js +3 -2
- package/components/identity.grants/source/authorize.ts +27 -19
- package/components/identity.grants/source/exchange.ts +15 -11
- package/components/identity.grants/source/lib/code.ts +20 -8
- package/components/identity.grants/source/lib/identify.ts +1 -1
- package/components/identity.grants/source/list.ts +2 -2
- package/components/identity.grants/source/revoke.ts +9 -7
- package/components/identity.grants/tsconfig.tsbuildinfo +1 -1
- package/components/identity.grants/types/index.d.ts +3 -3
- package/components/identity.grants/types/toa.d.ts +5 -5
- package/components/identity.keys/manifest.toa.yaml +18 -23
- package/components/identity.keys/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.keys/migrations/0002-indexes.yaml +4 -0
- package/components/identity.keys/operations/create.js +1 -1
- package/components/identity.keys/operations/disable.js +1 -1
- package/components/identity.keys/operations/revoke.js +1 -1
- package/components/identity.keys/source/create.ts +2 -3
- package/components/identity.keys/source/disable.ts +1 -1
- package/components/identity.keys/source/revoke.ts +2 -2
- package/components/identity.keys/tsconfig.tsbuildinfo +1 -1
- package/components/identity.keys/types/toa.d.ts +5 -5
- package/components/identity.otp/manifest.toa.yaml +16 -24
- package/components/identity.otp/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.otp/migrations/0002-indexes.yaml +5 -0
- package/components/identity.otp/operations/authenticate.js +1 -1
- package/components/identity.otp/operations/issue.js +1 -1
- package/components/identity.otp/source/authenticate.ts +4 -7
- package/components/identity.otp/source/issue.ts +1 -1
- package/components/identity.otp/source/lib/Context.ts +1 -1
- package/components/identity.otp/tsconfig.tsbuildinfo +1 -1
- package/components/identity.otp/types/toa.d.ts +5 -5
- package/components/identity.passkeys/manifest.toa.yaml +45 -53
- package/components/identity.passkeys/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.passkeys/migrations/0002-indexes.yaml +11 -0
- package/components/identity.passkeys/operations/authenticate.js +1 -1
- package/components/identity.passkeys/operations/challenge.js +6 -3
- package/components/identity.passkeys/operations/create.js +1 -1
- package/components/identity.passkeys/operations/delete.js +1 -1
- package/components/identity.passkeys/operations/list.js +1 -1
- package/components/identity.passkeys/operations/use.js +1 -1
- package/components/identity.passkeys/source/authenticate.ts +3 -4
- package/components/identity.passkeys/source/challenge.ts +29 -25
- package/components/identity.passkeys/source/create.ts +8 -6
- package/components/identity.passkeys/source/delete.ts +4 -1
- package/components/identity.passkeys/source/list.ts +4 -1
- package/components/identity.passkeys/source/types/Context.ts +1 -1
- package/components/identity.passkeys/source/use.ts +12 -10
- package/components/identity.passkeys/tsconfig.tsbuildinfo +1 -1
- package/components/identity.passkeys/types/toa.d.ts +5 -5
- package/components/identity.roles/manifest.toa.yaml +12 -16
- package/components/identity.roles/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.roles/migrations/0002-indexes.yaml +8 -0
- package/components/identity.roles/operations/grant.js +1 -1
- package/components/identity.roles/operations/list.js +1 -1
- package/components/identity.roles/operations/principal.js +2 -2
- package/components/identity.roles/source/grant.ts +7 -6
- package/components/identity.roles/source/list.ts +1 -1
- package/components/identity.roles/source/principal.ts +5 -7
- package/components/identity.roles/tsconfig.tsbuildinfo +1 -1
- package/components/identity.roles/types/toa.d.ts +5 -5
- package/components/identity.tokens/manifest.toa.yaml +17 -15
- package/components/identity.tokens/migrations/0001-system-properties.yaml +14 -0
- package/components/identity.tokens/operations/authenticate.js +2 -2
- package/components/identity.tokens/operations/decrypt.js +11 -5
- package/components/identity.tokens/operations/encrypt.js +2 -2
- package/components/identity.tokens/operations/issue.js +2 -4
- package/components/identity.tokens/operations/lib/form.js +1 -1
- package/components/identity.tokens/operations/lib/key.js +1 -1
- package/components/identity.tokens/operations/revoke.js +1 -1
- package/components/identity.tokens/source/authenticate.test.ts +22 -16
- package/components/identity.tokens/source/authenticate.ts +7 -10
- package/components/identity.tokens/source/decrypt.test.ts +62 -29
- package/components/identity.tokens/source/decrypt.ts +30 -27
- package/components/identity.tokens/source/encrypt.test.ts +21 -16
- package/components/identity.tokens/source/encrypt.ts +8 -11
- package/components/identity.tokens/source/issue.test.ts +4 -2
- package/components/identity.tokens/source/issue.ts +6 -8
- package/components/identity.tokens/source/lib/form.ts +5 -9
- package/components/identity.tokens/source/lib/jose.d.ts +1 -1
- package/components/identity.tokens/source/lib/key.ts +1 -1
- package/components/identity.tokens/source/lib/paseto.test.ts +17 -6
- package/components/identity.tokens/source/revoke.ts +1 -1
- package/components/identity.tokens/tsconfig.tsbuildinfo +1 -1
- package/components/identity.tokens/types/index.d.ts +13 -4
- package/components/identity.tokens/types/toa.d.ts +5 -5
- package/context.toa.yaml +2 -2
- package/cucumber.mjs +3 -0
- package/documentation/access.md +4 -3
- package/documentation/cache.md +17 -3
- package/documentation/components.md +2 -2
- package/documentation/credentials.md +2 -2
- package/documentation/identity.md +7 -9
- package/documentation/map.md +2 -2
- package/documentation/mcp.md +16 -16
- package/documentation/notes/peers.md +1 -1
- package/documentation/notes/throttling.md +1 -1
- package/documentation/octets.md +4 -4
- package/documentation/protocol.md +3 -3
- package/documentation/query.md +14 -8
- package/documentation/rpc.md +31 -21
- package/documentation/tracing.md +3 -3
- package/documentation/tree.md +1 -1
- package/features/auth.assert.feature +2 -2
- package/features/auth.bearer.feature +1 -1
- package/features/auth.claims.feature +5 -5
- package/features/auth.incept.feature +2 -2
- package/features/authorities.federation.feature +1 -1
- package/features/configuration.feature +3 -4
- package/features/credentials.feature +9 -9
- package/features/dev.feature +1 -0
- package/features/dynamic.feature +1 -0
- package/features/errors.feature +21 -0
- package/features/etag.feature +0 -86
- package/features/identity.bans.feature +3 -3
- package/features/identity.basic.feature +9 -9
- package/features/identity.federation.feature +11 -11
- package/features/identity.tokens.custom.feature +5 -5
- package/features/identity.tokens.feature +2 -2
- package/features/interruptions.feature +1 -0
- package/features/introspection.map.feature +4 -4
- package/features/io.throttle.feature +1 -0
- package/features/map.feature +2 -2
- package/features/octets.cloudinary.feature +1 -1
- package/features/octets.download.feature +1 -0
- package/features/require.feature +1 -2
- package/features/steps/Captures.ts +1 -1
- package/features/steps/Cloudinary.ts +1 -2
- package/features/steps/Common.ts +4 -5
- package/features/steps/Components.ts +17 -12
- package/features/steps/Database.ts +42 -23
- package/features/steps/Gateway.ts +55 -72
- package/features/steps/HTTP.ts +12 -15
- package/features/steps/IDP.ts +118 -94
- package/features/steps/Identity.ts +3 -3
- package/features/steps/OTP.ts +3 -3
- package/features/steps/Parameters.ts +20 -10
- package/features/steps/Probe.ts +9 -7
- package/features/steps/Realtime.ts +40 -22
- package/features/steps/Workspace.ts +10 -7
- package/features/steps/components/audit/operations/record.js +1 -1
- package/features/steps/components/echo/operations/affect.js +1 -1
- package/features/steps/components/echo/operations/compute.js +1 -1
- package/features/steps/components/echo/operations/echo.js +1 -1
- package/features/steps/components/echo/operations/error.js +1 -1
- package/features/steps/components/echo/operations/identity.js +1 -1
- package/features/steps/components/echo/operations/parameters.js +1 -1
- package/features/steps/components/echo/operations/ping.js +1 -1
- package/features/steps/components/echo/operations/unwrap.js +1 -1
- package/features/steps/components/greeter/operations/greet.js +1 -1
- package/features/steps/components/notify/operations/send.js +1 -1
- package/features/steps/components/octets.tester/operations/authority.js +1 -1
- package/features/steps/components/octets.tester/operations/bar.js +1 -1
- package/features/steps/components/octets.tester/operations/baz.js +1 -1
- package/features/steps/components/octets.tester/operations/concat.js +1 -1
- package/features/steps/components/octets.tester/operations/echo.js +1 -1
- package/features/steps/components/octets.tester/operations/err.js +1 -1
- package/features/steps/components/octets.tester/operations/foo.js +1 -1
- package/features/steps/components/octets.tester/operations/id.js +1 -1
- package/features/steps/components/octets.tester/operations/identity.js +1 -1
- package/features/steps/components/octets.tester/operations/redirect.js +6 -4
- package/features/steps/components/octets.tester/operations/yex.js +1 -1
- package/features/steps/components/octets.tester/operations/yield.js +1 -1
- package/features/steps/components/orders/manifest.toa.yaml +10 -12
- package/features/steps/components/orders/operations/create.js +4 -2
- package/features/steps/components/pots/manifest.toa.yaml +15 -20
- package/features/steps/components/pots/migrations/0002-indexes.yaml +4 -0
- package/features/steps/components/pricing/operations/quote.js +1 -1
- package/features/steps/components/sequences/manifest.toa.yaml +0 -1
- package/features/steps/components/sequences/operations/numbers.js +1 -1
- package/features/steps/components/sequences/operations/tokens.js +3 -3
- package/features/steps/components/users/manifest.toa.yaml +3 -5
- package/features/steps/components/users/operations/create.js +1 -1
- package/features/steps/components/users.properties/manifest.toa.yaml +5 -6
- package/features/steps/map.ts +2 -2
- package/features/timestamps.feature +1 -1
- package/package.json +7 -7
- package/readme.md +11 -11
- package/schemas/annotation.cos.yaml +1 -3
- package/schemas/method.cos.yaml +2 -0
- package/source/Branch.test.ts +2 -2
- package/source/Branch.ts +3 -5
- package/source/Composition.ts +5 -5
- package/source/Directive.test.ts +38 -20
- package/source/Directive.ts +61 -47
- package/source/Endpoint.test.ts +1 -1
- package/source/Endpoint.ts +27 -92
- package/source/Factory.ts +26 -12
- package/source/Gateway.ts +87 -76
- package/source/HTTP/Context.ts +23 -30
- package/source/HTTP/Probe.ts +7 -9
- package/source/HTTP/Server.ts +88 -69
- package/source/HTTP/Timing.ts +6 -21
- package/source/HTTP/address.test.ts +8 -2
- package/source/HTTP/address.ts +2 -3
- package/source/HTTP/exceptions.ts +20 -18
- package/source/HTTP/formats/form.ts +1 -1
- package/source/HTTP/formats/json.ts +2 -2
- package/source/HTTP/formats/msgpack.ts +3 -4
- package/source/HTTP/formats/text.ts +2 -2
- package/source/HTTP/formats/yaml.test.ts +4 -1
- package/source/HTTP/formats/yaml.ts +14 -11
- package/source/HTTP/messages.test.ts +38 -28
- package/source/HTTP/messages.ts +44 -98
- package/source/Interception.ts +3 -4
- package/source/Introspection.ts +26 -14
- package/source/MCP/Server.ts +114 -54
- package/source/MCP/discover.ts +6 -7
- package/source/MCP/errors.ts +7 -8
- package/source/MCP/schema.test.ts +9 -3
- package/source/MCP/schema.ts +12 -16
- package/source/MCP/tools.ts +33 -28
- package/source/Mapping.ts +25 -27
- package/source/Query.ts +58 -44
- package/source/RPC/Context.ts +8 -11
- package/source/RPC/Dispatcher.ts +46 -26
- package/source/RPC/errors.test.ts +41 -16
- package/source/RPC/errors.ts +9 -10
- package/source/RPC/names.test.ts +35 -16
- package/source/RPC/names.ts +22 -29
- package/source/RTD/Directives.ts +21 -10
- package/source/RTD/Endpoint.ts +4 -1
- package/source/RTD/Method.ts +8 -6
- package/source/RTD/Node.ts +32 -34
- package/source/RTD/Route.ts +18 -21
- package/source/RTD/Tree.ts +18 -18
- package/source/RTD/factory.ts +13 -16
- package/source/RTD/segment.ts +12 -10
- package/source/RTD/syntax/parse.test.ts +12 -6
- package/source/RTD/syntax/parse.ts +30 -26
- package/source/RTD/syntax/types.ts +17 -1
- package/source/RTD/walk.test.ts +59 -22
- package/source/Remotes.test.ts +25 -4
- package/source/Remotes.ts +9 -4
- package/source/Tenant.ts +12 -12
- package/source/deployment.ts +20 -20
- package/source/directives/auth/Anonymous.test.ts +8 -2
- package/source/directives/auth/Anonymous.ts +5 -8
- package/source/directives/auth/Anyone.ts +3 -3
- package/source/directives/auth/Assert.ts +10 -10
- package/source/directives/auth/Authorization.ts +83 -69
- package/source/directives/auth/Delegate.test.ts +2 -2
- package/source/directives/auth/Delegate.ts +8 -10
- package/source/directives/auth/Echo.ts +5 -8
- package/source/directives/auth/Federation.ts +30 -21
- package/source/directives/auth/Id.ts +7 -4
- package/source/directives/auth/Incept.ts +32 -26
- package/source/directives/auth/Input.ts +36 -20
- package/source/directives/auth/Role.test.ts +49 -23
- package/source/directives/auth/Role.ts +29 -22
- package/source/directives/auth/Rule.ts +13 -8
- package/source/directives/auth/Scheme.ts +7 -7
- package/source/directives/auth/create.ts +1 -1
- package/source/directives/auth/schemes.ts +1 -1
- package/source/directives/auth/split.ts +2 -3
- package/source/directives/auth/types.ts +5 -2
- package/source/directives/cache/Cache.ts +44 -9
- package/source/directives/cache/Control.ts +25 -26
- package/source/directives/cache/Exact.ts +1 -1
- package/source/directives/cache/etag.ts +38 -0
- package/source/directives/cors/CORS.ts +9 -7
- package/source/directives/dev/Development.ts +3 -4
- package/source/directives/dev/Faulty.ts +11 -6
- package/source/directives/dev/Sleep.ts +5 -7
- package/source/directives/dev/Stub.ts +2 -2
- package/source/directives/dev/Throw.ts +2 -2
- package/source/directives/flow/Compose.ts +26 -20
- package/source/directives/flow/Fetch.ts +15 -15
- package/source/directives/flow/Flow.ts +9 -8
- package/source/directives/index.ts +11 -2
- package/source/directives/io/IO.ts +29 -20
- package/source/directives/io/Input.ts +9 -12
- package/source/directives/io/Output.ts +20 -23
- package/source/directives/io/Status.test.ts +12 -8
- package/source/directives/io/Status.ts +9 -8
- package/source/directives/io/Throttle.ts +6 -7
- package/source/directives/io/lib/throttle/Configuration.test.ts +32 -23
- package/source/directives/io/lib/throttle/Configuration.ts +14 -9
- package/source/directives/io/lib/throttle/Keys.ts +15 -10
- package/source/directives/io/lib/throttle/Quotas.test.ts +33 -17
- package/source/directives/io/lib/throttle/Quotas.ts +20 -26
- package/source/directives/io/lib/throttle/Sync.test.ts +14 -10
- package/source/directives/io/lib/throttle/Sync.ts +9 -12
- package/source/directives/io/lib/throttle/Warning.ts +3 -4
- package/source/directives/io/lib/throttle/components/IP.ts +4 -5
- package/source/directives/io/lib/throttle/components/Identity.ts +1 -1
- package/source/directives/io/lib/throttle/components/Path.ts +1 -1
- package/source/directives/io/lib/throttle/components/Route.ts +2 -2
- package/source/directives/io/lib/throttle/components/Segment.ts +2 -2
- package/source/directives/io/lib/throttle/conditions/Status.ts +2 -2
- package/source/directives/io/schemas.test.ts +12 -6
- package/source/directives/map/Authority.ts +2 -2
- package/source/directives/map/Buffer.ts +2 -2
- package/source/directives/map/Claims.ts +25 -20
- package/source/directives/map/Headers.ts +17 -13
- package/source/directives/map/Language.ts +8 -5
- package/source/directives/map/Languages.ts +9 -3
- package/source/directives/map/Map.ts +25 -12
- package/source/directives/map/Mapping.ts +9 -6
- package/source/directives/map/Properties.ts +1 -1
- package/source/directives/map/Segments.ts +22 -15
- package/source/directives/mcp/MCP.ts +9 -7
- package/source/directives/mcp/Tool.test.ts +21 -9
- package/source/directives/mcp/Tool.ts +23 -11
- package/source/directives/oauth/Discovery.ts +7 -11
- package/source/directives/oauth/documents.ts +11 -14
- package/source/directives/octets/Context.ts +6 -3
- package/source/directives/octets/Delete.ts +33 -25
- package/source/directives/octets/Directive.ts +5 -1
- package/source/directives/octets/Get.ts +13 -21
- package/source/directives/octets/Octets.ts +20 -15
- package/source/directives/octets/Put.ts +62 -27
- package/source/directives/octets/Workflow.ts +18 -12
- package/source/directives/octets/bytes.ts +1 -1
- package/source/directives/octets/schemas.test.ts +8 -14
- package/source/directives/octets/workflows/Execution.ts +19 -21
- package/source/directives/octets/workflows/Workflow.ts +10 -7
- package/source/directives/require/Headers.ts +3 -4
- package/source/directives/require/Require.ts +3 -4
- package/source/exceptions.ts +19 -12
- package/source/index.ts +1 -1
- package/source/manifest.test.ts +4 -1
- package/source/manifest.ts +19 -13
- package/source/octets.d.ts +1 -1
- package/source/root.ts +3 -2
- package/source/schemas.test.ts +17 -3
- package/transpiled/Branch.js.map +1 -1
- package/transpiled/Composition.js.map +1 -1
- package/transpiled/Directive.js +6 -2
- package/transpiled/Directive.js.map +1 -1
- package/transpiled/Endpoint.d.ts +0 -2
- package/transpiled/Endpoint.js +11 -52
- package/transpiled/Endpoint.js.map +1 -1
- package/transpiled/Factory.d.ts +2 -1
- package/transpiled/Factory.js +1 -0
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Gateway.d.ts +2 -1
- package/transpiled/Gateway.js +24 -15
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/Context.d.ts +0 -3
- package/transpiled/HTTP/Context.js +7 -9
- package/transpiled/HTTP/Context.js.map +1 -1
- package/transpiled/HTTP/Probe.js.map +1 -1
- package/transpiled/HTTP/Server.js +19 -4
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/HTTP/Timing.d.ts +1 -2
- package/transpiled/HTTP/Timing.js +2 -10
- package/transpiled/HTTP/Timing.js.map +1 -1
- package/transpiled/HTTP/address.js.map +1 -1
- package/transpiled/HTTP/exceptions.js.map +1 -1
- package/transpiled/HTTP/formats/form.js.map +1 -1
- package/transpiled/HTTP/formats/json.js.map +1 -1
- package/transpiled/HTTP/formats/msgpack.js.map +1 -1
- package/transpiled/HTTP/formats/text.js.map +1 -1
- package/transpiled/HTTP/formats/yaml.js +4 -1
- package/transpiled/HTTP/formats/yaml.js.map +1 -1
- package/transpiled/HTTP/messages.d.ts +3 -2
- package/transpiled/HTTP/messages.js +1 -43
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/Interception.js.map +1 -1
- package/transpiled/Introspection.js +13 -2
- package/transpiled/Introspection.js.map +1 -1
- package/transpiled/MCP/Server.js +15 -4
- package/transpiled/MCP/Server.js.map +1 -1
- package/transpiled/MCP/discover.js.map +1 -1
- package/transpiled/MCP/errors.js.map +1 -1
- package/transpiled/MCP/schema.js +1 -1
- package/transpiled/MCP/schema.js.map +1 -1
- package/transpiled/MCP/tools.js +10 -7
- package/transpiled/MCP/tools.js.map +1 -1
- package/transpiled/Mapping.d.ts +2 -2
- package/transpiled/Mapping.js +3 -5
- package/transpiled/Mapping.js.map +1 -1
- package/transpiled/Query.d.ts +6 -2
- package/transpiled/Query.js +23 -8
- package/transpiled/Query.js.map +1 -1
- package/transpiled/RPC/Context.js +0 -7
- package/transpiled/RPC/Context.js.map +1 -1
- package/transpiled/RPC/Dispatcher.js +4 -1
- package/transpiled/RPC/Dispatcher.js.map +1 -1
- package/transpiled/RPC/errors.js.map +1 -1
- package/transpiled/RPC/names.js.map +1 -1
- package/transpiled/RTD/Directives.d.ts +1 -1
- package/transpiled/RTD/Method.js +1 -3
- package/transpiled/RTD/Method.js.map +1 -1
- package/transpiled/RTD/Node.js +5 -4
- package/transpiled/RTD/Node.js.map +1 -1
- package/transpiled/RTD/Route.js +4 -1
- package/transpiled/RTD/Route.js.map +1 -1
- package/transpiled/RTD/Tree.js +1 -1
- package/transpiled/RTD/Tree.js.map +1 -1
- package/transpiled/RTD/factory.js.map +1 -1
- package/transpiled/RTD/segment.js.map +1 -1
- package/transpiled/RTD/syntax/parse.js.map +1 -1
- package/transpiled/RTD/syntax/types.d.ts +6 -0
- package/transpiled/RTD/syntax/types.js +10 -1
- package/transpiled/RTD/syntax/types.js.map +1 -1
- package/transpiled/Remotes.js.map +1 -1
- package/transpiled/Tenant.d.ts +1 -1
- package/transpiled/Tenant.js.map +1 -1
- package/transpiled/deployment.d.ts +3 -0
- package/transpiled/deployment.js +6 -1
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/directives/auth/Anonymous.js +1 -3
- package/transpiled/directives/auth/Anonymous.js.map +1 -1
- package/transpiled/directives/auth/Anyone.js.map +1 -1
- package/transpiled/directives/auth/Assert.js.map +1 -1
- package/transpiled/directives/auth/Authorization.js +7 -3
- package/transpiled/directives/auth/Authorization.js.map +1 -1
- package/transpiled/directives/auth/Delegate.js.map +1 -1
- package/transpiled/directives/auth/Echo.js +1 -3
- package/transpiled/directives/auth/Echo.js.map +1 -1
- package/transpiled/directives/auth/Federation.js +3 -7
- package/transpiled/directives/auth/Federation.js.map +1 -1
- package/transpiled/directives/auth/Id.js.map +1 -1
- package/transpiled/directives/auth/Incept.js +1 -1
- package/transpiled/directives/auth/Incept.js.map +1 -1
- package/transpiled/directives/auth/Input.js.map +1 -1
- package/transpiled/directives/auth/Role.js.map +1 -1
- package/transpiled/directives/auth/Rule.js.map +1 -1
- package/transpiled/directives/auth/Scheme.js +1 -2
- package/transpiled/directives/auth/Scheme.js.map +1 -1
- package/transpiled/directives/auth/create.js.map +1 -1
- package/transpiled/directives/auth/schemes.js.map +1 -1
- package/transpiled/directives/auth/split.js.map +1 -1
- package/transpiled/directives/auth/types.d.ts +3 -1
- package/transpiled/directives/cache/Cache.js +28 -2
- package/transpiled/directives/cache/Cache.js.map +1 -1
- package/transpiled/directives/cache/Control.js +1 -1
- package/transpiled/directives/cache/Control.js.map +1 -1
- package/transpiled/directives/cache/etag.d.ts +10 -0
- package/transpiled/directives/cache/etag.js +30 -0
- package/transpiled/directives/cache/etag.js.map +1 -0
- package/transpiled/directives/cors/CORS.js.map +1 -1
- package/transpiled/directives/dev/Development.js.map +1 -1
- package/transpiled/directives/dev/Faulty.js.map +1 -1
- package/transpiled/directives/dev/Sleep.js.map +1 -1
- package/transpiled/directives/dev/Stub.js.map +1 -1
- package/transpiled/directives/dev/Throw.js.map +1 -1
- package/transpiled/directives/flow/Compose.js +7 -3
- package/transpiled/directives/flow/Compose.js.map +1 -1
- package/transpiled/directives/flow/Fetch.js.map +1 -1
- package/transpiled/directives/flow/Flow.js.map +1 -1
- package/transpiled/directives/index.js +11 -1
- package/transpiled/directives/index.js.map +1 -1
- package/transpiled/directives/io/IO.d.ts +1 -1
- package/transpiled/directives/io/IO.js.map +1 -1
- package/transpiled/directives/io/Input.js +1 -1
- package/transpiled/directives/io/Input.js.map +1 -1
- package/transpiled/directives/io/Output.js +3 -3
- package/transpiled/directives/io/Output.js.map +1 -1
- package/transpiled/directives/io/Status.js.map +1 -1
- package/transpiled/directives/io/Throttle.js +1 -1
- package/transpiled/directives/io/Throttle.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/Configuration.js +8 -2
- package/transpiled/directives/io/lib/throttle/Configuration.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/Keys.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/Quotas.js +4 -3
- package/transpiled/directives/io/lib/throttle/Quotas.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/Sync.d.ts +1 -1
- package/transpiled/directives/io/lib/throttle/Sync.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/Warning.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/components/IP.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/components/Identity.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/components/Path.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/components/Route.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/components/Segment.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/conditions/Status.js.map +1 -1
- package/transpiled/directives/map/Authority.js.map +1 -1
- package/transpiled/directives/map/Buffer.js.map +1 -1
- package/transpiled/directives/map/Claims.js.map +1 -1
- package/transpiled/directives/map/Headers.js.map +1 -1
- package/transpiled/directives/map/Language.js.map +1 -1
- package/transpiled/directives/map/Languages.js.map +1 -1
- package/transpiled/directives/map/Map.js.map +1 -1
- package/transpiled/directives/map/Mapping.js.map +1 -1
- package/transpiled/directives/map/Properties.js.map +1 -1
- package/transpiled/directives/map/Segments.js.map +1 -1
- package/transpiled/directives/mcp/MCP.js +1 -1
- package/transpiled/directives/mcp/MCP.js.map +1 -1
- package/transpiled/directives/mcp/Tool.js +3 -1
- package/transpiled/directives/mcp/Tool.js.map +1 -1
- package/transpiled/directives/oauth/Discovery.js.map +1 -1
- package/transpiled/directives/oauth/documents.js.map +1 -1
- package/transpiled/directives/octets/Context.js +1 -1
- package/transpiled/directives/octets/Context.js.map +1 -1
- package/transpiled/directives/octets/Delete.js.map +1 -1
- package/transpiled/directives/octets/Directive.js.map +1 -1
- package/transpiled/directives/octets/Get.js.map +1 -1
- package/transpiled/directives/octets/Octets.js +1 -1
- package/transpiled/directives/octets/Octets.js.map +1 -1
- package/transpiled/directives/octets/Put.js.map +1 -1
- package/transpiled/directives/octets/Workflow.js.map +1 -1
- package/transpiled/directives/octets/bytes.js.map +1 -1
- package/transpiled/directives/octets/workflows/Execution.js +1 -2
- package/transpiled/directives/octets/workflows/Execution.js.map +1 -1
- package/transpiled/directives/octets/workflows/Workflow.js.map +1 -1
- package/transpiled/directives/require/Headers.js.map +1 -1
- package/transpiled/directives/require/Require.js.map +1 -1
- package/transpiled/exceptions.js.map +1 -1
- package/transpiled/index.d.ts +1 -1
- package/transpiled/index.js +1 -1
- package/transpiled/index.js.map +1 -1
- package/transpiled/manifest.js +5 -1
- package/transpiled/manifest.js.map +1 -1
- package/transpiled/root.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +0 -552
- package/source/redact.test.ts +0 -27
- package/source/redact.ts +0 -21
- package/transpiled/redact.d.ts +0 -5
- package/transpiled/redact.js +0 -17
- package/transpiled/redact.js.map +0 -1
|
@@ -68,7 +68,9 @@ export class Computation {
|
|
|
68
68
|
try {
|
|
69
69
|
const { decodeProtectedHeader } = await load();
|
|
70
70
|
const header = decodeProtectedHeader(token);
|
|
71
|
-
if (header.alg !== 'dir' ||
|
|
71
|
+
if (header.alg !== 'dir' ||
|
|
72
|
+
header.enc !== 'A256GCM' ||
|
|
73
|
+
header.typ !== 'JWT' ||
|
|
72
74
|
typeof header.kid !== 'string')
|
|
73
75
|
return ERR_INVALID_TOKEN;
|
|
74
76
|
return header.kid;
|
|
@@ -107,15 +109,19 @@ async function decryptJWE(token, key) {
|
|
|
107
109
|
keyManagementAlgorithms: ['dir'],
|
|
108
110
|
contentEncryptionAlgorithms: ['A256GCM']
|
|
109
111
|
});
|
|
110
|
-
if (typeof payload.iss !== 'string' ||
|
|
111
|
-
typeof payload.
|
|
112
|
+
if (typeof payload.iss !== 'string' ||
|
|
113
|
+
typeof payload.iat !== 'number' ||
|
|
114
|
+
typeof payload.identity !== 'object' ||
|
|
115
|
+
payload.identity === null)
|
|
112
116
|
return ERR_INVALID_TOKEN;
|
|
113
117
|
if (payload.exp !== undefined && payload.exp * 1000 <= Date.now())
|
|
114
118
|
return ERR_INVALID_TOKEN;
|
|
115
119
|
return {
|
|
116
120
|
iss: payload.iss,
|
|
117
121
|
iat: new Date(payload.iat * 1000).toISOString(),
|
|
118
|
-
...(payload.exp === undefined
|
|
122
|
+
...(payload.exp === undefined
|
|
123
|
+
? {}
|
|
124
|
+
: { exp: new Date(payload.exp * 1000).toISOString() }),
|
|
119
125
|
identity: payload.identity
|
|
120
126
|
};
|
|
121
127
|
}
|
|
@@ -137,4 +143,4 @@ const ERR_FORGED_KEY = new (class ForgedKeyError extends Error {
|
|
|
137
143
|
const ERR_REVOKED_KEY = new (class RevokedKeyError extends Error {
|
|
138
144
|
code = 'REVOKED_KEY';
|
|
139
145
|
})();
|
|
140
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
146
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjcnlwdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9kZWNyeXB0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQTtBQUNsRSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sV0FBVyxDQUFBO0FBQ3BDLE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LENBQUMsUUFBUTtTQUMzQixDQUFBO0lBQ0gsQ0FBQztJQUFDLE1BQU0sQ0FBQztRQUNQLE9BQU8saUJBQWlCLENBQUE7SUFDMUIsQ0FBQztBQUNILENBQUM7QUFFRCxNQUFNLFNBQVMsR0FBRyxnQkFBZ0IsRUFBRSxDQUFDLEdBQUcsQ0FBQTtBQUN4QyxNQUFNLFlBQVksR0FBRyxjQUFjLEVBQUUsQ0FBQyxHQUFHLENBQUE7QUFZekMsTUFBTSxpQkFBaUIsR0FBRyxJQUFJLENBQUMsTUFBTSxpQkFBa0IsU0FBUSxLQUFLO0lBQ2xELElBQUksR0FBRyxlQUFlLENBQUE7Q0FDdkMsQ0FBQyxFQUFFLENBQUE7QUFFSixNQUFNLGVBQWUsR0FBRyxJQUFJLENBQUMsTUFBTSxlQUFnQixTQUFRLEtBQUs7SUFDOUMsSUFBSSxHQUFHLGFBQWEsQ0FBQTtDQUNyQyxDQUFDLEVBQUUsQ0FBQTtBQUVKLE1BQU0sY0FBYyxHQUFHLElBQUksQ0FBQyxNQUFNLGNBQWUsU0FBUSxLQUFLO0lBQzVDLElBQUksR0FBRyxZQUFZLENBQUE7Q0FDcEMsQ0FBQyxFQUFFLENBQUE7QUFFSixNQUFNLGVBQWUsR0FBRyxJQUFJLENBQUMsTUFBTSxlQUFnQixTQUFRLEtBQUs7SUFDOUMsSUFBSSxHQUFHLGFBQWEsQ0FBQTtDQUNyQyxDQUFDLEVBQUUsQ0FBQSJ9
|
|
@@ -14,7 +14,7 @@ export class Effect {
|
|
|
14
14
|
const { EncryptJWT } = await load();
|
|
15
15
|
if (input.scopes?.some((scope) => !within(scope, input.identity.roles)) === true)
|
|
16
16
|
return ERR_INACCESSIBLE_SCOPE;
|
|
17
|
-
const lifetime = input.lifetime === undefined ? this.lifetime :
|
|
17
|
+
const lifetime = input.lifetime === undefined ? this.lifetime : input.lifetime * 1000;
|
|
18
18
|
const identity = {
|
|
19
19
|
id: input.identity.id,
|
|
20
20
|
roles: input.scopes ?? input.identity.roles
|
|
@@ -38,4 +38,4 @@ function within(scope, roles) {
|
|
|
38
38
|
const ERR_INACCESSIBLE_SCOPE = new (class InaccessibleScopeError extends Error {
|
|
39
39
|
code = 'INACCESSIBLE_SCOPE';
|
|
40
40
|
})();
|
|
41
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jcnlwdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9lbmNyeXB0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQTtBQUN2QyxPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBS3BDLE1BQU0sT0FBTyxNQUFNO0lBQ1QsR0FBRyxDQUEwQjtJQUM3QixRQUFRLENBQVM7SUFFbEIsS0FBSyxDQUFDLE9BQWdCO1FBQzNCLE1BQU0sR0FBRyxHQUFHLE9BQU8sQ0FBQyxhQUFhLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsTUFBTSxFQUFFLEVBQUUsRUFBRSxDQUFDLE1BQU0sS0FBSyxRQUFRLENBQUMsQ0FBQTtRQUVoRixJQUFJLEdBQUcsS0FBSyxTQUFTO1lBQUUsTUFBTSxJQUFJLFNBQVMsQ0FBQyx5Q0FBeUMsQ0FBQyxDQUFBO1FBRXJGLElBQUksQ0FBQyxHQUFHLEdBQUcsRUFBRSxFQUFFLEVBQUUsR0FBRyxDQUFDLEVBQUUsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEdBQUcsQ0FBQyxNQUFNLEVBQUUsRUFBRSxDQUFBO1FBQ2hELElBQUksQ0FBQyxRQUFRLEdBQUcsT0FBTyxDQUFDLGFBQWEsQ0FBQyxRQUFR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sRUFBRSxHQUFHLEVBQUUsS0FBSyxFQUFFLEdBQUcsRUFBRSxTQUFTLEVBQUUsR0FBRyxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQUUsRUFBRSxDQUFDO2FBQzNFLFNBQVMsQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDO2FBQzFCLFdBQVcsQ0FBQyxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsSUFBSSxDQUFDLENBQUE7UUFFakMsSUFBSSxRQUFRLEtBQUssQ0FBQztZQUFFLEtBQUssR0FBRyxLQUFLLENBQUMsaUJBQWlCLENBQUMsQ0FBQyxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsUUFBUSxDQUFDLEdBQUcsSUFBSSxDQUFDLENBQUE7UUFFbkYsT0FBTyxNQUFNLEtBQUssQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFBO0lBQzdDLENBQUM7Q0FDRjtBQUVELFNBQVMsTUFBTSxDQUFDLEtBQWEsRUFBRSxLQUFlO0lBQzVDLE9BQU8sS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLElBQUksRUFBRSxFQUFFLENBQUMsSUFBSSxLQUFLLEtBQUssSUFBSSxLQUFLLENBQUMsVUFBVSxDQUFDLElBQUksR0FBRyxHQUFHLENBQUMsQ0FBQyxDQUFBO0FBQzdFLENBQUM7QUFFRCxNQUFNLHNCQUFzQixHQUFHLElBQUksQ0FBQyxNQUFNLHNCQUF1QixTQUFRLEtBQUs7SUFDNUQsSUFBSSxHQUFHLG9CQUFvQixDQUFBO0NBQzVDLENBQUMsRUFBRSxDQUFBIn0=
|
|
@@ -13,9 +13,7 @@ export class Effect {
|
|
|
13
13
|
}
|
|
14
14
|
async execute(input) {
|
|
15
15
|
const lifetime = input.lifetime ?? this.lifetime;
|
|
16
|
-
const expires = lifetime === 0
|
|
17
|
-
? undefined
|
|
18
|
-
: new Date(Date.now() + lifetime * 1000).getTime();
|
|
16
|
+
const expires = lifetime === 0 ? undefined : new Date(Date.now() + lifetime * 1000).getTime();
|
|
19
17
|
const key = await this.keys.create({
|
|
20
18
|
input: {
|
|
21
19
|
identity: input.identity,
|
|
@@ -54,4 +52,4 @@ export class Effect {
|
|
|
54
52
|
};
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
55
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXNzdWUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zb3VyY2UvaXNzdWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLGlCQUFpQixDQUFBO0FBS3ZDLE1BQU0sT0FBTyxNQUFNO0lBQ1QsSUFBSSxDQUF3QztJQUM1QyxLQUFLLENBQXlDO0lBQzlDLE9BQU8sQ0FBOEI7SUFDckMsUUFBUSxDQUFTO0lBRWxCLEtBQUssQ0FBQyxPQUFnQjtRQUMzQixJQUFJLENBQUMsSUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQTtRQUN4QyxJQUFJLENBQUMsS0FBSyxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQTtRQUMxQyxJQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFBO1FBQ3BDLHNEQUFzRDtRQUN0RCxJQUFJLENBQUMsUUFBUSxHQUFHLE9BQU8sQ0FBQyxhQUFhLENBQUMsUUFBUSxDQUFBO0lBQ2hELENBQUM7SUFFTSxLQUFLLENBQUMsT0FBTyxDQUFDLEtBQVk7UUFDL0IsTUFBTSxRQUFRLEdBQUcsS0FBSyxDQUFDL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O2FBQ0o7U0FDRixDQUFDLENBQUE7UUFFRixJQUFJLEtBQUssWUFBWSxLQUFLO1lBQUUsT0FBTyxLQUFLLENBQUE7UUFFeEMsT0FBTztZQUNMLEdBQUcsRUFBRSxHQUFHLENBQUMsRUFBRTtZQUNYLGlEQUFpRDtZQUNqRCxHQUFHLENBQUMsT0FBTyxLQUFLLFNBQVMsSUFBSSxFQUFFLEdBQUcsRUFBRSxPQUFPLEVBQUUsQ0FBQztZQUM5QyxLQUFLO1NBQ04sQ0FBQTtJQUNILENBQUM7Q0FDRiJ9
|
|
@@ -21,4 +21,4 @@ function segments(token) {
|
|
|
21
21
|
const PASETO = 'v3.local.';
|
|
22
22
|
const JWE_SEGMENTS = 5;
|
|
23
23
|
const DOT = 46;
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWIvZm9ybS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7R0FLRztBQUNILE1BQU0sVUFBVSxJQUFJLENBQUMsS0FBYTtJQUNoQyxJQUFJLEtBQUssQ0FBQyxVQUFVLENBQUMsTUFBTSxDQUFDO1FBQUUsT0FBTyxRQUFRLENBQUE7SUFFN0MsSUFBSSxRQUFRLENBQUMsS0FBSyxDQUFDLEtBQUssWUFBWTtRQUFFLE9BQU8sS0FBSyxDQUFBO0lBRWxELE9BQU8sSUFBSSxDQUFBO0FBQ2IsQ0FBQztBQUVELFNBQVMsUUFBUSxDQUFDLEtBQWE7SUFDN0IsSUFBSSxLQUFLLEdBQUcsQ0FBQyxDQUFBO0lBRWIsS0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQyxFQUFFO1FBQUUsSUFBSSxLQUFLLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxLQUFLLEdBQUc7WUFBRSxLQUFLLEVBQUUsQ0FBQTtJQUUvRSxPQUFPLEtBQUssQ0FBQTtBQUNkLENBQUM7QUFFRCxNQUFNLE1BQU0sR0FBRyxXQUFXLENBQUE7QUFDMUIsTUFBTSxZQUFZLEdBQUcsQ0FBQyxDQUFBO0FBQ3RCLE1BQU0sR0FBRyxHQUFHLEVBQUUsQ0FBQSJ9
|
|
@@ -4,4 +4,4 @@ export function jweKey(value) {
|
|
|
4
4
|
throw new TypeError('JWE key must be a base64url-encoded 256-bit secret');
|
|
5
5
|
return new Uint8Array(key);
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc291cmNlL2xpYi9rZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxVQUFVLE1BQU0sQ0FBQyxLQUFhO0lBQ2xDLE1BQU0sR0FBRyxHQUFHLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLFdBQVcsQ0FBQyxDQUFBO0lBRTNDLElBQUksR0FBRyxDQUFDLE1BQU0sS0FBSyxFQUFFLElBQUksR0FBRyxDQUFDLFFBQVEsQ0FBQyxXQUFXLENBQUMsS0FBSyxLQUFLO1FBQzFELE1BQU0sSUFBSSxTQUFTLENBQUMsb0RBQW9ELENBQUMsQ0FBQTtJQUUzRSxPQUFPLElBQUksVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFBO0FBQzVCLENBQUMifQ==
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export function transition(_, object) {
|
|
2
2
|
object.revokedAt = Date.now();
|
|
3
3
|
}
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmV2b2tlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc291cmNlL3Jldm9rZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLFVBQVUsVUFBVSxDQUFDLENBQVUsRUFBRSxNQUFjO0lBQ25ELE1BQU0sQ0FBQyxTQUFTLEdBQUcsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFBO0FBQy9CLENBQUMifQ==
|
|
@@ -21,7 +21,11 @@ beforeEach(() => {
|
|
|
21
21
|
configuration = {
|
|
22
22
|
keys: [
|
|
23
23
|
{ id: 'key0', key: secret('sTxL6qVOadKkUJwh3FveU53XgTEo3Sdfg7k2FfiIKfs') },
|
|
24
|
-
{
|
|
24
|
+
{
|
|
25
|
+
id: 'legacy0',
|
|
26
|
+
key: secret('k3.local.m28p8SrbS467t-2IUjQuSOqmjvi24TbXhyjAW_dOrog'),
|
|
27
|
+
format: 'paseto'
|
|
28
|
+
}
|
|
25
29
|
],
|
|
26
30
|
lifetime: 2592000,
|
|
27
31
|
refresh: 600,
|
|
@@ -34,7 +38,7 @@ beforeEach(() => {
|
|
|
34
38
|
context = {
|
|
35
39
|
configuration,
|
|
36
40
|
local: {
|
|
37
|
-
decrypt: mock.fn(async () =>
|
|
41
|
+
decrypt: mock.fn(async () => output),
|
|
38
42
|
observe: mock.fn(async () => null)
|
|
39
43
|
}
|
|
40
44
|
} as unknown as Context
|
|
@@ -47,23 +51,23 @@ for (const [expected, shift] of [
|
|
|
47
51
|
[true, -50],
|
|
48
52
|
[false, +50]
|
|
49
53
|
])
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
it(`should mark as stale: ${expected}`, async () => {
|
|
55
|
+
const now = Date.now()
|
|
56
|
+
const iat = new Date(now - configuration.refresh * 1000 + shift).toISOString()
|
|
57
|
+
const exp = new Date(now + 1000).toISOString()
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
output = { iss: authority, identity, exp, iat, refresh: false, custom: false }
|
|
56
60
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
const result = await authenticate.execute({
|
|
62
|
+
authority,
|
|
63
|
+
credentials
|
|
64
|
+
})
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
})
|
|
66
|
+
assert.deepStrictEqual(result, { identity, refresh: expected })
|
|
67
|
+
})
|
|
64
68
|
|
|
65
69
|
for (const refresh of [true, false])
|
|
66
|
-
|
|
70
|
+
it(`should return stale: ${refresh}`, async () => {
|
|
67
71
|
const iat = new Date().toISOString()
|
|
68
72
|
const exp = new Date(Date.now() + 1000).toISOString()
|
|
69
73
|
|
|
@@ -93,7 +97,9 @@ it('should check revocation of an aged custom token', async () => {
|
|
|
93
97
|
const exp = new Date(Date.now() + 1000).toISOString()
|
|
94
98
|
|
|
95
99
|
output = { iss: authority, identity, exp, iat, refresh: false, custom: true }
|
|
96
|
-
context.local.observe = mock.fn(async () => ({
|
|
100
|
+
context.local.observe = mock.fn(async () => ({
|
|
101
|
+
revokedAt: Date.now()
|
|
102
|
+
})) as unknown as Context['local']['observe']
|
|
97
103
|
authenticate.mount(context)
|
|
98
104
|
|
|
99
105
|
const result: any = await authenticate.execute({ authority, credentials })
|
|
@@ -101,6 +107,6 @@ it('should check revocation of an aged custom token', async () => {
|
|
|
101
107
|
assert.deepStrictEqual(result.code, 'TOKEN_REVOKED')
|
|
102
108
|
})
|
|
103
109
|
|
|
104
|
-
function secret
|
|
110
|
+
function secret(value: string): Secret {
|
|
105
111
|
return { unwrap: () => value }
|
|
106
112
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Maybe } from '@toa.io/core'
|
|
1
|
+
import type { Maybe } from '@toa.io/core/types'
|
|
2
2
|
import type { Operation } from '@toa.io/bridges.node'
|
|
3
3
|
import { form } from './lib/index.js'
|
|
4
4
|
import type { AuthenticateInput, AuthenticateOutput, Context } from './lib/index.js'
|
|
@@ -8,30 +8,27 @@ export class Computation implements Operation {
|
|
|
8
8
|
private decrypt!: Context['local']['decrypt']
|
|
9
9
|
private observe!: Context['local']['observe']
|
|
10
10
|
|
|
11
|
-
public mount
|
|
11
|
+
public mount(context: Context): void {
|
|
12
12
|
this.refresh = context.configuration.refresh * 1000
|
|
13
13
|
this.decrypt = context.local.decrypt
|
|
14
14
|
this.observe = context.local.observe
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
public async execute
|
|
17
|
+
public async execute(input: AuthenticateInput): Promise<Maybe<AuthenticateOutput>> {
|
|
18
18
|
// `Bearer` is presented by an OpenID id_token too, and the gateway asks each provider
|
|
19
19
|
// in turn: a credential this component did not issue is declined, not rejected
|
|
20
|
-
if (form(input.credentials) === null)
|
|
21
|
-
return ERR_UNRECOGNIZED
|
|
20
|
+
if (form(input.credentials) === null) return ERR_UNRECOGNIZED
|
|
22
21
|
|
|
23
22
|
const claims = await this.decrypt({ input: input.credentials })
|
|
24
23
|
|
|
25
|
-
if (claims instanceof Error)
|
|
26
|
-
return claims
|
|
24
|
+
if (claims instanceof Error) return claims
|
|
27
25
|
|
|
28
|
-
if (claims.iss !== input.authority)
|
|
29
|
-
return ERR_AUTHORITY
|
|
26
|
+
if (claims.iss !== input.authority) return ERR_AUTHORITY
|
|
30
27
|
|
|
31
28
|
const identity = claims.identity
|
|
32
29
|
const iat = new Date(claims.iat).getTime()
|
|
33
30
|
const transient = claims.exp !== undefined
|
|
34
|
-
const aged = transient &&
|
|
31
|
+
const aged = transient && iat + this.refresh < Date.now()
|
|
35
32
|
|
|
36
33
|
if (aged) {
|
|
37
34
|
const revocation = await this.observe({ query: { id: identity.id } })
|
|
@@ -22,8 +22,16 @@ beforeEach(() => {
|
|
|
22
22
|
{ id: 'key0', key: secret('sTxL6qVOadKkUJwh3FveU53XgTEo3Sdfg7k2FfiIKfs') },
|
|
23
23
|
// keys are secrets, and a secret is an object
|
|
24
24
|
{ id: 'key1', key: secret('5I0iSKw3yfBkQ4AXfA8eR-tWR0Q1dpn4x3bPrPzHkP0') },
|
|
25
|
-
{
|
|
26
|
-
|
|
25
|
+
{
|
|
26
|
+
id: 'legacy0',
|
|
27
|
+
key: secret('k3.local.m28p8SrbS467t-2IUjQuSOqmjvi24TbXhyjAW_dOrog'),
|
|
28
|
+
format: 'paseto'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'legacy1',
|
|
32
|
+
key: secret('k3.local.-498jfWenrZH-Dqw3-zQJih_hKzDgBgUMfe37OCqSOA'),
|
|
33
|
+
format: 'paseto'
|
|
34
|
+
}
|
|
27
35
|
],
|
|
28
36
|
lifetime: 1000,
|
|
29
37
|
refresh: 500,
|
|
@@ -33,7 +41,11 @@ beforeEach(() => {
|
|
|
33
41
|
}
|
|
34
42
|
}
|
|
35
43
|
|
|
36
|
-
context = {
|
|
44
|
+
context = {
|
|
45
|
+
configuration,
|
|
46
|
+
remote,
|
|
47
|
+
logs: { debug: () => undefined }
|
|
48
|
+
} as unknown as Context
|
|
37
49
|
|
|
38
50
|
encrypt = new Encrypt()
|
|
39
51
|
encrypt.mount(context)
|
|
@@ -48,25 +60,33 @@ it('should decrypt', async () => {
|
|
|
48
60
|
|
|
49
61
|
const reply = await encrypt.execute({ authority, identity, lifetime })
|
|
50
62
|
|
|
51
|
-
if (reply instanceof Error)
|
|
52
|
-
throw reply
|
|
63
|
+
if (reply instanceof Error) throw reply
|
|
53
64
|
|
|
54
65
|
const decrypted = await decrypt.execute(reply)
|
|
55
66
|
|
|
56
|
-
assert.partialDeepStrictEqual(decrypted, {
|
|
67
|
+
assert.partialDeepStrictEqual(decrypted, {
|
|
68
|
+
iss: authority,
|
|
69
|
+
identity,
|
|
70
|
+
refresh: false,
|
|
71
|
+
custom: false
|
|
72
|
+
})
|
|
57
73
|
})
|
|
58
74
|
|
|
59
75
|
it('should mark a token encrypted with a custom key', async () => {
|
|
60
76
|
const identity: Identity = { id: generate(), roles: [] }
|
|
61
|
-
const key = {
|
|
77
|
+
const key = {
|
|
78
|
+
id: generate(),
|
|
79
|
+
key: '5I0iSKw3yfBkQ4AXfA8eR-tWR0Q1dpn4x3bPrPzHkP0',
|
|
80
|
+
label: 'custom'
|
|
81
|
+
}
|
|
62
82
|
|
|
63
83
|
remote.identity.keys.observe = mock.fn(async ({ query }: { query: { id: string } }) =>
|
|
64
|
-
query.id === key.id ? { ...key, identity: identity.id } : null
|
|
84
|
+
query.id === key.id ? { ...key, identity: identity.id } : null
|
|
85
|
+
) as any
|
|
65
86
|
|
|
66
87
|
const encrypted = await encrypt.execute({ authority, identity, lifetime: 100, key })
|
|
67
88
|
|
|
68
|
-
if (encrypted instanceof Error)
|
|
69
|
-
throw encrypted
|
|
89
|
+
if (encrypted instanceof Error) throw encrypted
|
|
70
90
|
|
|
71
91
|
const decrypted = await decrypt.execute(encrypted)
|
|
72
92
|
|
|
@@ -88,8 +108,7 @@ it('should decrypt with key1', async () => {
|
|
|
88
108
|
|
|
89
109
|
const encrypted = await encrypt.execute({ authority, identity, lifetime })
|
|
90
110
|
|
|
91
|
-
if (encrypted instanceof Error)
|
|
92
|
-
throw encrypted
|
|
111
|
+
if (encrypted instanceof Error) throw encrypted
|
|
93
112
|
|
|
94
113
|
const decrypted = await decrypt.execute(encrypted)
|
|
95
114
|
|
|
@@ -99,7 +118,11 @@ it('should decrypt with key1', async () => {
|
|
|
99
118
|
it('should decrypt legacy PASETO and require refresh', async () => {
|
|
100
119
|
const identity: Identity = { id: generate(), roles: [] }
|
|
101
120
|
|
|
102
|
-
const token = await paseto(
|
|
121
|
+
const token = await paseto(
|
|
122
|
+
configuration.keys[2].key.unwrap(),
|
|
123
|
+
{ iss: authority, identity },
|
|
124
|
+
'legacy0'
|
|
125
|
+
)
|
|
103
126
|
|
|
104
127
|
await assert.partialDeepStrictEqual(await decrypt.execute(token), {
|
|
105
128
|
iss: authority,
|
|
@@ -116,22 +139,33 @@ it('should separate JWE and PASETO keys with the same id by format', async () =>
|
|
|
116
139
|
|
|
117
140
|
const identity: Identity = { id: generate(), roles: [] }
|
|
118
141
|
|
|
119
|
-
const token = await paseto(
|
|
142
|
+
const token = await paseto(
|
|
143
|
+
configuration.keys[2].key.unwrap(),
|
|
144
|
+
{ iss: authority, identity },
|
|
145
|
+
'key0'
|
|
146
|
+
)
|
|
120
147
|
|
|
121
|
-
await assert.partialDeepStrictEqual(await decrypt.execute(token), {
|
|
148
|
+
await assert.partialDeepStrictEqual(await decrypt.execute(token), {
|
|
149
|
+
identity,
|
|
150
|
+
refresh: true
|
|
151
|
+
})
|
|
122
152
|
})
|
|
123
153
|
|
|
124
154
|
it('should reject a token under a revoked key', async () => {
|
|
125
155
|
const identity: Identity = { id: generate(), roles: [] }
|
|
126
|
-
const key = {
|
|
156
|
+
const key = {
|
|
157
|
+
id: generate(),
|
|
158
|
+
key: '5I0iSKw3yfBkQ4AXfA8eR-tWR0Q1dpn4x3bPrPzHkP0',
|
|
159
|
+
label: 'revoked'
|
|
160
|
+
}
|
|
127
161
|
|
|
128
162
|
remote.identity.keys.observe = mock.fn(async ({ query }: { query: { id: string } }) =>
|
|
129
|
-
query.id === key.id ? { ...key, identity: identity.id, revokedAt: Date.now() } : null
|
|
163
|
+
query.id === key.id ? { ...key, identity: identity.id, revokedAt: Date.now() } : null
|
|
164
|
+
) as any
|
|
130
165
|
|
|
131
166
|
const encrypted = await encrypt.execute({ authority, identity, lifetime: 0, key })
|
|
132
167
|
|
|
133
|
-
if (encrypted instanceof Error)
|
|
134
|
-
throw encrypted
|
|
168
|
+
if (encrypted instanceof Error) throw encrypted
|
|
135
169
|
|
|
136
170
|
const thrown: any = await decrypt.execute(encrypted)
|
|
137
171
|
|
|
@@ -144,8 +178,7 @@ it('should reject a tampered JWE', async () => {
|
|
|
144
178
|
identity: { id: generate(), roles: [] }
|
|
145
179
|
})
|
|
146
180
|
|
|
147
|
-
if (token instanceof Error)
|
|
148
|
-
throw token
|
|
181
|
+
if (token instanceof Error) throw token
|
|
149
182
|
|
|
150
183
|
const parts = token.split('.')
|
|
151
184
|
|
|
@@ -154,7 +187,7 @@ it('should reject a tampered JWE', async () => {
|
|
|
154
187
|
const tampered = parts.join('.')
|
|
155
188
|
|
|
156
189
|
const thrown: any = await decrypt.execute(tampered)
|
|
157
|
-
|
|
190
|
+
assert.deepStrictEqual(thrown.code, 'INVALID_TOKEN')
|
|
158
191
|
})
|
|
159
192
|
|
|
160
193
|
it('should reject JWE with an unknown key', async () => {
|
|
@@ -164,20 +197,20 @@ it('should reject JWE with an unknown key', async () => {
|
|
|
164
197
|
key: { id: 'missing', key: configuration.keys[0].key.unwrap(), label: 'missing' }
|
|
165
198
|
})
|
|
166
199
|
|
|
167
|
-
if (token instanceof Error)
|
|
168
|
-
throw token
|
|
200
|
+
if (token instanceof Error) throw token
|
|
169
201
|
|
|
170
202
|
const thrown: any = await decrypt.execute(token)
|
|
171
|
-
|
|
203
|
+
assert.deepStrictEqual(thrown.code, 'INVALID_KEY')
|
|
172
204
|
})
|
|
173
205
|
|
|
174
|
-
function secret
|
|
206
|
+
function secret(value: string): Secret {
|
|
175
207
|
return { unwrap: () => value }
|
|
176
208
|
}
|
|
177
209
|
|
|
178
|
-
async function paseto
|
|
210
|
+
async function paseto(key: string, claims: object, kid: string): Promise<string> {
|
|
179
211
|
const imported = await ImportKeyFactory().run(key as `k3.local.${string}`)
|
|
180
212
|
|
|
181
|
-
return await EncryptFactory().run(imported, claims,
|
|
182
|
-
|
|
213
|
+
return await EncryptFactory().run(imported, claims, {
|
|
214
|
+
footer: new TextEncoder().encode(JSON.stringify({ kid }))
|
|
215
|
+
})
|
|
183
216
|
}
|
|
@@ -2,7 +2,7 @@ import { DecryptFactory, ImportKeyFactory } from 'paseto/v3/local'
|
|
|
2
2
|
import { LRUCache } from 'lru-cache'
|
|
3
3
|
import { form, jweKey } from './lib/index.js'
|
|
4
4
|
import { load } from './lib/jose.js'
|
|
5
|
-
import type { Maybe } from '@toa.io/core'
|
|
5
|
+
import type { Maybe } from '@toa.io/core/types'
|
|
6
6
|
import type { Operation } from '@toa.io/bridges.node'
|
|
7
7
|
import type { Context, Claims, DecryptOutput, JWEClaims } from './lib/index.js'
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ export class Computation implements Operation {
|
|
|
14
14
|
private remote!: Context['remote']['identity']['keys']
|
|
15
15
|
private logs!: Context['logs']
|
|
16
16
|
|
|
17
|
-
public mount
|
|
17
|
+
public mount(context: Context): void {
|
|
18
18
|
const latest = context.configuration.keys.find(({ format }) => format !== 'paseto')
|
|
19
19
|
|
|
20
20
|
if (latest === undefined)
|
|
@@ -32,32 +32,28 @@ export class Computation implements Operation {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
public async execute
|
|
35
|
+
public async execute(token: string): Promise<Maybe<DecryptOutput>> {
|
|
36
36
|
const legacy = form(token) === 'paseto'
|
|
37
37
|
const kid = legacy ? this.pasetoKid(token) : await this.jweKid(token)
|
|
38
38
|
|
|
39
|
-
if (kid instanceof Error)
|
|
40
|
-
return kid
|
|
39
|
+
if (kid instanceof Error) return kid
|
|
41
40
|
|
|
42
41
|
const key = await this.key(kid, legacy)
|
|
43
42
|
|
|
44
|
-
if (key instanceof Error)
|
|
45
|
-
return key
|
|
43
|
+
if (key instanceof Error) return key
|
|
46
44
|
|
|
47
45
|
const claims = legacy
|
|
48
46
|
? await decryptPaseto(token, key.key)
|
|
49
47
|
: await decryptJWE(token, key.key)
|
|
50
48
|
|
|
51
|
-
if (claims instanceof Error)
|
|
52
|
-
return claims
|
|
49
|
+
if (claims instanceof Error) return claims
|
|
53
50
|
|
|
54
51
|
this.logs.debug('Token claims', claims)
|
|
55
52
|
|
|
56
53
|
if (key.identity !== undefined && claims.identity.id !== key.identity)
|
|
57
54
|
return ERR_FORGED_KEY
|
|
58
55
|
|
|
59
|
-
if (key.revokedAt !== undefined)
|
|
60
|
-
return ERR_REVOKED_KEY
|
|
56
|
+
if (key.revokedAt !== undefined) return ERR_REVOKED_KEY
|
|
61
57
|
|
|
62
58
|
return {
|
|
63
59
|
iss: claims.iss,
|
|
@@ -69,18 +65,16 @@ export class Computation implements Operation {
|
|
|
69
65
|
}
|
|
70
66
|
}
|
|
71
67
|
|
|
72
|
-
private pasetoKid
|
|
68
|
+
private pasetoKid(token: string): Maybe<string> {
|
|
73
69
|
const [, , , footer] = token.split('.')
|
|
74
70
|
|
|
75
|
-
if (footer === undefined)
|
|
76
|
-
return ERR_INVALID_TOKEN
|
|
71
|
+
if (footer === undefined) return ERR_INVALID_TOKEN
|
|
77
72
|
|
|
78
73
|
try {
|
|
79
74
|
const json = Buffer.from(footer, 'base64url').toString('utf-8')
|
|
80
75
|
const { kid } = JSON.parse(json)
|
|
81
76
|
|
|
82
|
-
if (typeof kid !== 'string')
|
|
83
|
-
return ERR_INVALID_TOKEN
|
|
77
|
+
if (typeof kid !== 'string') return ERR_INVALID_TOKEN
|
|
84
78
|
|
|
85
79
|
return kid
|
|
86
80
|
} catch {
|
|
@@ -88,13 +82,17 @@ export class Computation implements Operation {
|
|
|
88
82
|
}
|
|
89
83
|
}
|
|
90
84
|
|
|
91
|
-
private async jweKid
|
|
85
|
+
private async jweKid(token: string): Promise<Maybe<string>> {
|
|
92
86
|
try {
|
|
93
87
|
const { decodeProtectedHeader } = await load()
|
|
94
88
|
const header = decodeProtectedHeader(token)
|
|
95
89
|
|
|
96
|
-
if (
|
|
97
|
-
|
|
90
|
+
if (
|
|
91
|
+
header.alg !== 'dir' ||
|
|
92
|
+
header.enc !== 'A256GCM' ||
|
|
93
|
+
header.typ !== 'JWT' ||
|
|
94
|
+
typeof header.kid !== 'string'
|
|
95
|
+
)
|
|
98
96
|
return ERR_INVALID_TOKEN
|
|
99
97
|
|
|
100
98
|
return header.kid
|
|
@@ -103,11 +101,10 @@ export class Computation implements Operation {
|
|
|
103
101
|
}
|
|
104
102
|
}
|
|
105
103
|
|
|
106
|
-
private async key
|
|
104
|
+
private async key(kid: string, legacy: boolean): Promise<Maybe<Key>> {
|
|
107
105
|
const configured = legacy ? this.legacy : this.keys
|
|
108
106
|
|
|
109
|
-
if (kid in configured)
|
|
110
|
-
return configured[kid]
|
|
107
|
+
if (kid in configured) return configured[kid]
|
|
111
108
|
|
|
112
109
|
if (!this.cache.has(kid)) {
|
|
113
110
|
const value = await this.remote.observe({ query: { id: kid } })
|
|
@@ -121,7 +118,7 @@ export class Computation implements Operation {
|
|
|
121
118
|
}
|
|
122
119
|
}
|
|
123
120
|
|
|
124
|
-
async function decryptPaseto
|
|
121
|
+
async function decryptPaseto(token: string, key: string): Promise<Maybe<Claims>> {
|
|
125
122
|
try {
|
|
126
123
|
const secret = await importKey(key as `k3.local.${string}`)
|
|
127
124
|
// paseto 3 read a token that never expires; these are tokens already in the wild
|
|
@@ -133,7 +130,7 @@ async function decryptPaseto (token: string, key: string): Promise<Maybe<Claims>
|
|
|
133
130
|
}
|
|
134
131
|
}
|
|
135
132
|
|
|
136
|
-
async function decryptJWE
|
|
133
|
+
async function decryptJWE(token: string, key: string): Promise<Maybe<Claims>> {
|
|
137
134
|
try {
|
|
138
135
|
const { jwtDecrypt } = await load()
|
|
139
136
|
|
|
@@ -142,8 +139,12 @@ async function decryptJWE (token: string, key: string): Promise<Maybe<Claims>> {
|
|
|
142
139
|
contentEncryptionAlgorithms: ['A256GCM']
|
|
143
140
|
})
|
|
144
141
|
|
|
145
|
-
if (
|
|
146
|
-
typeof payload.
|
|
142
|
+
if (
|
|
143
|
+
typeof payload.iss !== 'string' ||
|
|
144
|
+
typeof payload.iat !== 'number' ||
|
|
145
|
+
typeof payload.identity !== 'object' ||
|
|
146
|
+
payload.identity === null
|
|
147
|
+
)
|
|
147
148
|
return ERR_INVALID_TOKEN
|
|
148
149
|
|
|
149
150
|
if (payload.exp !== undefined && payload.exp * 1000 <= Date.now())
|
|
@@ -152,7 +153,9 @@ async function decryptJWE (token: string, key: string): Promise<Maybe<Claims>> {
|
|
|
152
153
|
return {
|
|
153
154
|
iss: payload.iss,
|
|
154
155
|
iat: new Date(payload.iat * 1000).toISOString(),
|
|
155
|
-
...(payload.exp === undefined
|
|
156
|
+
...(payload.exp === undefined
|
|
157
|
+
? {}
|
|
158
|
+
: { exp: new Date(payload.exp * 1000).toISOString() }),
|
|
156
159
|
identity: payload.identity
|
|
157
160
|
}
|
|
158
161
|
} catch {
|