@toa.io/extensions.exposition 1.0.0-alpha.282 → 1.0.0-alpha.284
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 +56 -0
- package/components/exposition.octets/manifest.toa.yaml +11 -0
- package/components/exposition.octets/types/index.d.ts +3 -0
- package/components/exposition.octets/types/toa.d.ts +41 -0
- package/components/identity.bans/operations/transit.js +1 -1
- package/components/identity.bans/tsconfig.json +1 -1
- package/components/identity.bans/tsconfig.tsbuildinfo +1 -1
- package/components/identity.bans/types/index.d.ts +3 -0
- package/components/identity.bans/types/toa.d.ts +34 -0
- package/components/identity.basic/manifest.toa.yaml +13 -2
- package/components/identity.basic/operations/add.js +1 -1
- package/components/identity.basic/operations/authenticate.js +1 -1
- package/components/identity.basic/operations/check.js +1 -1
- package/components/identity.basic/operations/delete.js +1 -1
- package/components/identity.basic/operations/incept.js +18 -2
- 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 +3 -2
- package/components/identity.basic/source/add.ts +3 -3
- package/components/identity.basic/source/authenticate.ts +2 -2
- package/components/identity.basic/source/check.ts +1 -1
- package/components/identity.basic/source/delete.ts +2 -2
- package/components/identity.basic/source/incept.ts +31 -3
- package/components/identity.basic/source/info.ts +1 -1
- package/components/identity.basic/source/transit.ts +6 -4
- package/components/identity.basic/tsconfig.json +1 -1
- package/components/identity.basic/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/types/index.d.ts +22 -0
- package/components/identity.basic/types/toa.d.ts +121 -0
- package/components/identity.clients/manifest.toa.yaml +243 -0
- package/components/identity.clients/operations/describe.js +44 -0
- package/components/identity.clients/operations/lib/Context.js +2 -0
- package/components/identity.clients/operations/lib/Entity.js +2 -0
- package/components/identity.clients/operations/lib/canonical.js +24 -0
- package/components/identity.clients/operations/lib/cimd.js +86 -0
- package/components/identity.clients/operations/lib/errors.js +5 -0
- package/components/identity.clients/operations/lib/index.js +7 -0
- package/components/identity.clients/operations/lib/redirect.js +32 -0
- package/components/identity.clients/operations/register.js +84 -0
- package/components/identity.clients/source/describe.ts +65 -0
- package/components/identity.clients/source/lib/Context.ts +38 -0
- package/components/identity.clients/source/lib/Entity.ts +31 -0
- package/components/identity.clients/source/lib/canonical.test.ts +43 -0
- package/components/identity.clients/source/lib/canonical.ts +27 -0
- package/components/identity.clients/source/lib/cimd.test.ts +120 -0
- package/components/identity.clients/source/lib/cimd.ts +107 -0
- package/components/identity.clients/source/lib/errors.ts +4 -0
- package/components/identity.clients/source/lib/index.ts +6 -0
- package/components/identity.clients/source/lib/redirect.test.ts +41 -0
- package/components/identity.clients/source/lib/redirect.ts +35 -0
- package/components/identity.clients/source/register.ts +125 -0
- package/components/identity.clients/tsconfig.json +10 -0
- package/components/identity.clients/tsconfig.tsbuildinfo +1 -0
- package/components/identity.clients/types/index.d.ts +3 -0
- package/components/identity.clients/types/toa.d.ts +109 -0
- package/components/identity.credentials/operations/list.js +1 -1
- package/components/identity.credentials/source/list.ts +2 -1
- package/components/identity.credentials/tsconfig.json +4 -2
- package/components/identity.credentials/tsconfig.tsbuildinfo +1 -1
- package/components/identity.credentials/types/index.d.ts +3 -0
- package/components/identity.credentials/types/toa.d.ts +30 -0
- package/components/identity.federation/manifest.toa.yaml +37 -1
- package/components/identity.federation/operations/authenticate.js +7 -3
- package/components/identity.federation/operations/create.js +1 -1
- 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 +6 -2
- package/components/identity.federation/operations/lib/Configuration.js +1 -1
- package/components/identity.federation/operations/lib/Ctx.js +1 -1
- package/components/identity.federation/operations/lib/Payload.js +1 -1
- package/components/identity.federation/operations/lib/decode.js +23 -9
- package/components/identity.federation/operations/lib/discovery.js +1 -1
- package/components/identity.federation/operations/lib/errors.js +5 -1
- package/components/identity.federation/operations/lib/exchange.js +12 -7
- package/components/identity.federation/operations/lib/index.js +2 -1
- package/components/identity.federation/operations/lib/jose.js +1 -1
- package/components/identity.federation/operations/lib/principal.js +14 -0
- package/components/identity.federation/operations/lib/resolve.js +1 -1
- package/components/identity.federation/operations/list.js +1 -1
- package/components/identity.federation/operations/types/Scheme.js +1 -1
- package/components/identity.federation/operations/types/configuration.js +1 -1
- package/components/identity.federation/operations/types/context.js +1 -1
- package/components/identity.federation/operations/types/entity.js +1 -1
- package/components/identity.federation/operations/types/index.js +1 -1
- package/components/identity.federation/source/authenticate.ts +9 -3
- package/components/identity.federation/source/incept.ts +7 -1
- package/components/identity.federation/source/lib/Ctx.ts +2 -2
- package/components/identity.federation/source/lib/decode.ts +25 -9
- package/components/identity.federation/source/lib/errors.ts +5 -0
- package/components/identity.federation/source/lib/exchange.ts +11 -7
- package/components/identity.federation/source/lib/index.ts +1 -0
- package/components/identity.federation/source/lib/principal.ts +17 -0
- package/components/identity.federation/source/types/configuration.ts +1 -1
- package/components/identity.federation/source/types/context.ts +6 -2
- package/components/identity.federation/tsconfig.json +4 -2
- package/components/identity.federation/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/types/index.d.ts +3 -0
- package/components/identity.federation/types/toa.d.ts +127 -0
- package/components/identity.grants/manifest.toa.yaml +245 -0
- package/components/identity.grants/operations/authorize.js +54 -0
- package/components/identity.grants/operations/exchange.js +89 -0
- package/components/identity.grants/operations/lib/code.js +30 -0
- package/components/identity.grants/operations/lib/identify.js +15 -0
- package/components/identity.grants/operations/lib/index.js +3 -0
- package/components/identity.grants/operations/list.js +18 -0
- package/components/identity.grants/operations/revoke.js +25 -0
- package/components/identity.grants/source/authorize.ts +90 -0
- package/components/identity.grants/source/exchange.ts +130 -0
- package/components/identity.grants/source/lib/code.ts +39 -0
- package/components/identity.grants/source/lib/identify.ts +16 -0
- package/components/identity.grants/source/lib/index.ts +3 -0
- package/components/identity.grants/source/list.ts +28 -0
- package/components/identity.grants/source/revoke.ts +38 -0
- package/components/identity.grants/tsconfig.json +10 -0
- package/components/identity.grants/tsconfig.tsbuildinfo +1 -0
- package/components/identity.grants/types/index.d.ts +60 -0
- package/components/identity.grants/types/toa.d.ts +108 -0
- package/components/identity.keys/manifest.toa.yaml +1 -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 +1 -1
- package/components/identity.keys/source/revoke.ts +1 -1
- package/components/identity.keys/tsconfig.json +1 -1
- package/components/identity.keys/tsconfig.tsbuildinfo +1 -1
- package/components/identity.keys/types/index.d.ts +3 -0
- package/components/identity.keys/types/toa.d.ts +47 -0
- package/components/identity.otp/operations/authenticate.js +1 -1
- package/components/identity.otp/operations/issue.js +1 -1
- package/components/identity.otp/operations/lib/Context.js +1 -1
- package/components/identity.otp/operations/lib/Entity.js +1 -1
- package/components/identity.otp/operations/lib/index.js +1 -1
- package/components/identity.otp/source/lib/Context.ts +4 -2
- package/components/identity.otp/tsconfig.json +1 -1
- package/components/identity.otp/tsconfig.tsbuildinfo +1 -1
- package/components/identity.otp/types/index.d.ts +3 -0
- package/components/identity.otp/types/toa.d.ts +56 -0
- package/components/identity.passkeys/manifest.toa.yaml +3 -0
- package/components/identity.passkeys/operations/authenticate.js +1 -1
- package/components/identity.passkeys/operations/challenge.js +1 -1
- package/components/identity.passkeys/operations/create.js +1 -1
- package/components/identity.passkeys/operations/delete.js +1 -1
- package/components/identity.passkeys/operations/lib/const.js +1 -1
- package/components/identity.passkeys/operations/list.js +1 -1
- package/components/identity.passkeys/operations/types/Configuration.js +1 -1
- package/components/identity.passkeys/operations/types/Context.js +1 -1
- package/components/identity.passkeys/operations/types/Passkey.js +1 -1
- package/components/identity.passkeys/operations/types/index.js +1 -1
- package/components/identity.passkeys/operations/use.js +1 -1
- package/components/identity.passkeys/source/authenticate.ts +1 -1
- package/components/identity.passkeys/source/challenge.ts +1 -1
- package/components/identity.passkeys/source/create.ts +1 -1
- package/components/identity.passkeys/source/types/Context.ts +2 -1
- package/components/identity.passkeys/source/use.ts +1 -1
- package/components/identity.passkeys/tsconfig.json +1 -1
- package/components/identity.passkeys/tsconfig.tsbuildinfo +1 -1
- package/components/identity.passkeys/types/index.d.ts +3 -0
- package/components/identity.passkeys/types/toa.d.ts +120 -0
- package/components/identity.roles/operations/grant.js +1 -1
- package/components/identity.roles/operations/lib/Entity.js +1 -1
- package/components/identity.roles/operations/list.js +1 -1
- package/components/identity.roles/operations/principal.js +29 -5
- package/components/identity.roles/source/principal.ts +33 -5
- package/components/identity.roles/tsconfig.json +1 -1
- package/components/identity.roles/tsconfig.tsbuildinfo +1 -1
- package/components/identity.roles/types/index.d.ts +3 -0
- package/components/identity.roles/types/toa.d.ts +43 -0
- package/components/identity.tokens/manifest.toa.yaml +34 -3
- package/components/identity.tokens/operations/authenticate.js +9 -1
- package/components/identity.tokens/operations/decrypt.js +3 -3
- package/components/identity.tokens/operations/encrypt.js +1 -1
- package/components/identity.tokens/operations/issue.js +3 -2
- package/components/identity.tokens/operations/lib/form.js +24 -0
- package/components/identity.tokens/operations/lib/index.js +2 -2
- package/components/identity.tokens/operations/lib/jose.js +1 -1
- package/components/identity.tokens/operations/lib/key.js +1 -1
- package/components/identity.tokens/operations/lib/pad.js +1 -1
- package/components/identity.tokens/operations/revoke.js +1 -1
- package/components/identity.tokens/source/authenticate.test.ts +8 -5
- package/components/identity.tokens/source/authenticate.ts +12 -1
- package/components/identity.tokens/source/decrypt.test.ts +1 -1
- package/components/identity.tokens/source/decrypt.ts +4 -3
- package/components/identity.tokens/source/encrypt.test.ts +1 -1
- package/components/identity.tokens/source/encrypt.ts +2 -1
- package/components/identity.tokens/source/issue.test.ts +71 -0
- package/components/identity.tokens/source/issue.ts +4 -2
- package/components/identity.tokens/source/lib/form.test.ts +25 -0
- package/components/identity.tokens/source/lib/form.ts +31 -0
- package/components/identity.tokens/source/lib/index.ts +2 -1
- package/components/identity.tokens/tsconfig.json +1 -1
- package/components/identity.tokens/tsconfig.tsbuildinfo +1 -1
- package/components/identity.tokens/types/index.d.ts +61 -0
- package/components/identity.tokens/types/toa.d.ts +113 -0
- package/documentation/access.md +13 -0
- package/documentation/cache.md +10 -1
- package/documentation/components.md +3 -0
- package/documentation/consent.md +101 -0
- package/documentation/identity.md +3 -1
- package/documentation/introspection.md +13 -5
- package/documentation/io.md +42 -2
- package/documentation/map.md +8 -0
- package/documentation/mcp.md +180 -0
- package/documentation/oauth.md +180 -0
- package/documentation/protocol.md +4 -0
- package/documentation/rpc.md +140 -0
- package/documentation/tree.md +3 -0
- package/features/auth.bearer.feature +120 -0
- package/features/cache.feature +46 -0
- package/features/identity.basic.feature +44 -0
- package/features/identity.federation.feature +2 -5
- package/features/introspection.feature +333 -0
- package/features/mcp.feature +687 -0
- package/features/oauth.clients.feature +195 -0
- package/features/oauth.discovery.feature +164 -0
- package/features/oauth.grants.feature +299 -0
- package/features/octets.cloudinary.feature +1 -0
- package/features/rpc.feature +429 -0
- package/features/steps/Cloudinary.ts +13 -0
- package/features/steps/Components.ts +0 -4
- package/features/steps/Gateway.ts +23 -2
- package/features/steps/Parameters.ts +22 -7
- package/features/steps/Realtime.ts +3 -0
- package/features/steps/components/echo/manifest.toa.yaml +3 -0
- package/features/steps/components/octets.tester/manifest.toa.yaml +2 -0
- package/features/steps/components/octets.tester/operations/redirect.js +6 -1
- package/features/steps/components/pots/manifest.toa.yaml +2 -0
- package/features/steps/components/users/manifest.toa.yaml +1 -0
- package/package.json +8 -6
- package/readme.md +6 -0
- package/schemas/annotation.cos.yaml +63 -0
- package/schemas/call.cos.yaml +18 -0
- package/source/Annotation.ts +54 -0
- package/source/Directive.test.ts +15 -15
- package/source/Directive.ts +77 -9
- package/source/Endpoint.test.ts +67 -0
- package/source/Endpoint.ts +31 -11
- package/source/Factory.ts +6 -2
- package/source/Gateway.ts +73 -11
- package/source/HTTP/Context.ts +7 -0
- package/source/HTTP/Server.ts +15 -5
- package/source/HTTP/exceptions.ts +2 -2
- package/source/HTTP/formats/form.ts +21 -0
- package/source/HTTP/formats/index.ts +17 -2
- package/source/HTTP/messages.test.ts +25 -1
- package/source/HTTP/messages.ts +20 -4
- package/source/Interception.ts +8 -2
- package/source/Introspection.ts +102 -0
- package/source/MCP/Server.ts +275 -0
- package/source/MCP/discover.ts +52 -0
- package/source/MCP/errors.ts +81 -0
- package/source/MCP/index.ts +1 -0
- package/source/MCP/schema.test.ts +85 -0
- package/source/MCP/schema.ts +87 -0
- package/source/MCP/tools.ts +156 -0
- package/source/MCP/types.ts +81 -0
- package/source/Query.ts +48 -8
- package/source/RPC/Context.ts +78 -0
- package/source/RPC/Dispatcher.ts +130 -0
- package/source/RPC/errors.test.ts +52 -0
- package/source/RPC/errors.ts +83 -0
- package/source/RPC/index.ts +1 -0
- package/source/RPC/names.test.ts +122 -0
- package/source/RPC/names.ts +182 -0
- package/source/RPC/types.ts +34 -0
- package/source/RTD/Directives.ts +52 -2
- package/source/RTD/Endpoint.ts +2 -1
- package/source/RTD/Method.ts +14 -11
- package/source/RTD/Node.ts +38 -7
- package/source/RTD/Route.ts +30 -3
- package/source/RTD/Tree.ts +37 -1
- package/source/RTD/expiration.test.ts +1 -1
- package/source/RTD/walk.test.ts +110 -0
- package/source/const.ts +15 -0
- package/source/deployment.ts +11 -1
- package/source/directives/auth/Anonymous.test.ts +38 -0
- package/source/directives/auth/Anonymous.ts +12 -0
- package/source/directives/auth/Anyone.ts +4 -0
- package/source/directives/auth/Authorization.ts +108 -22
- package/source/directives/auth/Delegate.test.ts +36 -0
- package/source/directives/auth/Delegate.ts +14 -0
- package/source/directives/auth/Echo.ts +5 -0
- package/source/directives/auth/Incept.ts +16 -10
- package/source/directives/auth/Role.ts +13 -0
- package/source/directives/auth/Rule.ts +29 -0
- package/source/directives/auth/Scheme.ts +5 -0
- package/source/directives/auth/schemes.test.ts +8 -4
- package/source/directives/auth/schemes.ts +22 -9
- package/source/directives/auth/types.ts +26 -2
- package/source/directives/cache/Cache.ts +14 -5
- package/source/directives/cache/Control.ts +0 -3
- package/source/directives/dev/Development.ts +1 -1
- package/source/directives/flow/Fetch.ts +1 -1
- package/source/directives/flow/Flow.ts +1 -1
- package/source/directives/index.ts +5 -2
- package/source/directives/io/Directive.ts +1 -1
- package/source/directives/io/IO.ts +34 -3
- package/source/directives/io/Input.ts +3 -2
- package/source/directives/io/Output.ts +10 -4
- package/source/directives/io/Status.test.ts +84 -0
- package/source/directives/io/Status.ts +46 -0
- package/source/directives/io/Throttle.ts +1 -1
- package/source/directives/io/lib/throttle/Quotas.ts +2 -2
- package/source/directives/map/Headers.ts +11 -0
- package/source/directives/map/Map.ts +10 -1
- package/source/directives/map/Mapping.ts +23 -0
- package/source/directives/map/Segments.ts +12 -0
- package/source/directives/mcp/MCP.ts +33 -0
- package/source/directives/mcp/Tool.test.ts +66 -0
- package/source/directives/mcp/Tool.ts +28 -0
- package/source/directives/mcp/index.ts +6 -0
- package/source/directives/oauth/Discovery.ts +70 -0
- package/source/directives/oauth/documents.ts +113 -0
- package/source/directives/oauth/index.ts +3 -0
- package/source/directives/octets/Delete.ts +1 -1
- package/source/directives/octets/Get.ts +1 -1
- package/source/directives/octets/Octets.ts +1 -1
- package/source/directives/octets/Workflow.ts +1 -1
- package/source/directives/octets/workflows/Execution.ts +1 -1
- package/source/directives/require/Directive.ts +1 -1
- package/source/directives/require/Headers.ts +1 -1
- package/source/directives/require/Require.ts +2 -2
- package/source/index.ts +6 -0
- package/source/octets.d.ts +17 -0
- package/source/schemas.ts +2 -0
- package/source/userland.ts +47 -0
- package/transpiled/Annotation.d.ts +41 -0
- package/transpiled/Directive.d.ts +18 -1
- package/transpiled/Directive.js +50 -6
- package/transpiled/Directive.js.map +1 -1
- package/transpiled/Endpoint.d.ts +9 -0
- package/transpiled/Endpoint.js +27 -11
- package/transpiled/Endpoint.js.map +1 -1
- package/transpiled/Factory.js +6 -2
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Gateway.d.ts +19 -2
- package/transpiled/Gateway.js +51 -9
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/Context.d.ts +6 -0
- package/transpiled/HTTP/Context.js +6 -0
- package/transpiled/HTTP/Context.js.map +1 -1
- package/transpiled/HTTP/Server.d.ts +8 -1
- package/transpiled/HTTP/Server.js +4 -3
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/HTTP/exceptions.d.ts +1 -1
- package/transpiled/HTTP/exceptions.js +2 -2
- package/transpiled/HTTP/exceptions.js.map +1 -1
- package/transpiled/HTTP/formats/form.d.ts +9 -0
- package/transpiled/HTTP/formats/form.js +18 -0
- package/transpiled/HTTP/formats/form.js.map +1 -0
- package/transpiled/HTTP/formats/index.d.ts +10 -2
- package/transpiled/HTTP/formats/index.js +10 -0
- package/transpiled/HTTP/formats/index.js.map +1 -1
- package/transpiled/HTTP/messages.d.ts +12 -0
- package/transpiled/HTTP/messages.js +12 -4
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/Interception.d.ts +4 -1
- package/transpiled/Interception.js +4 -2
- package/transpiled/Interception.js.map +1 -1
- package/transpiled/Introspection.d.ts +40 -0
- package/transpiled/Introspection.js +50 -1
- package/transpiled/Introspection.js.map +1 -1
- package/transpiled/MCP/Server.d.ts +41 -0
- package/transpiled/MCP/Server.js +180 -0
- package/transpiled/MCP/Server.js.map +1 -0
- package/transpiled/MCP/discover.d.ts +13 -0
- package/transpiled/MCP/discover.js +29 -0
- package/transpiled/MCP/discover.js.map +1 -0
- package/transpiled/MCP/errors.d.ts +24 -0
- package/transpiled/MCP/errors.js +67 -0
- package/transpiled/MCP/errors.js.map +1 -0
- package/transpiled/MCP/index.d.ts +1 -0
- package/transpiled/MCP/index.js +2 -0
- package/transpiled/MCP/index.js.map +1 -0
- package/transpiled/MCP/schema.d.ts +18 -0
- package/transpiled/MCP/schema.js +64 -0
- package/transpiled/MCP/schema.js.map +1 -0
- package/transpiled/MCP/tools.d.ts +31 -0
- package/transpiled/MCP/tools.js +121 -0
- package/transpiled/MCP/tools.js.map +1 -0
- package/transpiled/MCP/types.d.ts +64 -0
- package/transpiled/MCP/types.js +13 -0
- package/transpiled/MCP/types.js.map +1 -0
- package/transpiled/Query.d.ts +7 -0
- package/transpiled/Query.js +38 -7
- package/transpiled/Query.js.map +1 -1
- package/transpiled/RPC/Context.d.ts +11 -0
- package/transpiled/RPC/Context.js +63 -0
- package/transpiled/RPC/Context.js.map +1 -0
- package/transpiled/RPC/Dispatcher.d.ts +19 -0
- package/transpiled/RPC/Dispatcher.js +100 -0
- package/transpiled/RPC/Dispatcher.js.map +1 -0
- package/transpiled/RPC/errors.d.ts +18 -0
- package/transpiled/RPC/errors.js +67 -0
- package/transpiled/RPC/errors.js.map +1 -0
- package/transpiled/RPC/index.d.ts +1 -0
- package/transpiled/RPC/index.js +2 -0
- package/transpiled/RPC/index.js.map +1 -0
- package/transpiled/RPC/names.d.ts +30 -0
- package/transpiled/RPC/names.js +121 -0
- package/transpiled/RPC/names.js.map +1 -0
- package/transpiled/RPC/types.d.ts +27 -0
- package/transpiled/RPC/types.js +8 -0
- package/transpiled/RPC/types.js.map +1 -0
- package/transpiled/RTD/Directives.d.ts +41 -2
- package/transpiled/RTD/Endpoint.d.ts +2 -1
- package/transpiled/RTD/Method.d.ts +8 -3
- package/transpiled/RTD/Method.js +12 -10
- package/transpiled/RTD/Method.js.map +1 -1
- package/transpiled/RTD/Node.d.ts +20 -2
- package/transpiled/RTD/Node.js +22 -4
- package/transpiled/RTD/Node.js.map +1 -1
- package/transpiled/RTD/Route.d.ts +2 -1
- package/transpiled/RTD/Route.js +27 -2
- package/transpiled/RTD/Route.js.map +1 -1
- package/transpiled/RTD/Tree.d.ts +3 -1
- package/transpiled/RTD/Tree.js +26 -0
- package/transpiled/RTD/Tree.js.map +1 -1
- package/transpiled/const.d.ts +12 -0
- package/transpiled/const.js +12 -0
- package/transpiled/const.js.map +1 -1
- package/transpiled/deployment.js +6 -0
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/directives/auth/Anonymous.d.ts +6 -0
- package/transpiled/directives/auth/Anonymous.js +10 -0
- package/transpiled/directives/auth/Anonymous.js.map +1 -1
- package/transpiled/directives/auth/Anyone.d.ts +1 -0
- package/transpiled/directives/auth/Anyone.js +3 -0
- package/transpiled/directives/auth/Anyone.js.map +1 -1
- package/transpiled/directives/auth/Authorization.d.ts +28 -2
- package/transpiled/directives/auth/Authorization.js +87 -19
- package/transpiled/directives/auth/Authorization.js.map +1 -1
- package/transpiled/directives/auth/Delegate.d.ts +5 -0
- package/transpiled/directives/auth/Delegate.js +10 -0
- package/transpiled/directives/auth/Delegate.js.map +1 -1
- package/transpiled/directives/auth/Echo.d.ts +2 -0
- package/transpiled/directives/auth/Echo.js +4 -0
- package/transpiled/directives/auth/Echo.js.map +1 -1
- package/transpiled/directives/auth/Incept.d.ts +1 -1
- package/transpiled/directives/auth/Incept.js +13 -8
- package/transpiled/directives/auth/Incept.js.map +1 -1
- package/transpiled/directives/auth/Role.d.ts +2 -0
- package/transpiled/directives/auth/Role.js +9 -0
- package/transpiled/directives/auth/Role.js.map +1 -1
- package/transpiled/directives/auth/Rule.d.ts +5 -0
- package/transpiled/directives/auth/Rule.js +20 -0
- package/transpiled/directives/auth/Rule.js.map +1 -1
- package/transpiled/directives/auth/Scheme.d.ts +2 -0
- package/transpiled/directives/auth/Scheme.js +4 -0
- package/transpiled/directives/auth/Scheme.js.map +1 -1
- package/transpiled/directives/auth/schemes.d.ts +16 -4
- package/transpiled/directives/auth/schemes.js +20 -8
- package/transpiled/directives/auth/schemes.js.map +1 -1
- package/transpiled/directives/auth/types.d.ts +20 -2
- package/transpiled/directives/cache/Cache.d.ts +1 -1
- package/transpiled/directives/cache/Cache.js +10 -3
- package/transpiled/directives/cache/Cache.js.map +1 -1
- package/transpiled/directives/cache/Control.js +0 -2
- package/transpiled/directives/cache/Control.js.map +1 -1
- package/transpiled/directives/dev/Development.d.ts +1 -1
- package/transpiled/directives/dev/Development.js +1 -1
- package/transpiled/directives/dev/Development.js.map +1 -1
- package/transpiled/directives/flow/Flow.d.ts +1 -1
- package/transpiled/directives/flow/Flow.js +1 -1
- package/transpiled/directives/flow/Flow.js.map +1 -1
- package/transpiled/directives/index.js +4 -2
- package/transpiled/directives/index.js.map +1 -1
- package/transpiled/directives/io/Directive.d.ts +1 -1
- package/transpiled/directives/io/IO.d.ts +7 -1
- package/transpiled/directives/io/IO.js +25 -3
- package/transpiled/directives/io/IO.js.map +1 -1
- package/transpiled/directives/io/Input.d.ts +3 -2
- package/transpiled/directives/io/Input.js +2 -1
- package/transpiled/directives/io/Input.js.map +1 -1
- package/transpiled/directives/io/Output.d.ts +5 -3
- package/transpiled/directives/io/Output.js +8 -3
- package/transpiled/directives/io/Output.js.map +1 -1
- package/transpiled/directives/io/Status.d.ts +19 -0
- package/transpiled/directives/io/Status.js +34 -0
- package/transpiled/directives/io/Status.js.map +1 -0
- package/transpiled/directives/io/Throttle.d.ts +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/Quotas.d.ts +1 -1
- package/transpiled/directives/io/lib/throttle/Quotas.js +2 -2
- package/transpiled/directives/io/lib/throttle/Quotas.js.map +1 -1
- package/transpiled/directives/map/Headers.d.ts +2 -0
- package/transpiled/directives/map/Headers.js +8 -0
- package/transpiled/directives/map/Headers.js.map +1 -1
- package/transpiled/directives/map/Map.d.ts +3 -1
- package/transpiled/directives/map/Map.js +7 -1
- package/transpiled/directives/map/Map.js.map +1 -1
- package/transpiled/directives/map/Mapping.d.ts +13 -0
- package/transpiled/directives/map/Mapping.js +20 -0
- package/transpiled/directives/map/Mapping.js.map +1 -1
- package/transpiled/directives/map/Segments.d.ts +3 -0
- package/transpiled/directives/map/Segments.js +9 -0
- package/transpiled/directives/map/Segments.js.map +1 -1
- package/transpiled/directives/mcp/MCP.d.ts +15 -0
- package/transpiled/directives/mcp/MCP.js +23 -0
- package/transpiled/directives/mcp/MCP.js.map +1 -0
- package/transpiled/directives/mcp/Tool.d.ts +13 -0
- package/transpiled/directives/mcp/Tool.js +23 -0
- package/transpiled/directives/mcp/Tool.js.map +1 -0
- package/transpiled/directives/mcp/index.d.ts +4 -0
- package/transpiled/directives/mcp/index.js +4 -0
- package/transpiled/directives/mcp/index.js.map +1 -0
- package/transpiled/directives/oauth/Discovery.d.ts +23 -0
- package/transpiled/directives/oauth/Discovery.js +55 -0
- package/transpiled/directives/oauth/Discovery.js.map +1 -0
- package/transpiled/directives/oauth/documents.d.ts +9 -0
- package/transpiled/directives/oauth/documents.js +82 -0
- package/transpiled/directives/oauth/documents.js.map +1 -0
- package/transpiled/directives/oauth/index.d.ts +2 -0
- package/transpiled/directives/oauth/index.js +3 -0
- package/transpiled/directives/oauth/index.js.map +1 -0
- package/transpiled/directives/octets/Octets.d.ts +1 -1
- package/transpiled/directives/octets/Octets.js +1 -1
- package/transpiled/directives/octets/Octets.js.map +1 -1
- package/transpiled/directives/require/Directive.d.ts +1 -1
- package/transpiled/directives/require/Headers.d.ts +1 -1
- package/transpiled/directives/require/Headers.js +1 -1
- package/transpiled/directives/require/Headers.js.map +1 -1
- package/transpiled/directives/require/Require.d.ts +1 -1
- package/transpiled/directives/require/Require.js +2 -2
- package/transpiled/directives/require/Require.js.map +1 -1
- package/transpiled/index.d.ts +2 -0
- package/transpiled/schemas.d.ts +2 -0
- package/transpiled/schemas.js +1 -0
- package/transpiled/schemas.js.map +1 -1
- package/transpiled/userland.d.ts +39 -0
- package/transpiled/userland.js +7 -0
- package/transpiled/userland.js.map +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/components/identity.bans/operations/transit.d.ts +0 -14
- package/components/identity.bans/operations/transit.js.map +0 -1
- package/components/identity.basic/operations/add.d.ts +0 -3
- package/components/identity.basic/operations/add.js.map +0 -1
- package/components/identity.basic/operations/authenticate.d.ts +0 -13
- package/components/identity.basic/operations/authenticate.js.map +0 -1
- package/components/identity.basic/operations/check.d.ts +0 -7
- package/components/identity.basic/operations/check.js.map +0 -1
- package/components/identity.basic/operations/delete.d.ts +0 -7
- package/components/identity.basic/operations/delete.js.map +0 -1
- package/components/identity.basic/operations/incept.d.ts +0 -12
- package/components/identity.basic/operations/incept.js.map +0 -1
- package/components/identity.basic/operations/info.d.ts +0 -10
- package/components/identity.basic/operations/info.js.map +0 -1
- package/components/identity.basic/operations/lib/credentials.d.ts +0 -5
- package/components/identity.basic/operations/lib/credentials.js.map +0 -1
- package/components/identity.basic/operations/transit.d.ts +0 -14
- package/components/identity.basic/operations/transit.js.map +0 -1
- package/components/identity.basic/operations/types.d.ts +0 -61
- package/components/identity.basic/operations/types.js +0 -2
- package/components/identity.basic/operations/types.js.map +0 -1
- package/components/identity.basic/source/types.ts +0 -69
- package/components/identity.credentials/operations/list.d.ts +0 -51
- package/components/identity.credentials/operations/list.js.map +0 -1
- package/components/identity.federation/operations/authenticate.d.ts +0 -16
- package/components/identity.federation/operations/authenticate.js.map +0 -1
- package/components/identity.federation/operations/create.d.ts +0 -8
- package/components/identity.federation/operations/create.js.map +0 -1
- package/components/identity.federation/operations/decode.d.ts +0 -3
- package/components/identity.federation/operations/decode.js.map +0 -1
- package/components/identity.federation/operations/delete.d.ts +0 -8
- package/components/identity.federation/operations/delete.js.map +0 -1
- package/components/identity.federation/operations/incept.d.ts +0 -11
- package/components/identity.federation/operations/incept.js.map +0 -1
- package/components/identity.federation/operations/lib/Configuration.d.ts +0 -39
- package/components/identity.federation/operations/lib/Configuration.js.map +0 -1
- package/components/identity.federation/operations/lib/Ctx.d.ts +0 -8
- package/components/identity.federation/operations/lib/Ctx.js.map +0 -1
- package/components/identity.federation/operations/lib/Payload.d.ts +0 -5
- package/components/identity.federation/operations/lib/Payload.js.map +0 -1
- package/components/identity.federation/operations/lib/decode.d.ts +0 -3
- package/components/identity.federation/operations/lib/decode.js.map +0 -1
- package/components/identity.federation/operations/lib/discovery.d.ts +0 -5
- package/components/identity.federation/operations/lib/discovery.js.map +0 -1
- package/components/identity.federation/operations/lib/errors.d.ts +0 -70
- package/components/identity.federation/operations/lib/errors.js.map +0 -1
- package/components/identity.federation/operations/lib/exchange.d.ts +0 -3
- package/components/identity.federation/operations/lib/exchange.js.map +0 -1
- package/components/identity.federation/operations/lib/index.d.ts +0 -4
- package/components/identity.federation/operations/lib/index.js.map +0 -1
- package/components/identity.federation/operations/lib/jose.d.ts +0 -1
- package/components/identity.federation/operations/lib/jose.js.map +0 -1
- package/components/identity.federation/operations/lib/resolve.d.ts +0 -3
- package/components/identity.federation/operations/lib/resolve.js.map +0 -1
- package/components/identity.federation/operations/list.d.ts +0 -7
- package/components/identity.federation/operations/list.js.map +0 -1
- package/components/identity.federation/operations/types/Scheme.d.ts +0 -1
- package/components/identity.federation/operations/types/Scheme.js.map +0 -1
- package/components/identity.federation/operations/types/configuration.d.ts +0 -22
- package/components/identity.federation/operations/types/configuration.js.map +0 -1
- package/components/identity.federation/operations/types/context.d.ts +0 -35
- package/components/identity.federation/operations/types/context.js.map +0 -1
- package/components/identity.federation/operations/types/entity.d.ts +0 -9
- package/components/identity.federation/operations/types/entity.js.map +0 -1
- package/components/identity.federation/operations/types/index.d.ts +0 -4
- package/components/identity.federation/operations/types/index.js.map +0 -1
- package/components/identity.keys/operations/create.d.ts +0 -22
- package/components/identity.keys/operations/create.js.map +0 -1
- package/components/identity.keys/operations/disable.d.ts +0 -5
- package/components/identity.keys/operations/disable.js.map +0 -1
- package/components/identity.keys/operations/revoke.d.ts +0 -15
- package/components/identity.keys/operations/revoke.js.map +0 -1
- package/components/identity.otp/operations/authenticate.d.ts +0 -12
- package/components/identity.otp/operations/authenticate.js.map +0 -1
- package/components/identity.otp/operations/issue.d.ts +0 -12
- package/components/identity.otp/operations/issue.js.map +0 -1
- package/components/identity.otp/operations/lib/Context.d.ts +0 -14
- package/components/identity.otp/operations/lib/Context.js.map +0 -1
- package/components/identity.otp/operations/lib/Entity.d.ts +0 -6
- package/components/identity.otp/operations/lib/Entity.js.map +0 -1
- package/components/identity.otp/operations/lib/index.d.ts +0 -1
- package/components/identity.otp/operations/lib/index.js.map +0 -1
- package/components/identity.passkeys/operations/authenticate.d.ts +0 -16
- package/components/identity.passkeys/operations/authenticate.js.map +0 -1
- package/components/identity.passkeys/operations/challenge.d.ts +0 -35
- package/components/identity.passkeys/operations/challenge.js.map +0 -1
- package/components/identity.passkeys/operations/create.d.ts +0 -19
- package/components/identity.passkeys/operations/create.js.map +0 -1
- package/components/identity.passkeys/operations/delete.d.ts +0 -8
- package/components/identity.passkeys/operations/delete.js.map +0 -1
- package/components/identity.passkeys/operations/lib/const.d.ts +0 -1
- package/components/identity.passkeys/operations/lib/const.js.map +0 -1
- package/components/identity.passkeys/operations/list.d.ts +0 -7
- package/components/identity.passkeys/operations/list.js.map +0 -1
- package/components/identity.passkeys/operations/types/Configuration.d.ts +0 -6
- package/components/identity.passkeys/operations/types/Configuration.js.map +0 -1
- package/components/identity.passkeys/operations/types/Context.d.ts +0 -15
- package/components/identity.passkeys/operations/types/Context.js.map +0 -1
- package/components/identity.passkeys/operations/types/Passkey.d.ts +0 -12
- package/components/identity.passkeys/operations/types/Passkey.js.map +0 -1
- package/components/identity.passkeys/operations/types/index.d.ts +0 -2
- package/components/identity.passkeys/operations/types/index.js.map +0 -1
- package/components/identity.passkeys/operations/use.d.ts +0 -16
- package/components/identity.passkeys/operations/use.js.map +0 -1
- package/components/identity.roles/operations/grant.d.ts +0 -10
- package/components/identity.roles/operations/grant.js.map +0 -1
- package/components/identity.roles/operations/lib/Entity.d.ts +0 -5
- package/components/identity.roles/operations/lib/Entity.js.map +0 -1
- package/components/identity.roles/operations/list.d.ts +0 -2
- package/components/identity.roles/operations/list.js.map +0 -1
- package/components/identity.roles/operations/principal.d.ts +0 -13
- package/components/identity.roles/operations/principal.js.map +0 -1
- package/components/identity.tokens/operations/authenticate.d.ts +0 -9
- package/components/identity.tokens/operations/authenticate.js.map +0 -1
- package/components/identity.tokens/operations/decrypt.d.ts +0 -15
- package/components/identity.tokens/operations/decrypt.js.map +0 -1
- package/components/identity.tokens/operations/encrypt.d.ts +0 -8
- package/components/identity.tokens/operations/encrypt.js.map +0 -1
- package/components/identity.tokens/operations/issue.d.ts +0 -24
- package/components/identity.tokens/operations/issue.js.map +0 -1
- package/components/identity.tokens/operations/lib/index.d.ts +0 -3
- package/components/identity.tokens/operations/lib/index.js.map +0 -1
- package/components/identity.tokens/operations/lib/jose.d.ts +0 -1
- package/components/identity.tokens/operations/lib/jose.js.map +0 -1
- package/components/identity.tokens/operations/lib/key.d.ts +0 -1
- package/components/identity.tokens/operations/lib/key.js.map +0 -1
- package/components/identity.tokens/operations/lib/pad.d.ts +0 -1
- package/components/identity.tokens/operations/lib/pad.js.map +0 -1
- package/components/identity.tokens/operations/lib/types.d.ts +0 -88
- package/components/identity.tokens/operations/lib/types.js +0 -2
- package/components/identity.tokens/operations/lib/types.js.map +0 -1
- package/components/identity.tokens/operations/revoke.d.ts +0 -2
- package/components/identity.tokens/operations/revoke.js.map +0 -1
- package/components/identity.tokens/source/lib/types.ts +0 -102
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
Feature: JSON-RPC
|
|
2
|
+
|
|
3
|
+
A procedure is an RTD method addressed by name: the route template with its variables
|
|
4
|
+
marked, and the verb as the last segment. Nothing is declared for it — what is exposed as
|
|
5
|
+
a resource is exposed as a procedure, under the same directives.
|
|
6
|
+
|
|
7
|
+
Background:
|
|
8
|
+
Given the annotation:
|
|
9
|
+
"""yaml
|
|
10
|
+
rpc: {}
|
|
11
|
+
"""
|
|
12
|
+
And the `pots` is running with the following manifest:
|
|
13
|
+
"""yaml
|
|
14
|
+
exposition:
|
|
15
|
+
/:
|
|
16
|
+
io:output: true
|
|
17
|
+
anonymous: true
|
|
18
|
+
GET: enumerate
|
|
19
|
+
POST: create
|
|
20
|
+
/:id:
|
|
21
|
+
GET: observe
|
|
22
|
+
/guarded:
|
|
23
|
+
isolated: true
|
|
24
|
+
GET:
|
|
25
|
+
auth:role: admin
|
|
26
|
+
dev:stub: never
|
|
27
|
+
/faulty:
|
|
28
|
+
GET:
|
|
29
|
+
dev:throw: nope
|
|
30
|
+
/v1.0:
|
|
31
|
+
GET:
|
|
32
|
+
dev:stub: never
|
|
33
|
+
"""
|
|
34
|
+
And the `pots` database contains:
|
|
35
|
+
| _id | title | volume |
|
|
36
|
+
| 4c4759e6f9c74da989d64511df42d6f4 | First pot | 100 |
|
|
37
|
+
|
|
38
|
+
Scenario: A variable is taken from the parameters
|
|
39
|
+
When the following request is received:
|
|
40
|
+
"""
|
|
41
|
+
POST /.rpc HTTP/1.1
|
|
42
|
+
host: nex.toa.io
|
|
43
|
+
accept: application/yaml
|
|
44
|
+
content-type: application/json
|
|
45
|
+
|
|
46
|
+
{"jsonrpc": "2.0", "id": 1, "method": "pots/_id/GET",
|
|
47
|
+
"params": {"id": "4c4759e6f9c74da989d64511df42d6f4"}}
|
|
48
|
+
"""
|
|
49
|
+
Then the following reply is sent:
|
|
50
|
+
"""
|
|
51
|
+
200 OK
|
|
52
|
+
cache-control: no-store
|
|
53
|
+
|
|
54
|
+
jsonrpc: '2.0'
|
|
55
|
+
id: 1
|
|
56
|
+
result:
|
|
57
|
+
id: 4c4759e6f9c74da989d64511df42d6f4
|
|
58
|
+
title: First pot
|
|
59
|
+
volume: 100
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
Scenario: What is left of the parameters is the input
|
|
63
|
+
When the following request is received:
|
|
64
|
+
"""
|
|
65
|
+
POST /.rpc HTTP/1.1
|
|
66
|
+
host: nex.toa.io
|
|
67
|
+
accept: application/yaml
|
|
68
|
+
content-type: application/json
|
|
69
|
+
|
|
70
|
+
{"jsonrpc": "2.0", "id": 2, "method": "pots/POST",
|
|
71
|
+
"params": {"title": "Kettle", "volume": 1.7}}
|
|
72
|
+
"""
|
|
73
|
+
Then the following reply is sent:
|
|
74
|
+
"""
|
|
75
|
+
200 OK
|
|
76
|
+
|
|
77
|
+
jsonrpc: '2.0'
|
|
78
|
+
id: 2
|
|
79
|
+
result:
|
|
80
|
+
id:
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
Scenario: A query travels under a name of its own
|
|
84
|
+
When the following request is received:
|
|
85
|
+
"""
|
|
86
|
+
POST /.rpc HTTP/1.1
|
|
87
|
+
host: nex.toa.io
|
|
88
|
+
accept: application/yaml
|
|
89
|
+
content-type: application/json
|
|
90
|
+
|
|
91
|
+
{"jsonrpc": "2.0", "id": 3, "method": "pots/GET",
|
|
92
|
+
"params": {"query": {"limit": 1}}}
|
|
93
|
+
"""
|
|
94
|
+
Then the following reply is sent:
|
|
95
|
+
"""
|
|
96
|
+
200 OK
|
|
97
|
+
|
|
98
|
+
jsonrpc: '2.0'
|
|
99
|
+
id: 3
|
|
100
|
+
result:
|
|
101
|
+
- id: 4c4759e6f9c74da989d64511df42d6f4
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
Scenario: A call without an id answers nothing
|
|
105
|
+
When the following request is received:
|
|
106
|
+
"""
|
|
107
|
+
POST /.rpc HTTP/1.1
|
|
108
|
+
host: nex.toa.io
|
|
109
|
+
content-type: application/json
|
|
110
|
+
|
|
111
|
+
{"jsonrpc": "2.0", "method": "pots/POST", "params": {"title": "Pot", "volume": 1}}
|
|
112
|
+
"""
|
|
113
|
+
Then the following reply is sent:
|
|
114
|
+
"""
|
|
115
|
+
204 No Content
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
Scenario: A name nothing answers to
|
|
119
|
+
When the following request is received:
|
|
120
|
+
"""
|
|
121
|
+
POST /.rpc HTTP/1.1
|
|
122
|
+
host: nex.toa.io
|
|
123
|
+
accept: application/yaml
|
|
124
|
+
content-type: application/json
|
|
125
|
+
|
|
126
|
+
{"jsonrpc": "2.0", "id": 4, "method": "kettles/GET", "params": {}}
|
|
127
|
+
"""
|
|
128
|
+
Then the following reply is sent:
|
|
129
|
+
"""
|
|
130
|
+
200 OK
|
|
131
|
+
|
|
132
|
+
jsonrpc: '2.0'
|
|
133
|
+
id: 4
|
|
134
|
+
error:
|
|
135
|
+
code: -32601
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
Scenario: A credential does not refuse an anonymous procedure
|
|
139
|
+
What refuses a credentialed request at an `anonymous` route is that the reply would not
|
|
140
|
+
be cacheable, and what a procedure answers is not a reply.
|
|
141
|
+
|
|
142
|
+
# developer:secret
|
|
143
|
+
Given the `identity.basic` database contains:
|
|
144
|
+
| _id | authority | username | password |
|
|
145
|
+
| efe3a65ebbee47ed95a73edd911ea328 | nex | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
|
|
146
|
+
And the `identity.bans` database is empty
|
|
147
|
+
When the following request is received:
|
|
148
|
+
"""
|
|
149
|
+
GET /pots/ HTTP/1.1
|
|
150
|
+
host: nex.toa.io
|
|
151
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
152
|
+
accept: application/yaml
|
|
153
|
+
"""
|
|
154
|
+
Then the following reply is sent:
|
|
155
|
+
"""
|
|
156
|
+
403 Forbidden
|
|
157
|
+
"""
|
|
158
|
+
When the following request is received:
|
|
159
|
+
"""
|
|
160
|
+
POST /.rpc HTTP/1.1
|
|
161
|
+
host: nex.toa.io
|
|
162
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
163
|
+
accept: application/yaml
|
|
164
|
+
content-type: application/json
|
|
165
|
+
|
|
166
|
+
{"jsonrpc": "2.0", "id": 17, "method": "pots/GET", "params": {}}
|
|
167
|
+
"""
|
|
168
|
+
Then the following reply is sent:
|
|
169
|
+
"""
|
|
170
|
+
200 OK
|
|
171
|
+
|
|
172
|
+
jsonrpc: '2.0'
|
|
173
|
+
id: 17
|
|
174
|
+
result:
|
|
175
|
+
- id: 4c4759e6f9c74da989d64511df42d6f4
|
|
176
|
+
"""
|
|
177
|
+
|
|
178
|
+
Scenario: A route no name can spell
|
|
179
|
+
A segment holding a `.` or a `_` has no name, so nothing addresses it — the resource
|
|
180
|
+
itself is served over HTTP as it always was.
|
|
181
|
+
|
|
182
|
+
When the following request is received:
|
|
183
|
+
"""
|
|
184
|
+
POST /.rpc HTTP/1.1
|
|
185
|
+
host: nex.toa.io
|
|
186
|
+
accept: application/yaml
|
|
187
|
+
content-type: application/json
|
|
188
|
+
|
|
189
|
+
{"jsonrpc": "2.0", "id": 16, "method": "pots/v1.0/GET", "params": {}}
|
|
190
|
+
"""
|
|
191
|
+
Then the following reply is sent:
|
|
192
|
+
"""
|
|
193
|
+
200 OK
|
|
194
|
+
|
|
195
|
+
jsonrpc: '2.0'
|
|
196
|
+
id: 16
|
|
197
|
+
error:
|
|
198
|
+
code: -32601
|
|
199
|
+
"""
|
|
200
|
+
When the following request is received:
|
|
201
|
+
"""
|
|
202
|
+
GET /pots/v1.0/ HTTP/1.1
|
|
203
|
+
host: nex.toa.io
|
|
204
|
+
accept: application/yaml
|
|
205
|
+
"""
|
|
206
|
+
Then the following reply is sent:
|
|
207
|
+
"""
|
|
208
|
+
200 OK
|
|
209
|
+
"""
|
|
210
|
+
|
|
211
|
+
Scenario: A variable the parameters do not carry
|
|
212
|
+
When the following request is received:
|
|
213
|
+
"""
|
|
214
|
+
POST /.rpc HTTP/1.1
|
|
215
|
+
host: nex.toa.io
|
|
216
|
+
accept: application/yaml
|
|
217
|
+
content-type: application/json
|
|
218
|
+
|
|
219
|
+
{"jsonrpc": "2.0", "id": 5, "method": "pots/_id/GET", "params": {}}
|
|
220
|
+
"""
|
|
221
|
+
Then the following reply is sent:
|
|
222
|
+
"""
|
|
223
|
+
200 OK
|
|
224
|
+
|
|
225
|
+
jsonrpc: '2.0'
|
|
226
|
+
id: 5
|
|
227
|
+
error:
|
|
228
|
+
code: -32602
|
|
229
|
+
"""
|
|
230
|
+
|
|
231
|
+
Scenario: A call that fails is a value, not a status
|
|
232
|
+
When the following request is received:
|
|
233
|
+
"""
|
|
234
|
+
POST /.rpc HTTP/1.1
|
|
235
|
+
host: nex.toa.io
|
|
236
|
+
accept: application/yaml
|
|
237
|
+
content-type: application/json
|
|
238
|
+
|
|
239
|
+
{"jsonrpc": "2.0", "id": 6, "method": "pots/faulty/GET", "params": {}}
|
|
240
|
+
"""
|
|
241
|
+
Then the following reply is sent:
|
|
242
|
+
"""
|
|
243
|
+
200 OK
|
|
244
|
+
|
|
245
|
+
jsonrpc: '2.0'
|
|
246
|
+
id: 6
|
|
247
|
+
error:
|
|
248
|
+
code: -32603
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
Scenario: A credential is the request's, so a call cannot be refused for one
|
|
252
|
+
When the following request is received:
|
|
253
|
+
"""
|
|
254
|
+
POST /.rpc HTTP/1.1
|
|
255
|
+
host: nex.toa.io
|
|
256
|
+
accept: application/yaml
|
|
257
|
+
content-type: application/json
|
|
258
|
+
|
|
259
|
+
{"jsonrpc": "2.0", "id": 7, "method": "pots/guarded/GET", "params": {}}
|
|
260
|
+
"""
|
|
261
|
+
Then the following reply is sent:
|
|
262
|
+
"""
|
|
263
|
+
401 Unauthorized
|
|
264
|
+
"""
|
|
265
|
+
|
|
266
|
+
Scenario: A request may carry several calls
|
|
267
|
+
When the following request is received:
|
|
268
|
+
"""
|
|
269
|
+
POST /.rpc HTTP/1.1
|
|
270
|
+
host: nex.toa.io
|
|
271
|
+
accept: application/yaml
|
|
272
|
+
content-type: application/json
|
|
273
|
+
|
|
274
|
+
[{"jsonrpc": "2.0", "id": 8, "method": "pots/_id/GET",
|
|
275
|
+
"params": {"id": "4c4759e6f9c74da989d64511df42d6f4"}},
|
|
276
|
+
{"jsonrpc": "2.0", "id": 9, "method": "kettles/GET", "params": {}},
|
|
277
|
+
{"jsonrpc": "2.0", "method": "pots/POST", "params": {"title": "Pot", "volume": 1}}]
|
|
278
|
+
"""
|
|
279
|
+
Then the following reply is sent:
|
|
280
|
+
"""
|
|
281
|
+
200 OK
|
|
282
|
+
|
|
283
|
+
- jsonrpc: '2.0'
|
|
284
|
+
id: 8
|
|
285
|
+
result:
|
|
286
|
+
id: 4c4759e6f9c74da989d64511df42d6f4
|
|
287
|
+
title: First pot
|
|
288
|
+
- jsonrpc: '2.0'
|
|
289
|
+
id: 9
|
|
290
|
+
error:
|
|
291
|
+
code: -32601
|
|
292
|
+
"""
|
|
293
|
+
|
|
294
|
+
Scenario: What a request took is said once, whatever it carried
|
|
295
|
+
When the following request is received:
|
|
296
|
+
"""
|
|
297
|
+
POST /.rpc HTTP/1.1
|
|
298
|
+
host: nex.toa.io
|
|
299
|
+
accept: application/yaml
|
|
300
|
+
content-type: application/json
|
|
301
|
+
|
|
302
|
+
[{"jsonrpc": "2.0", "id": 13, "method": "pots/GET", "params": {}},
|
|
303
|
+
{"jsonrpc": "2.0", "id": 14, "method": "pots/GET", "params": {}},
|
|
304
|
+
{"jsonrpc": "2.0", "id": 15, "method": "pots/GET", "params": {}}]
|
|
305
|
+
"""
|
|
306
|
+
Then the following reply is sent:
|
|
307
|
+
"""
|
|
308
|
+
200 OK
|
|
309
|
+
"""
|
|
310
|
+
# the stages of a call are measured per call, and a trace is where they are read
|
|
311
|
+
And the reply does not contain:
|
|
312
|
+
"""
|
|
313
|
+
precall
|
|
314
|
+
"""
|
|
315
|
+
|
|
316
|
+
Scenario: A request of notifications alone answers nothing
|
|
317
|
+
When the following request is received:
|
|
318
|
+
"""
|
|
319
|
+
POST /.rpc HTTP/1.1
|
|
320
|
+
host: nex.toa.io
|
|
321
|
+
content-type: application/json
|
|
322
|
+
|
|
323
|
+
[{"jsonrpc": "2.0", "method": "pots/POST", "params": {"title": "One", "volume": 1}},
|
|
324
|
+
{"jsonrpc": "2.0", "method": "pots/POST", "params": {"title": "Two", "volume": 2}}]
|
|
325
|
+
"""
|
|
326
|
+
Then the following reply is sent:
|
|
327
|
+
"""
|
|
328
|
+
204 No Content
|
|
329
|
+
"""
|
|
330
|
+
|
|
331
|
+
Scenario: A request carries at least one call
|
|
332
|
+
When the following request is received:
|
|
333
|
+
"""
|
|
334
|
+
POST /.rpc HTTP/1.1
|
|
335
|
+
host: nex.toa.io
|
|
336
|
+
accept: application/yaml
|
|
337
|
+
content-type: application/json
|
|
338
|
+
|
|
339
|
+
[]
|
|
340
|
+
"""
|
|
341
|
+
Then the following reply is sent:
|
|
342
|
+
"""
|
|
343
|
+
400 Bad Request
|
|
344
|
+
|
|
345
|
+
jsonrpc: '2.0'
|
|
346
|
+
id:
|
|
347
|
+
error:
|
|
348
|
+
code: -32600
|
|
349
|
+
"""
|
|
350
|
+
|
|
351
|
+
Scenario: A call that is not one is answered to nobody
|
|
352
|
+
When the following request is received:
|
|
353
|
+
"""
|
|
354
|
+
POST /.rpc HTTP/1.1
|
|
355
|
+
host: nex.toa.io
|
|
356
|
+
accept: application/yaml
|
|
357
|
+
content-type: application/json
|
|
358
|
+
|
|
359
|
+
{"jsonrpc": "1.0", "id": 10, "method": "pots/GET"}
|
|
360
|
+
"""
|
|
361
|
+
Then the following reply is sent:
|
|
362
|
+
"""
|
|
363
|
+
200 OK
|
|
364
|
+
|
|
365
|
+
jsonrpc: '2.0'
|
|
366
|
+
id:
|
|
367
|
+
error:
|
|
368
|
+
code: -32600
|
|
369
|
+
"""
|
|
370
|
+
|
|
371
|
+
Scenario: The endpoint answers POST alone
|
|
372
|
+
When the following request is received:
|
|
373
|
+
"""
|
|
374
|
+
GET /.rpc HTTP/1.1
|
|
375
|
+
host: nex.toa.io
|
|
376
|
+
accept: application/yaml
|
|
377
|
+
"""
|
|
378
|
+
Then the following reply is sent:
|
|
379
|
+
"""
|
|
380
|
+
405 Method Not Allowed
|
|
381
|
+
allow: POST
|
|
382
|
+
"""
|
|
383
|
+
|
|
384
|
+
Scenario: What a request may carry at once is bounded
|
|
385
|
+
Given the annotation:
|
|
386
|
+
"""yaml
|
|
387
|
+
rpc:
|
|
388
|
+
batch: 1
|
|
389
|
+
"""
|
|
390
|
+
When the following request is received:
|
|
391
|
+
"""
|
|
392
|
+
POST /.rpc HTTP/1.1
|
|
393
|
+
host: nex.toa.io
|
|
394
|
+
accept: application/yaml
|
|
395
|
+
content-type: application/json
|
|
396
|
+
|
|
397
|
+
[{"jsonrpc": "2.0", "id": 11, "method": "pots/GET", "params": {}},
|
|
398
|
+
{"jsonrpc": "2.0", "id": 12, "method": "pots/GET", "params": {}}]
|
|
399
|
+
"""
|
|
400
|
+
Then the following reply is sent:
|
|
401
|
+
"""
|
|
402
|
+
400 Bad Request
|
|
403
|
+
|
|
404
|
+
jsonrpc: '2.0'
|
|
405
|
+
id:
|
|
406
|
+
error:
|
|
407
|
+
code: -32002
|
|
408
|
+
"""
|
|
409
|
+
|
|
410
|
+
Scenario: Nothing is served where it was not asked for
|
|
411
|
+
Given the annotation:
|
|
412
|
+
"""yaml
|
|
413
|
+
/:
|
|
414
|
+
io:output: true
|
|
415
|
+
anonymous: true
|
|
416
|
+
"""
|
|
417
|
+
When the following request is received:
|
|
418
|
+
"""
|
|
419
|
+
POST /.rpc HTTP/1.1
|
|
420
|
+
host: nex.toa.io
|
|
421
|
+
accept: application/yaml
|
|
422
|
+
content-type: application/json
|
|
423
|
+
|
|
424
|
+
{"jsonrpc": "2.0", "id": 9, "method": "pots/GET", "params": {}}
|
|
425
|
+
"""
|
|
426
|
+
Then the following reply is sent:
|
|
427
|
+
"""
|
|
428
|
+
404 Not Found
|
|
429
|
+
"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Before } from '@cucumber/cucumber'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The Cloudinary scenarios upload to a real account, named by `features/steps/.env` — the
|
|
5
|
+
* environment and the keys `.env.example` lists. A checkout carries none, and an account is
|
|
6
|
+
* not something a run can stand up for itself, the way the compose file stands up a database.
|
|
7
|
+
* Without one the scenarios are skipped rather than failed, so `npm run features` answers on a
|
|
8
|
+
* fresh machine; with one they run, no flag to remember.
|
|
9
|
+
*/
|
|
10
|
+
Before({ tags: '@cloudinary' }, function () {
|
|
11
|
+
if (process.env.CLOUDINARY_ENVIRONMENT === undefined)
|
|
12
|
+
return 'skipped'
|
|
13
|
+
})
|
|
@@ -4,7 +4,6 @@ import { dirname, join } from 'node:path'
|
|
|
4
4
|
import tsflow from 'cucumber-tsflow'
|
|
5
5
|
|
|
6
6
|
import * as boot from '@toa.io/boot'
|
|
7
|
-
import { timeout } from '@toa.io/generic'
|
|
8
7
|
import { type Connector } from '@toa.io/core'
|
|
9
8
|
import { load as parse } from 'js-yaml'
|
|
10
9
|
import { Gateway } from './Gateway.js'
|
|
@@ -49,7 +48,6 @@ export class Components {
|
|
|
49
48
|
this.compositions[MAP] = await boot.composition(map())
|
|
50
49
|
|
|
51
50
|
await this.compositions[MAP].connect()
|
|
52
|
-
await timeout(50) // discovery
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
/** The values component, as the configuration extension ships it; the service hosts it alone. */
|
|
@@ -62,7 +60,6 @@ export class Components {
|
|
|
62
60
|
this.compositions[VALUES] = await boot.composition([values()])
|
|
63
61
|
|
|
64
62
|
await this.compositions[VALUES].connect()
|
|
65
|
-
await timeout(50) // discovery
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
/** What the deployment would tell the values service, as the scenario needs it. */
|
|
@@ -101,7 +98,6 @@ export class Components {
|
|
|
101
98
|
this.compositions[name] = await boot.composition([path])
|
|
102
99
|
|
|
103
100
|
await this.compositions[name].connect()
|
|
104
|
-
await timeout(50) // discovery
|
|
105
101
|
}
|
|
106
102
|
}
|
|
107
103
|
|
|
@@ -29,7 +29,7 @@ export class Gateway {
|
|
|
29
29
|
process.env.TOA_EXPOSITION = JSON.stringify(tree)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const { debug, authorities, bouncer, ip } = annotation
|
|
32
|
+
const { debug, authorities, bouncer, ip, oauth, rpc, mcp } = annotation
|
|
33
33
|
const properties = Object.assign({}, DEFAULT_PROPERTIES)
|
|
34
34
|
|
|
35
35
|
if (debug !== undefined)
|
|
@@ -44,6 +44,15 @@ export class Gateway {
|
|
|
44
44
|
if (authorities !== undefined)
|
|
45
45
|
properties.authorities = authorities
|
|
46
46
|
|
|
47
|
+
if (oauth !== undefined)
|
|
48
|
+
properties.oauth = oauth
|
|
49
|
+
|
|
50
|
+
if (rpc !== undefined)
|
|
51
|
+
properties.rpc = rpc
|
|
52
|
+
|
|
53
|
+
if (mcp !== undefined)
|
|
54
|
+
properties.mcp = mcp
|
|
55
|
+
|
|
47
56
|
process.env.TOA_EXPOSITION_PROPERTIES = JSON.stringify(properties)
|
|
48
57
|
|
|
49
58
|
await Gateway.stop()
|
|
@@ -145,7 +154,14 @@ export class Gateway {
|
|
|
145
154
|
instance = service
|
|
146
155
|
|
|
147
156
|
await service.connect()
|
|
148
|
-
|
|
157
|
+
|
|
158
|
+
/*
|
|
159
|
+
* The gateway waits for the branches it discovers, but a component's own resources —
|
|
160
|
+
* a storage, a queue — are still connecting when it answers. Fifty milliseconds was
|
|
161
|
+
* enough until the composition grew; a scenario that asks too early reads the 404 that
|
|
162
|
+
* precedes the route.
|
|
163
|
+
*/
|
|
164
|
+
await timeout(DISCOVERY)
|
|
149
165
|
}
|
|
150
166
|
|
|
151
167
|
@after()
|
|
@@ -200,6 +216,9 @@ const DEFAULT_TREE = JSON.stringify({
|
|
|
200
216
|
]
|
|
201
217
|
} satisfies syntax.Node)
|
|
202
218
|
|
|
219
|
+
/** Milliseconds a composition is given to finish connecting what it needs. */
|
|
220
|
+
const DISCOVERY = 100
|
|
221
|
+
|
|
203
222
|
const DEFAULT_PROPERTIES: Partial<http.Options> = {
|
|
204
223
|
authorities: {
|
|
205
224
|
nex: 'nex.toa.io'
|
|
@@ -215,6 +234,8 @@ const DEFAULT_CONFIGURATION: Record<string, object> = {
|
|
|
215
234
|
// features do not run; the variable is the local override that stands in for it
|
|
216
235
|
'realtime.streams': {},
|
|
217
236
|
'identity.basic': {},
|
|
237
|
+
'identity.clients': {},
|
|
238
|
+
'identity.grants': {},
|
|
218
239
|
'identity.federation': {},
|
|
219
240
|
'identity.otp': {},
|
|
220
241
|
'identity.passkeys': {},
|
|
@@ -16,6 +16,10 @@ setDefaultTimeout(60 * 1000)
|
|
|
16
16
|
|
|
17
17
|
process.env.TOA_DEV = '1'
|
|
18
18
|
|
|
19
|
+
// a reply is checked against what the operation declares, so the suite runs Toa under the
|
|
20
|
+
// contract it asks applications to keep
|
|
21
|
+
process.env.TOA_ENV ??= 'local'
|
|
22
|
+
|
|
19
23
|
// the gateway answers for itself, as it does in a deployment: telemetry's probe tracks the
|
|
20
24
|
// nested composition, which connects before route discovery settles
|
|
21
25
|
process.env.TOA_TELEMETRY_READY ??= JSON.stringify(false)
|
|
@@ -29,14 +33,17 @@ process.env.TOA_TELEMETRY_TRACES ??= JSON.stringify({
|
|
|
29
33
|
}
|
|
30
34
|
})
|
|
31
35
|
|
|
32
|
-
process.env.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const environment = process.env.CLOUDINARY_ENVIRONMENT
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A storage is built when a component's context is — for every scenario, not only for the ones
|
|
40
|
+
* that reach for it — and a Cloudinary storage asks for the keys of a real account. A checkout
|
|
41
|
+
* carries none, so these two are declared only where `features/steps/.env` names an environment.
|
|
42
|
+
*/
|
|
43
|
+
const CLOUDINARY = {
|
|
37
44
|
cloudinary: {
|
|
38
45
|
provider: 'cloudinary',
|
|
39
|
-
environment
|
|
46
|
+
environment,
|
|
40
47
|
type: 'image',
|
|
41
48
|
prefix: 'toa-dev',
|
|
42
49
|
transformations: [
|
|
@@ -83,7 +90,7 @@ process.env.TOA_STORAGES = JSON.stringify({
|
|
|
83
90
|
},
|
|
84
91
|
cloudinary_video: {
|
|
85
92
|
provider: 'cloudinary',
|
|
86
|
-
environment
|
|
93
|
+
environment,
|
|
87
94
|
type: 'video',
|
|
88
95
|
prefix: 'toa-dev',
|
|
89
96
|
eager: [
|
|
@@ -113,4 +120,12 @@ process.env.TOA_STORAGES = JSON.stringify({
|
|
|
113
120
|
}
|
|
114
121
|
]
|
|
115
122
|
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
process.env.TOA_STORAGES = JSON.stringify({
|
|
126
|
+
octets: {
|
|
127
|
+
provider: 'tmp',
|
|
128
|
+
directory: Math.random().toString(36).substring(2)
|
|
129
|
+
},
|
|
130
|
+
...(environment === undefined ? {} : CLOUDINARY)
|
|
116
131
|
})
|
|
@@ -44,6 +44,8 @@ export class Realtime {
|
|
|
44
44
|
|
|
45
45
|
Realtime.instance = await factory.service()
|
|
46
46
|
|
|
47
|
+
// not awaited: the routes connect to the components that produce the events, and this
|
|
48
|
+
// scenario starts the producer after the service, so the connection settles later
|
|
47
49
|
void Realtime.instance.connect()
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -152,3 +154,4 @@ export class Realtime {
|
|
|
152
154
|
}
|
|
153
155
|
}
|
|
154
156
|
}
|
|
157
|
+
|
|
@@ -5,6 +5,7 @@ storages: octets
|
|
|
5
5
|
|
|
6
6
|
operations:
|
|
7
7
|
foo: &operation
|
|
8
|
+
errors: [ERROR, NOT_FOUND]
|
|
8
9
|
input:
|
|
9
10
|
properties:
|
|
10
11
|
identity:
|
|
@@ -38,6 +39,7 @@ operations:
|
|
|
38
39
|
authority: *operation
|
|
39
40
|
identity: *operation
|
|
40
41
|
redirect:
|
|
42
|
+
errors: [ERROR]
|
|
41
43
|
input:
|
|
42
44
|
properties:
|
|
43
45
|
parameters:
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
function redirect (input) {
|
|
2
|
-
return input.parameters.type in urls ? { url: urls[input.parameters.type] } :
|
|
2
|
+
return input.parameters.type in urls ? { url: urls[input.parameters.type] } : ERR_UNKNOWN
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
// an error a caller is meant to see carries a code, always
|
|
6
|
+
const ERR_UNKNOWN = new (class UnknownError extends Error {
|
|
7
|
+
code = 'ERROR'
|
|
8
|
+
})()
|
|
9
|
+
|
|
5
10
|
const urls = {
|
|
6
11
|
'rfc': 'https://www.rfc-editor.org/rfc/rfc9564.txt',
|
|
7
12
|
'img': 'https://www.w3.org/assets/logos/w3c/w3c-no-bars.svg'
|
|
@@ -24,6 +24,7 @@ entity:
|
|
|
24
24
|
|
|
25
25
|
operations:
|
|
26
26
|
create:
|
|
27
|
+
description: Put a pot on to brew.
|
|
27
28
|
query: false
|
|
28
29
|
forward: transit
|
|
29
30
|
input:
|
|
@@ -71,6 +72,7 @@ operations:
|
|
|
71
72
|
type: number
|
|
72
73
|
type: object
|
|
73
74
|
enumerate:
|
|
75
|
+
description: Every pot there is.
|
|
74
76
|
output:
|
|
75
77
|
type: array
|
|
76
78
|
items:
|