@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,195 @@
|
|
|
1
|
+
@security
|
|
2
|
+
Feature: Client registration
|
|
3
|
+
|
|
4
|
+
A client that speaks nothing else registers what it is and is given an identifier for it.
|
|
5
|
+
The identifier is a hash of the metadata, so a client that cannot remember it registered
|
|
6
|
+
here does not leave another row every time it connects.
|
|
7
|
+
|
|
8
|
+
Background:
|
|
9
|
+
Given the `identity.clients` database is empty
|
|
10
|
+
And the `identity.basic` database contains:
|
|
11
|
+
| _id | authority | username | password |
|
|
12
|
+
| efe3a65ebbee47ed95a73edd911ea328 | nex | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
|
|
13
|
+
And the annotation:
|
|
14
|
+
"""yaml
|
|
15
|
+
authorities:
|
|
16
|
+
nex: nex.toa.io
|
|
17
|
+
oauth:
|
|
18
|
+
authorize: https://app.nex.toa.io/oauth/authorize
|
|
19
|
+
registration: open
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
Scenario: A client registers what it is
|
|
23
|
+
When the following request is received:
|
|
24
|
+
"""
|
|
25
|
+
POST /identity/clients/ HTTP/1.1
|
|
26
|
+
host: nex.toa.io
|
|
27
|
+
content-type: application/yaml
|
|
28
|
+
accept: application/yaml
|
|
29
|
+
|
|
30
|
+
client_name: Claude
|
|
31
|
+
redirect_uris:
|
|
32
|
+
- https://claude.ai/api/mcp/auth_callback
|
|
33
|
+
token_endpoint_auth_method: none
|
|
34
|
+
"""
|
|
35
|
+
Then the following reply is sent:
|
|
36
|
+
"""
|
|
37
|
+
201 Created
|
|
38
|
+
cache-control: no-store
|
|
39
|
+
|
|
40
|
+
client_id: ${{ client }}
|
|
41
|
+
client_name: Claude
|
|
42
|
+
redirect_uris:
|
|
43
|
+
- https://claude.ai/api/mcp/auth_callback
|
|
44
|
+
grant_types:
|
|
45
|
+
- authorization_code
|
|
46
|
+
response_types:
|
|
47
|
+
- code
|
|
48
|
+
token_endpoint_auth_method: none
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
Scenario: The same client is the same client
|
|
52
|
+
When the following request is received:
|
|
53
|
+
"""
|
|
54
|
+
POST /identity/clients/ HTTP/1.1
|
|
55
|
+
host: nex.toa.io
|
|
56
|
+
content-type: application/yaml
|
|
57
|
+
accept: application/yaml
|
|
58
|
+
|
|
59
|
+
client_name: Claude
|
|
60
|
+
redirect_uris:
|
|
61
|
+
- https://claude.ai/api/mcp/auth_callback
|
|
62
|
+
- http://localhost/callback
|
|
63
|
+
"""
|
|
64
|
+
Then the following reply is sent:
|
|
65
|
+
"""
|
|
66
|
+
201 Created
|
|
67
|
+
|
|
68
|
+
client_id: ${{ first }}
|
|
69
|
+
"""
|
|
70
|
+
# the same metadata, written in another order
|
|
71
|
+
When the following request is received:
|
|
72
|
+
"""
|
|
73
|
+
POST /identity/clients/ HTTP/1.1
|
|
74
|
+
host: nex.toa.io
|
|
75
|
+
content-type: application/yaml
|
|
76
|
+
accept: application/yaml
|
|
77
|
+
|
|
78
|
+
client_name: Claude
|
|
79
|
+
redirect_uris:
|
|
80
|
+
- http://localhost/callback
|
|
81
|
+
- https://claude.ai/api/mcp/auth_callback
|
|
82
|
+
"""
|
|
83
|
+
Then the following reply is sent:
|
|
84
|
+
"""
|
|
85
|
+
201 Created
|
|
86
|
+
|
|
87
|
+
client_id: ${{ first }}
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
Scenario: A redirect a code must not be sent to
|
|
91
|
+
When the following request is received:
|
|
92
|
+
"""
|
|
93
|
+
POST /identity/clients/ HTTP/1.1
|
|
94
|
+
host: nex.toa.io
|
|
95
|
+
content-type: application/yaml
|
|
96
|
+
accept: application/yaml
|
|
97
|
+
|
|
98
|
+
client_name: Insecure
|
|
99
|
+
redirect_uris:
|
|
100
|
+
- http://example.com/callback
|
|
101
|
+
"""
|
|
102
|
+
Then the following reply is sent:
|
|
103
|
+
"""
|
|
104
|
+
400 Bad Request
|
|
105
|
+
cache-control: no-store
|
|
106
|
+
|
|
107
|
+
error: invalid_redirect_uri
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
Scenario: A client that would authenticate at the token endpoint
|
|
111
|
+
When the following request is received:
|
|
112
|
+
"""
|
|
113
|
+
POST /identity/clients/ HTTP/1.1
|
|
114
|
+
host: nex.toa.io
|
|
115
|
+
content-type: application/yaml
|
|
116
|
+
accept: application/yaml
|
|
117
|
+
|
|
118
|
+
client_name: Confidential
|
|
119
|
+
redirect_uris:
|
|
120
|
+
- https://claude.ai/api/mcp/auth_callback
|
|
121
|
+
token_endpoint_auth_method: client_secret_post
|
|
122
|
+
"""
|
|
123
|
+
Then the following reply is sent:
|
|
124
|
+
"""
|
|
125
|
+
400 Bad Request
|
|
126
|
+
|
|
127
|
+
error: invalid_client_metadata
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
Scenario: Registration is advertised once it is opened
|
|
131
|
+
When the following request is received:
|
|
132
|
+
"""
|
|
133
|
+
GET /.well-known/oauth-authorization-server HTTP/1.1
|
|
134
|
+
host: nex.toa.io
|
|
135
|
+
accept: application/yaml
|
|
136
|
+
"""
|
|
137
|
+
Then the following reply is sent:
|
|
138
|
+
"""
|
|
139
|
+
200 OK
|
|
140
|
+
|
|
141
|
+
registration_endpoint: https://nex.toa.io/identity/clients/
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
Scenario: The consent page reads who is asking
|
|
145
|
+
When the following request is received:
|
|
146
|
+
"""
|
|
147
|
+
POST /identity/clients/ HTTP/1.1
|
|
148
|
+
host: nex.toa.io
|
|
149
|
+
content-type: application/yaml
|
|
150
|
+
accept: application/yaml
|
|
151
|
+
|
|
152
|
+
client_name: Claude
|
|
153
|
+
client_uri: https://claude.ai
|
|
154
|
+
redirect_uris:
|
|
155
|
+
- https://claude.ai/api/mcp/auth_callback
|
|
156
|
+
"""
|
|
157
|
+
Then the following reply is sent:
|
|
158
|
+
"""
|
|
159
|
+
201 Created
|
|
160
|
+
|
|
161
|
+
client_id: ${{ client }}
|
|
162
|
+
"""
|
|
163
|
+
# the page is authenticated by the time it asks, so this is not anonymous
|
|
164
|
+
When the following request is received:
|
|
165
|
+
"""
|
|
166
|
+
GET /identity/clients/${{ client }}/ HTTP/1.1
|
|
167
|
+
host: nex.toa.io
|
|
168
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
169
|
+
accept: application/yaml
|
|
170
|
+
"""
|
|
171
|
+
Then the following reply is sent:
|
|
172
|
+
"""
|
|
173
|
+
200 OK
|
|
174
|
+
|
|
175
|
+
client_id: ${{ client }}
|
|
176
|
+
client_name: Claude
|
|
177
|
+
client_uri: https://claude.ai
|
|
178
|
+
redirect_uris:
|
|
179
|
+
- https://claude.ai/api/mcp/auth_callback
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
Scenario: A client nobody registered
|
|
183
|
+
When the following request is received:
|
|
184
|
+
"""
|
|
185
|
+
GET /identity/clients/00000000000000000000000000000000/ HTTP/1.1
|
|
186
|
+
host: nex.toa.io
|
|
187
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
188
|
+
accept: application/yaml
|
|
189
|
+
"""
|
|
190
|
+
Then the following reply is sent:
|
|
191
|
+
"""
|
|
192
|
+
422 Unprocessable Entity
|
|
193
|
+
|
|
194
|
+
code: UNKNOWN_CLIENT
|
|
195
|
+
"""
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
@security
|
|
2
|
+
Feature: Authorization server discovery
|
|
3
|
+
|
|
4
|
+
What a client reads before it can authenticate. Both documents are public, are a
|
|
5
|
+
function of the annotation alone, and are answered before anything is routed.
|
|
6
|
+
|
|
7
|
+
Background:
|
|
8
|
+
Given the annotation:
|
|
9
|
+
"""yaml
|
|
10
|
+
authorities:
|
|
11
|
+
nex: nex.toa.io
|
|
12
|
+
oauth:
|
|
13
|
+
authorize: https://app.nex.toa.io/oauth/authorize
|
|
14
|
+
resources: ['/.mcp']
|
|
15
|
+
scopes: [app:notes]
|
|
16
|
+
mcp:
|
|
17
|
+
name: Teapots
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
Scenario: The authorization server names its endpoints
|
|
21
|
+
When the following request is received:
|
|
22
|
+
"""
|
|
23
|
+
GET /.well-known/oauth-authorization-server HTTP/1.1
|
|
24
|
+
host: nex.toa.io
|
|
25
|
+
accept: application/yaml
|
|
26
|
+
"""
|
|
27
|
+
Then the following reply is sent:
|
|
28
|
+
"""
|
|
29
|
+
200 OK
|
|
30
|
+
|
|
31
|
+
issuer: https://nex.toa.io
|
|
32
|
+
authorization_endpoint: https://app.nex.toa.io/oauth/authorize
|
|
33
|
+
token_endpoint: https://nex.toa.io/identity/grants/
|
|
34
|
+
response_types_supported:
|
|
35
|
+
- code
|
|
36
|
+
grant_types_supported:
|
|
37
|
+
- authorization_code
|
|
38
|
+
code_challenge_methods_supported:
|
|
39
|
+
- S256
|
|
40
|
+
token_endpoint_auth_methods_supported:
|
|
41
|
+
- none
|
|
42
|
+
client_id_metadata_document_supported: true
|
|
43
|
+
authorization_response_iss_parameter_supported: true
|
|
44
|
+
scopes_supported:
|
|
45
|
+
- app:notes
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
Scenario: Registration is not advertised unless it is opened
|
|
49
|
+
When the following request is received:
|
|
50
|
+
"""
|
|
51
|
+
GET /.well-known/oauth-authorization-server HTTP/1.1
|
|
52
|
+
host: nex.toa.io
|
|
53
|
+
accept: application/yaml
|
|
54
|
+
"""
|
|
55
|
+
Then the reply does not contain:
|
|
56
|
+
"""
|
|
57
|
+
registration_endpoint
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
Scenario: The protected resource is named by the path it is reached at
|
|
61
|
+
When the following request is received:
|
|
62
|
+
"""
|
|
63
|
+
GET /.well-known/oauth-protected-resource/.mcp HTTP/1.1
|
|
64
|
+
host: nex.toa.io
|
|
65
|
+
accept: application/yaml
|
|
66
|
+
"""
|
|
67
|
+
Then the following reply is sent:
|
|
68
|
+
"""
|
|
69
|
+
200 OK
|
|
70
|
+
|
|
71
|
+
resource: https://nex.toa.io/.mcp
|
|
72
|
+
authorization_servers:
|
|
73
|
+
- https://nex.toa.io
|
|
74
|
+
bearer_methods_supported:
|
|
75
|
+
- header
|
|
76
|
+
scopes_supported:
|
|
77
|
+
- app:notes
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
Scenario: The origin has a document of its own
|
|
81
|
+
When the following request is received:
|
|
82
|
+
"""
|
|
83
|
+
GET /.well-known/oauth-protected-resource HTTP/1.1
|
|
84
|
+
host: nex.toa.io
|
|
85
|
+
accept: application/yaml
|
|
86
|
+
"""
|
|
87
|
+
Then the following reply is sent:
|
|
88
|
+
"""
|
|
89
|
+
200 OK
|
|
90
|
+
|
|
91
|
+
resource: https://nex.toa.io
|
|
92
|
+
authorization_servers:
|
|
93
|
+
- https://nex.toa.io
|
|
94
|
+
bearer_methods_supported:
|
|
95
|
+
- header
|
|
96
|
+
scopes_supported:
|
|
97
|
+
- app:notes
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
Scenario: A client holding a stale token still reads discovery
|
|
101
|
+
When the following request is received:
|
|
102
|
+
"""
|
|
103
|
+
GET /.well-known/oauth-authorization-server HTTP/1.1
|
|
104
|
+
host: nex.toa.io
|
|
105
|
+
authorization: Bearer expired.and.useless
|
|
106
|
+
accept: application/yaml
|
|
107
|
+
"""
|
|
108
|
+
Then the following reply is sent:
|
|
109
|
+
"""
|
|
110
|
+
200 OK
|
|
111
|
+
|
|
112
|
+
issuer: https://nex.toa.io
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
Scenario: The challenge names the resource the request was refused at
|
|
116
|
+
When the following request is received:
|
|
117
|
+
"""
|
|
118
|
+
POST /.mcp HTTP/1.1
|
|
119
|
+
host: nex.toa.io
|
|
120
|
+
accept: text/plain
|
|
121
|
+
content-type: application/json
|
|
122
|
+
|
|
123
|
+
{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}
|
|
124
|
+
"""
|
|
125
|
+
Then the following reply is sent:
|
|
126
|
+
"""
|
|
127
|
+
401 Unauthorized
|
|
128
|
+
www-authenticate: Bearer resource_metadata="https://nex.toa.io/.well-known/oauth-protected-resource/.mcp", scope="app:notes"
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
Scenario: A host named after a property a plain object answers on its own
|
|
132
|
+
When the following request is received:
|
|
133
|
+
"""
|
|
134
|
+
GET /.well-known/oauth-authorization-server HTTP/1.1
|
|
135
|
+
host: constructor
|
|
136
|
+
accept: application/yaml
|
|
137
|
+
"""
|
|
138
|
+
Then the following reply is sent:
|
|
139
|
+
"""
|
|
140
|
+
404 Not Found
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
Scenario: An authorization server nobody annotated is not discovered
|
|
144
|
+
Given the annotation:
|
|
145
|
+
"""yaml
|
|
146
|
+
authorities:
|
|
147
|
+
nex: nex.toa.io
|
|
148
|
+
/:
|
|
149
|
+
io:output: true
|
|
150
|
+
/hello/:
|
|
151
|
+
anonymous: true
|
|
152
|
+
GET:
|
|
153
|
+
dev:stub: Hello
|
|
154
|
+
"""
|
|
155
|
+
When the following request is received:
|
|
156
|
+
"""
|
|
157
|
+
GET /.well-known/oauth-authorization-server HTTP/1.1
|
|
158
|
+
host: nex.toa.io
|
|
159
|
+
accept: application/yaml
|
|
160
|
+
"""
|
|
161
|
+
Then the following reply is sent:
|
|
162
|
+
"""
|
|
163
|
+
404 Not Found
|
|
164
|
+
"""
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
@security
|
|
2
|
+
Feature: Authorization code flow
|
|
3
|
+
|
|
4
|
+
A client is refused, finds the authorization server, registers, is consented to by a user,
|
|
5
|
+
and exchanges the code it was given for a token it can come back with. The consent page is
|
|
6
|
+
the application's own — the two calls in the background are what it would make.
|
|
7
|
+
|
|
8
|
+
Background:
|
|
9
|
+
Given the `identity.clients` database is empty
|
|
10
|
+
And the `identity.grants` database is empty
|
|
11
|
+
And the `identity.basic` database contains:
|
|
12
|
+
| _id | authority | username | password |
|
|
13
|
+
| efe3a65ebbee47ed95a73edd911ea328 | nex | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
|
|
14
|
+
And the annotation:
|
|
15
|
+
"""yaml
|
|
16
|
+
authorities:
|
|
17
|
+
nex: nex.toa.io
|
|
18
|
+
oauth:
|
|
19
|
+
authorize: https://app.nex.toa.io/oauth/authorize
|
|
20
|
+
resources: ['/.mcp']
|
|
21
|
+
registration: open
|
|
22
|
+
mcp:
|
|
23
|
+
name: Teapots
|
|
24
|
+
/:
|
|
25
|
+
io:output: true
|
|
26
|
+
/pots:
|
|
27
|
+
anyone: true
|
|
28
|
+
GET:
|
|
29
|
+
mcp:tool: Every pot there is.
|
|
30
|
+
dev:stub: Kettles and teapots.
|
|
31
|
+
"""
|
|
32
|
+
When the following request is received:
|
|
33
|
+
"""
|
|
34
|
+
POST /identity/clients/ HTTP/1.1
|
|
35
|
+
host: nex.toa.io
|
|
36
|
+
content-type: application/yaml
|
|
37
|
+
accept: application/yaml
|
|
38
|
+
|
|
39
|
+
client_name: Claude
|
|
40
|
+
redirect_uris:
|
|
41
|
+
- https://claude.ai/api/mcp/auth_callback
|
|
42
|
+
"""
|
|
43
|
+
Then the following reply is sent:
|
|
44
|
+
"""
|
|
45
|
+
201 Created
|
|
46
|
+
|
|
47
|
+
client_id: ${{ client }}
|
|
48
|
+
"""
|
|
49
|
+
When the following request is received:
|
|
50
|
+
"""
|
|
51
|
+
POST /identity/grants/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
52
|
+
host: nex.toa.io
|
|
53
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
54
|
+
content-type: application/yaml
|
|
55
|
+
accept: application/yaml
|
|
56
|
+
|
|
57
|
+
client: ${{ client }}
|
|
58
|
+
redirect: https://claude.ai/api/mcp/auth_callback
|
|
59
|
+
challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
|
|
60
|
+
method: S256
|
|
61
|
+
"""
|
|
62
|
+
Then the following reply is sent:
|
|
63
|
+
"""
|
|
64
|
+
201 Created
|
|
65
|
+
cache-control: no-store
|
|
66
|
+
|
|
67
|
+
code: ${{ code }}
|
|
68
|
+
expires_in: 60
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
Scenario: A client comes back with the token it was given
|
|
72
|
+
# nothing yet, and the client is told where to get one
|
|
73
|
+
When the following request is received:
|
|
74
|
+
"""
|
|
75
|
+
POST /.mcp HTTP/1.1
|
|
76
|
+
host: nex.toa.io
|
|
77
|
+
accept: application/yaml
|
|
78
|
+
content-type: application/json
|
|
79
|
+
|
|
80
|
+
{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}
|
|
81
|
+
"""
|
|
82
|
+
Then the following reply is sent:
|
|
83
|
+
"""
|
|
84
|
+
401 Unauthorized
|
|
85
|
+
www-authenticate: Bearer resource_metadata="https://nex.toa.io/.well-known/oauth-protected-resource/.mcp"
|
|
86
|
+
"""
|
|
87
|
+
When the following request is received:
|
|
88
|
+
"""
|
|
89
|
+
POST /identity/grants/ HTTP/1.1
|
|
90
|
+
host: nex.toa.io
|
|
91
|
+
content-type: application/x-www-form-urlencoded
|
|
92
|
+
accept: application/yaml
|
|
93
|
+
|
|
94
|
+
grant_type=authorization_code&code=${{ code }}&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk&redirect_uri=https%3A%2F%2Fclaude.ai%2Fapi%2Fmcp%2Fauth_callback&client_id=${{ client }}
|
|
95
|
+
"""
|
|
96
|
+
Then the following reply is sent:
|
|
97
|
+
"""
|
|
98
|
+
200 OK
|
|
99
|
+
cache-control: no-store
|
|
100
|
+
|
|
101
|
+
access_token: ${{ access_token }}
|
|
102
|
+
token_type: Bearer
|
|
103
|
+
"""
|
|
104
|
+
When the following request is received:
|
|
105
|
+
"""
|
|
106
|
+
POST /.mcp HTTP/1.1
|
|
107
|
+
host: nex.toa.io
|
|
108
|
+
authorization: Bearer ${{ access_token }}
|
|
109
|
+
accept: application/yaml
|
|
110
|
+
content-type: application/json
|
|
111
|
+
|
|
112
|
+
{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}
|
|
113
|
+
"""
|
|
114
|
+
Then the following reply is sent:
|
|
115
|
+
"""
|
|
116
|
+
200 OK
|
|
117
|
+
|
|
118
|
+
jsonrpc: '2.0'
|
|
119
|
+
id: 1
|
|
120
|
+
result:
|
|
121
|
+
tools:
|
|
122
|
+
- name: pots/GET
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
Scenario: A code is spent once
|
|
126
|
+
When the following request is received:
|
|
127
|
+
"""
|
|
128
|
+
POST /identity/grants/ HTTP/1.1
|
|
129
|
+
host: nex.toa.io
|
|
130
|
+
content-type: application/x-www-form-urlencoded
|
|
131
|
+
accept: application/yaml
|
|
132
|
+
|
|
133
|
+
grant_type=authorization_code&code=${{ code }}&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
|
|
134
|
+
"""
|
|
135
|
+
Then the following reply is sent:
|
|
136
|
+
"""
|
|
137
|
+
200 OK
|
|
138
|
+
"""
|
|
139
|
+
When the following request is received:
|
|
140
|
+
"""
|
|
141
|
+
POST /identity/grants/ HTTP/1.1
|
|
142
|
+
host: nex.toa.io
|
|
143
|
+
content-type: application/x-www-form-urlencoded
|
|
144
|
+
accept: application/yaml
|
|
145
|
+
|
|
146
|
+
grant_type=authorization_code&code=${{ code }}&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
|
|
147
|
+
"""
|
|
148
|
+
Then the following reply is sent:
|
|
149
|
+
"""
|
|
150
|
+
400 Bad Request
|
|
151
|
+
|
|
152
|
+
error: invalid_grant
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
Scenario: A verifier that did not make that challenge
|
|
156
|
+
When the following request is received:
|
|
157
|
+
"""
|
|
158
|
+
POST /identity/grants/ HTTP/1.1
|
|
159
|
+
host: nex.toa.io
|
|
160
|
+
content-type: application/x-www-form-urlencoded
|
|
161
|
+
accept: application/yaml
|
|
162
|
+
|
|
163
|
+
grant_type=authorization_code&code=${{ code }}&code_verifier=this-is-not-the-verifier-that-made-that-challenge
|
|
164
|
+
"""
|
|
165
|
+
Then the following reply is sent:
|
|
166
|
+
"""
|
|
167
|
+
400 Bad Request
|
|
168
|
+
|
|
169
|
+
error: invalid_grant
|
|
170
|
+
"""
|
|
171
|
+
# the code was spent trying, so guessing at it buys nothing
|
|
172
|
+
When the following request is received:
|
|
173
|
+
"""
|
|
174
|
+
POST /identity/grants/ HTTP/1.1
|
|
175
|
+
host: nex.toa.io
|
|
176
|
+
content-type: application/x-www-form-urlencoded
|
|
177
|
+
accept: application/yaml
|
|
178
|
+
|
|
179
|
+
grant_type=authorization_code&code=${{ code }}&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
|
|
180
|
+
"""
|
|
181
|
+
Then the following reply is sent:
|
|
182
|
+
"""
|
|
183
|
+
400 Bad Request
|
|
184
|
+
|
|
185
|
+
error: invalid_grant
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
Scenario: A redirect swapped between authorizing and exchanging
|
|
189
|
+
When the following request is received:
|
|
190
|
+
"""
|
|
191
|
+
POST /identity/grants/ HTTP/1.1
|
|
192
|
+
host: nex.toa.io
|
|
193
|
+
content-type: application/x-www-form-urlencoded
|
|
194
|
+
accept: application/yaml
|
|
195
|
+
|
|
196
|
+
grant_type=authorization_code&code=${{ code }}&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk&redirect_uri=https%3A%2F%2Fevil.example%2Fcallback
|
|
197
|
+
"""
|
|
198
|
+
Then the following reply is sent:
|
|
199
|
+
"""
|
|
200
|
+
400 Bad Request
|
|
201
|
+
|
|
202
|
+
error: invalid_grant
|
|
203
|
+
"""
|
|
204
|
+
|
|
205
|
+
Scenario: A grant nobody may be sent a code for
|
|
206
|
+
When the following request is received:
|
|
207
|
+
"""
|
|
208
|
+
POST /identity/grants/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
209
|
+
host: nex.toa.io
|
|
210
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
211
|
+
content-type: application/yaml
|
|
212
|
+
accept: application/yaml
|
|
213
|
+
|
|
214
|
+
client: ${{ client }}
|
|
215
|
+
redirect: https://evil.example/callback
|
|
216
|
+
challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
|
|
217
|
+
method: S256
|
|
218
|
+
"""
|
|
219
|
+
Then the following reply is sent:
|
|
220
|
+
"""
|
|
221
|
+
400 Bad Request
|
|
222
|
+
|
|
223
|
+
error: invalid_request
|
|
224
|
+
"""
|
|
225
|
+
|
|
226
|
+
Scenario: A challenge method that proves nothing
|
|
227
|
+
When the following request is received:
|
|
228
|
+
"""
|
|
229
|
+
POST /identity/grants/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
230
|
+
host: nex.toa.io
|
|
231
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
232
|
+
content-type: application/yaml
|
|
233
|
+
accept: application/yaml
|
|
234
|
+
|
|
235
|
+
client: ${{ client }}
|
|
236
|
+
redirect: https://claude.ai/api/mcp/auth_callback
|
|
237
|
+
challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
|
|
238
|
+
method: plain
|
|
239
|
+
"""
|
|
240
|
+
Then the following reply is sent:
|
|
241
|
+
"""
|
|
242
|
+
400 Bad Request
|
|
243
|
+
|
|
244
|
+
error: invalid_request
|
|
245
|
+
"""
|
|
246
|
+
|
|
247
|
+
Scenario: A grant only its own identity may see
|
|
248
|
+
When the following request is received:
|
|
249
|
+
"""
|
|
250
|
+
GET /identity/grants/00000000000000000000000000000000/ HTTP/1.1
|
|
251
|
+
host: nex.toa.io
|
|
252
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
253
|
+
accept: application/yaml
|
|
254
|
+
"""
|
|
255
|
+
Then the following reply is sent:
|
|
256
|
+
"""
|
|
257
|
+
403 Forbidden
|
|
258
|
+
"""
|
|
259
|
+
|
|
260
|
+
Scenario: Taking back what was allowed
|
|
261
|
+
When the following request is received:
|
|
262
|
+
"""
|
|
263
|
+
POST /identity/grants/ HTTP/1.1
|
|
264
|
+
host: nex.toa.io
|
|
265
|
+
content-type: application/x-www-form-urlencoded
|
|
266
|
+
accept: application/yaml
|
|
267
|
+
|
|
268
|
+
grant_type=authorization_code&code=${{ code }}&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
|
|
269
|
+
"""
|
|
270
|
+
Then the following reply is sent:
|
|
271
|
+
"""
|
|
272
|
+
200 OK
|
|
273
|
+
|
|
274
|
+
access_token: ${{ access_token }}
|
|
275
|
+
"""
|
|
276
|
+
When the following request is received:
|
|
277
|
+
"""
|
|
278
|
+
GET /identity/grants/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
279
|
+
host: nex.toa.io
|
|
280
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
281
|
+
accept: application/yaml
|
|
282
|
+
"""
|
|
283
|
+
Then the following reply is sent:
|
|
284
|
+
"""
|
|
285
|
+
200 OK
|
|
286
|
+
|
|
287
|
+
- id: ${{ grant }}
|
|
288
|
+
client: ${{ client }}
|
|
289
|
+
"""
|
|
290
|
+
When the following request is received:
|
|
291
|
+
"""
|
|
292
|
+
DELETE /identity/grants/efe3a65ebbee47ed95a73edd911ea328/${{ grant }}/ HTTP/1.1
|
|
293
|
+
host: nex.toa.io
|
|
294
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
295
|
+
"""
|
|
296
|
+
Then the following reply is sent:
|
|
297
|
+
"""
|
|
298
|
+
204 No Content
|
|
299
|
+
"""
|