@toa.io/extensions.exposition 1.0.0-alpha.2 → 1.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/identity.bans/manifest.toa.yaml +15 -6
- package/components/identity.bans/operations/transit.d.ts +14 -0
- package/components/identity.bans/operations/transit.js +11 -0
- package/components/identity.bans/operations/transit.js.map +1 -0
- package/components/identity.bans/operations/tsconfig.tsbuildinfo +1 -0
- package/components/identity.bans/source/transit.ts +21 -0
- package/components/identity.bans/tsconfig.json +9 -0
- package/components/identity.basic/manifest.toa.yaml +5 -1
- package/components/identity.basic/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/manifest.toa.yaml +13 -7
- package/components/identity.federation/operations/authenticate.js +4 -4
- package/components/identity.federation/operations/authenticate.js.map +1 -1
- package/components/identity.federation/operations/create.js +4 -4
- package/components/identity.federation/operations/create.js.map +1 -1
- package/components/identity.federation/operations/{assertions-as-values.cjs → lib/assertions-as-values.js} +1 -1
- package/components/identity.federation/operations/lib/assertions-as-values.js.map +1 -0
- package/components/identity.federation/operations/{jwt.d.cts → lib/jwt.d.ts} +5 -4
- package/components/identity.federation/operations/{jwt.cjs → lib/jwt.js} +35 -11
- package/components/identity.federation/operations/lib/jwt.js.map +1 -0
- package/components/identity.federation/operations/schemas.d.ts +16 -0
- package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/types.d.ts +1 -1
- package/components/identity.federation/source/authenticate.ts +2 -2
- package/components/identity.federation/source/create.ts +2 -2
- package/components/identity.federation/source/{assertions-as-values.cts → lib/assertions-as-values.ts} +1 -2
- package/components/identity.federation/source/lib/jwt.test.ts +56 -0
- package/components/identity.federation/source/{jwt.cts → lib/jwt.ts} +57 -29
- package/components/identity.federation/source/schemas.ts +16 -0
- package/components/identity.federation/source/types.ts +1 -1
- package/components/identity.federation/tsconfig.json +2 -2
- package/components/identity.roles/manifest.toa.yaml +18 -5
- package/components/identity.roles/operations/grant.d.ts +10 -0
- package/components/identity.roles/operations/grant.js +21 -0
- package/components/identity.roles/operations/grant.js.map +1 -0
- package/components/identity.roles/operations/lib/Entity.d.ts +5 -0
- package/components/identity.roles/operations/lib/Entity.js +3 -0
- package/components/identity.roles/operations/lib/Entity.js.map +1 -0
- package/components/identity.roles/operations/list.d.ts +1 -4
- package/components/identity.roles/operations/list.js.map +1 -1
- package/components/identity.roles/operations/principal.d.ts +4 -6
- package/components/identity.roles/operations/principal.js +6 -1
- package/components/identity.roles/operations/principal.js.map +1 -1
- package/components/identity.roles/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.roles/source/grant.ts +32 -0
- package/components/identity.roles/source/lib/Entity.ts +5 -0
- package/components/identity.roles/source/list.ts +2 -4
- package/components/identity.roles/source/principal.ts +10 -8
- package/components/identity.tokens/manifest.toa.yaml +12 -3
- package/components/identity.tokens/operations/authenticate.js +5 -2
- package/components/identity.tokens/operations/authenticate.js.map +1 -1
- package/components/identity.tokens/operations/encrypt.js +4 -1
- package/components/identity.tokens/operations/encrypt.js.map +1 -1
- package/components/identity.tokens/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.tokens/operations/types.d.ts +1 -2
- package/components/identity.tokens/receivers/identity.bans.created.js +3 -0
- package/components/identity.tokens/source/authenticate.ts +5 -2
- package/components/identity.tokens/source/encrypt.test.ts +22 -1
- package/components/identity.tokens/source/encrypt.ts +4 -1
- package/components/identity.tokens/source/types.ts +1 -2
- package/components/octets.storage/operations/store.js +1 -1
- package/documentation/access.md +27 -16
- package/documentation/cache.md +8 -1
- package/documentation/components.md +55 -23
- package/documentation/identity.md +7 -0
- package/documentation/io.md +56 -0
- package/documentation/octets.md +12 -0
- package/documentation/protocol.md +3 -0
- package/documentation/query.md +50 -5
- package/documentation/require.md +15 -0
- package/documentation/tree.md +22 -4
- package/documentation/vary.md +9 -3
- package/features/access.feature +28 -49
- package/features/annotation.feature +1 -0
- package/features/body.feature +3 -1
- package/features/cache.feature +39 -0
- package/features/cors.feature +2 -2
- package/features/directives.feature +2 -0
- package/features/dynamic.feature +14 -7
- package/features/errors.feature +7 -4
- package/features/etag.feature +97 -0
- package/features/identity.bans.feature +128 -0
- package/features/identity.basic.feature +68 -3
- package/features/identity.federation.feature +78 -5
- package/features/identity.roles.feature +205 -1
- package/features/identity.tokens.feature +98 -0
- package/features/io.feature +196 -0
- package/features/octets.entries.feature +3 -1
- package/features/octets.feature +32 -10
- package/features/octets.meta.feature +4 -3
- package/features/octets.workflows.feature +39 -0
- package/features/queries.feature +9 -1
- package/features/require.feature +64 -0
- package/features/response.feature +7 -1
- package/features/routes.feature +17 -10
- package/features/steps/Database.ts +17 -10
- package/features/steps/Gateway.ts +3 -0
- package/features/steps/IdP.ts +55 -21
- package/features/steps/components/echo/manifest.toa.yaml +5 -0
- package/features/steps/components/echo/operations/identity.js +7 -0
- package/features/steps/components/greeter/manifest.toa.yaml +1 -0
- package/features/steps/components/octets.tester/manifest.toa.yaml +1 -0
- package/features/steps/components/pots/manifest.toa.yaml +12 -3
- package/features/steps/components/sequences/manifest.toa.yaml +1 -0
- package/features/steps/components/users.properties/manifest.toa.yaml +2 -1
- package/features/timing.feature +66 -0
- package/features/vary.feature +56 -3
- package/package.json +13 -14
- package/readme.md +7 -6
- package/schemas/annotation.cos.yaml +1 -0
- package/schemas/io/input.cos.yaml +3 -0
- package/schemas/io/message.cos.yaml +5 -0
- package/schemas/io/output.cos.yaml +5 -0
- package/schemas/octets/workflow.cos.yaml +12 -0
- package/schemas/querystring.cos.yaml +1 -0
- package/source/Annotation.ts +1 -0
- package/source/Context.ts +6 -4
- package/source/Directive.test.ts +7 -7
- package/source/Directive.ts +19 -46
- package/source/Endpoint.ts +53 -6
- package/source/Factory.ts +17 -7
- package/source/Gateway.ts +40 -51
- package/source/HTTP/Context.ts +67 -0
- package/source/HTTP/Server.test.ts +1 -1
- package/source/HTTP/Server.ts +61 -96
- package/source/HTTP/Timing.ts +40 -0
- package/source/HTTP/exceptions.ts +1 -1
- package/source/HTTP/index.ts +1 -0
- package/source/HTTP/messages.test.ts +27 -8
- package/source/HTTP/messages.ts +32 -48
- package/source/Mapping.ts +7 -8
- package/source/RTD/Context.ts +7 -10
- package/source/RTD/Directives.ts +28 -4
- package/source/RTD/Endpoint.ts +6 -4
- package/source/RTD/Match.ts +2 -7
- package/source/RTD/Method.ts +7 -13
- package/source/RTD/Node.ts +13 -14
- package/source/RTD/Tree.ts +17 -16
- package/source/RTD/factory.ts +3 -6
- package/source/Tenant.ts +0 -8
- package/source/deployment.ts +6 -0
- package/source/directives/auth/Anonymous.ts +3 -2
- package/source/directives/auth/Authorization.ts +17 -14
- package/source/directives/auth/Delegate.ts +35 -0
- package/source/directives/auth/Incept.ts +11 -6
- package/source/directives/auth/Role.test.ts +53 -6
- package/source/directives/auth/Role.ts +27 -17
- package/source/directives/auth/Scheme.ts +2 -2
- package/source/directives/auth/types.ts +1 -1
- package/source/directives/cache/Cache.ts +5 -5
- package/source/directives/cache/Control.ts +48 -22
- package/source/directives/cache/types.ts +1 -1
- package/source/directives/cors/CORS.ts +18 -10
- package/source/directives/dev/Development.ts +4 -4
- package/source/directives/index.ts +6 -4
- package/source/directives/io/Directive.ts +11 -0
- package/source/directives/io/IO.ts +43 -0
- package/source/directives/io/Input.ts +50 -0
- package/source/directives/io/Message.ts +1 -0
- package/source/directives/io/Output.ts +69 -0
- package/source/directives/io/index.ts +3 -0
- package/source/directives/io/schemas.ts +12 -0
- package/source/directives/octets/Context.ts +5 -4
- package/source/directives/octets/Delete.ts +25 -13
- package/source/directives/octets/Directive.ts +10 -0
- package/source/directives/octets/Fetch.ts +33 -17
- package/source/directives/octets/List.ts +18 -8
- package/source/directives/octets/Octets.ts +12 -8
- package/source/directives/octets/Permute.ts +16 -9
- package/source/directives/octets/Store.ts +43 -19
- package/source/directives/octets/Workflow.ts +48 -0
- package/source/directives/octets/schemas.test.ts +21 -0
- package/source/directives/octets/schemas.ts +2 -0
- package/source/directives/octets/types.ts +0 -7
- package/source/directives/octets/{workflow → workflows}/Execution.ts +0 -2
- package/source/directives/octets/{workflow → workflows}/Workflow.ts +2 -2
- package/source/directives/require/Directive.ts +5 -0
- package/source/directives/require/Headers.ts +20 -0
- package/source/directives/require/Require.ts +28 -0
- package/source/directives/require/index.ts +3 -0
- package/source/directives/vary/Directive.ts +2 -1
- package/source/directives/vary/Embed.ts +14 -8
- package/source/directives/vary/Vary.ts +8 -6
- package/source/directives/vary/embeddings/Embedding.ts +2 -1
- package/source/directives/vary/embeddings/Header.ts +9 -7
- package/source/directives/vary/embeddings/Language.ts +2 -2
- package/source/directives/vary/embeddings/Parameter.ts +14 -0
- package/source/directives/vary/embeddings/index.ts +3 -3
- package/source/exceptions.ts +22 -11
- package/source/io.ts +2 -2
- package/source/root.ts +5 -0
- package/transpiled/Annotation.d.ts +1 -0
- package/transpiled/Context.d.ts +6 -4
- package/transpiled/Directive.d.ts +8 -21
- package/transpiled/Directive.js +11 -14
- package/transpiled/Directive.js.map +1 -1
- package/transpiled/Endpoint.d.ts +7 -5
- package/transpiled/Endpoint.js +58 -2
- package/transpiled/Endpoint.js.map +1 -1
- package/transpiled/Factory.js +8 -2
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Gateway.d.ts +4 -8
- package/transpiled/Gateway.js +23 -33
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/Context.d.ts +24 -0
- package/transpiled/HTTP/Context.js +47 -0
- package/transpiled/HTTP/Context.js.map +1 -0
- package/transpiled/HTTP/Server.d.ts +8 -7
- package/transpiled/HTTP/Server.js +69 -77
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/HTTP/Timing.d.ts +10 -0
- package/transpiled/HTTP/Timing.js +29 -0
- package/transpiled/HTTP/Timing.js.map +1 -0
- package/transpiled/HTTP/exceptions.d.ts +1 -1
- package/transpiled/HTTP/exceptions.js.map +1 -1
- package/transpiled/HTTP/index.d.ts +1 -0
- package/transpiled/HTTP/index.js +1 -0
- package/transpiled/HTTP/index.js.map +1 -1
- package/transpiled/HTTP/messages.d.ts +7 -21
- package/transpiled/HTTP/messages.js +24 -26
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/Mapping.js +7 -7
- package/transpiled/Mapping.js.map +1 -1
- package/transpiled/RTD/Context.d.ts +7 -6
- package/transpiled/RTD/Directives.d.ts +19 -4
- package/transpiled/RTD/Endpoint.d.ts +6 -4
- package/transpiled/RTD/Match.d.ts +2 -4
- package/transpiled/RTD/Method.d.ts +7 -7
- package/transpiled/RTD/Method.js.map +1 -1
- package/transpiled/RTD/Node.d.ts +4 -6
- package/transpiled/RTD/Node.js +2 -1
- package/transpiled/RTD/Node.js.map +1 -1
- package/transpiled/RTD/Tree.d.ts +6 -6
- package/transpiled/RTD/Tree.js +4 -1
- package/transpiled/RTD/Tree.js.map +1 -1
- package/transpiled/RTD/factory.d.ts +2 -4
- package/transpiled/RTD/factory.js +1 -1
- package/transpiled/RTD/factory.js.map +1 -1
- package/transpiled/Tenant.d.ts +0 -1
- package/transpiled/Tenant.js +0 -6
- package/transpiled/Tenant.js.map +1 -1
- package/transpiled/deployment.js +5 -0
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/directives/auth/Anonymous.js +3 -4
- package/transpiled/directives/auth/Anonymous.js.map +1 -1
- package/transpiled/directives/auth/Authorization.d.ts +2 -3
- package/transpiled/directives/auth/Authorization.js +10 -8
- package/transpiled/directives/auth/Authorization.js.map +1 -1
- package/transpiled/directives/auth/Delegate.d.ts +8 -0
- package/transpiled/directives/auth/Delegate.js +29 -0
- package/transpiled/directives/auth/Delegate.js.map +1 -0
- package/transpiled/directives/auth/Incept.d.ts +1 -1
- package/transpiled/directives/auth/Incept.js +11 -6
- package/transpiled/directives/auth/Incept.js.map +1 -1
- package/transpiled/directives/auth/Role.d.ts +4 -1
- package/transpiled/directives/auth/Role.js +25 -17
- package/transpiled/directives/auth/Role.js.map +1 -1
- package/transpiled/directives/auth/Scheme.js +2 -2
- package/transpiled/directives/auth/Scheme.js.map +1 -1
- package/transpiled/directives/cache/Cache.d.ts +3 -3
- package/transpiled/directives/cache/Cache.js +3 -3
- package/transpiled/directives/cache/Cache.js.map +1 -1
- package/transpiled/directives/cache/Control.d.ts +5 -4
- package/transpiled/directives/cache/Control.js +32 -15
- package/transpiled/directives/cache/Control.js.map +1 -1
- package/transpiled/directives/cache/types.d.ts +1 -1
- package/transpiled/directives/cors/CORS.d.ts +2 -3
- package/transpiled/directives/cors/CORS.js +17 -10
- package/transpiled/directives/cors/CORS.js.map +1 -1
- package/transpiled/directives/dev/Development.d.ts +3 -3
- package/transpiled/directives/dev/Development.js +1 -1
- package/transpiled/directives/dev/Development.js.map +1 -1
- package/transpiled/directives/index.d.ts +2 -2
- package/transpiled/directives/index.js +5 -3
- package/transpiled/directives/index.js.map +1 -1
- package/transpiled/directives/io/Directive.d.ts +8 -0
- package/transpiled/directives/io/Directive.js +3 -0
- package/transpiled/directives/io/Directive.js.map +1 -0
- package/transpiled/directives/io/IO.d.ts +9 -0
- package/transpiled/directives/io/IO.js +33 -0
- package/transpiled/directives/io/IO.js.map +1 -0
- package/transpiled/directives/io/Input.d.ts +11 -0
- package/transpiled/directives/io/Input.js +63 -0
- package/transpiled/directives/io/Input.js.map +1 -0
- package/transpiled/directives/io/Message.d.ts +1 -0
- package/transpiled/directives/io/Message.js +3 -0
- package/transpiled/directives/io/Message.js.map +1 -0
- package/transpiled/directives/io/Output.d.ts +13 -0
- package/transpiled/directives/io/Output.js +76 -0
- package/transpiled/directives/io/Output.js.map +1 -0
- package/transpiled/directives/io/index.d.ts +2 -0
- package/transpiled/directives/io/index.js +6 -0
- package/transpiled/directives/io/index.js.map +1 -0
- package/transpiled/directives/io/schemas.d.ts +7 -0
- package/transpiled/directives/io/schemas.js +14 -0
- package/transpiled/directives/io/schemas.js.map +1 -0
- package/transpiled/directives/octets/Context.d.ts +4 -4
- package/transpiled/directives/octets/Context.js +4 -2
- package/transpiled/directives/octets/Context.js.map +1 -1
- package/transpiled/directives/octets/Delete.d.ts +5 -4
- package/transpiled/directives/octets/Delete.js +24 -12
- package/transpiled/directives/octets/Delete.js.map +1 -1
- package/transpiled/directives/octets/Directive.d.ts +8 -0
- package/transpiled/directives/octets/Directive.js +8 -0
- package/transpiled/directives/octets/Directive.js.map +1 -0
- package/transpiled/directives/octets/Fetch.d.ts +4 -3
- package/transpiled/directives/octets/Fetch.js +31 -15
- package/transpiled/directives/octets/Fetch.js.map +1 -1
- package/transpiled/directives/octets/List.d.ts +4 -3
- package/transpiled/directives/octets/List.js +16 -7
- package/transpiled/directives/octets/List.js.map +1 -1
- package/transpiled/directives/octets/Octets.d.ts +4 -4
- package/transpiled/directives/octets/Octets.js +8 -4
- package/transpiled/directives/octets/Octets.js.map +1 -1
- package/transpiled/directives/octets/Permute.d.ts +4 -3
- package/transpiled/directives/octets/Permute.js +14 -7
- package/transpiled/directives/octets/Permute.js.map +1 -1
- package/transpiled/directives/octets/Store.d.ts +6 -4
- package/transpiled/directives/octets/Store.js +28 -13
- package/transpiled/directives/octets/Store.js.map +1 -1
- package/transpiled/directives/octets/Workflow.d.ts +15 -0
- package/transpiled/directives/octets/Workflow.js +59 -0
- package/transpiled/directives/octets/Workflow.js.map +1 -0
- package/transpiled/directives/octets/schemas.d.ts +2 -0
- package/transpiled/directives/octets/schemas.js +2 -1
- package/transpiled/directives/octets/schemas.js.map +1 -1
- package/transpiled/directives/octets/types.d.ts +0 -5
- package/transpiled/directives/octets/{workflow → workflows}/Execution.js +0 -1
- package/transpiled/directives/octets/workflows/Execution.js.map +1 -0
- package/transpiled/directives/octets/{workflow → workflows}/Workflow.d.ts +1 -1
- package/transpiled/directives/octets/{workflow → workflows}/Workflow.js +2 -2
- package/transpiled/directives/octets/workflows/Workflow.js.map +1 -0
- package/transpiled/directives/octets/workflows/index.js.map +1 -0
- package/transpiled/directives/require/Directive.d.ts +4 -0
- package/transpiled/directives/require/Directive.js +3 -0
- package/transpiled/directives/require/Directive.js.map +1 -0
- package/transpiled/directives/require/Headers.d.ts +7 -0
- package/transpiled/directives/require/Headers.js +19 -0
- package/transpiled/directives/require/Headers.js.map +1 -0
- package/transpiled/directives/require/Require.d.ts +9 -0
- package/transpiled/directives/require/Require.js +27 -0
- package/transpiled/directives/require/Require.js.map +1 -0
- package/transpiled/directives/require/index.d.ts +2 -0
- package/transpiled/directives/require/index.js +6 -0
- package/transpiled/directives/require/index.js.map +1 -0
- package/transpiled/directives/vary/Directive.d.ts +2 -1
- package/transpiled/directives/vary/Embed.d.ts +2 -1
- package/transpiled/directives/vary/Embed.js +8 -6
- package/transpiled/directives/vary/Embed.js.map +1 -1
- package/transpiled/directives/vary/Vary.d.ts +3 -3
- package/transpiled/directives/vary/Vary.js +4 -4
- package/transpiled/directives/vary/Vary.js.map +1 -1
- package/transpiled/directives/vary/embeddings/Embedding.d.ts +2 -1
- package/transpiled/directives/vary/embeddings/Header.js +9 -7
- package/transpiled/directives/vary/embeddings/Header.js.map +1 -1
- package/transpiled/directives/vary/embeddings/Language.js +2 -2
- package/transpiled/directives/vary/embeddings/Language.js.map +1 -1
- package/transpiled/directives/vary/embeddings/Parameter.d.ts +7 -0
- package/transpiled/directives/vary/embeddings/Parameter.js +14 -0
- package/transpiled/directives/vary/embeddings/Parameter.js.map +1 -0
- package/transpiled/directives/vary/embeddings/index.d.ts +2 -2
- package/transpiled/directives/vary/embeddings/index.js +5 -3
- package/transpiled/directives/vary/embeddings/index.js.map +1 -1
- package/transpiled/exceptions.d.ts +3 -2
- package/transpiled/exceptions.js +13 -7
- package/transpiled/exceptions.js.map +1 -1
- package/transpiled/io.d.ts +2 -2
- package/transpiled/root.js +5 -0
- package/transpiled/root.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/assertions-as-values.cjs.map +0 -1
- package/components/identity.federation/operations/jwt.cjs.map +0 -1
- package/source/HTTP/Server.fixtures.ts +0 -40
- package/transpiled/HTTP/Server.fixtures.d.ts +0 -10
- package/transpiled/HTTP/Server.fixtures.js +0 -31
- package/transpiled/HTTP/Server.fixtures.js.map +0 -1
- package/transpiled/directives/octets/workflow/Execution.js.map +0 -1
- package/transpiled/directives/octets/workflow/Workflow.js.map +0 -1
- package/transpiled/directives/octets/workflow/index.js.map +0 -1
- /package/components/identity.federation/operations/{assertions-as-values.d.cts → lib/assertions-as-values.d.ts} +0 -0
- /package/source/directives/octets/{workflow → workflows}/index.ts +0 -0
- /package/transpiled/directives/octets/{workflow → workflows}/Execution.d.ts +0 -0
- /package/transpiled/directives/octets/{workflow → workflows}/index.d.ts +0 -0
- /package/transpiled/directives/octets/{workflow → workflows}/index.js +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
@security
|
|
1
2
|
Feature: Roles management
|
|
2
3
|
|
|
3
|
-
Scenario:
|
|
4
|
+
Scenario: Granting a role to an Identity
|
|
5
|
+
# root:secret
|
|
6
|
+
# user:pass
|
|
4
7
|
Given the `identity.basic` database contains:
|
|
5
8
|
| _id | username | password |
|
|
6
9
|
| 72cf9b0ab0ac4ab2b8036e4e940ddcae | root | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
|
|
@@ -11,6 +14,7 @@ Feature: Roles management
|
|
|
11
14
|
And the annotation:
|
|
12
15
|
"""yaml
|
|
13
16
|
/:
|
|
17
|
+
io:output: true
|
|
14
18
|
auth:role: test
|
|
15
19
|
GET:
|
|
16
20
|
dev:stub:
|
|
@@ -31,6 +35,7 @@ Feature: Roles management
|
|
|
31
35
|
"""
|
|
32
36
|
POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
|
|
33
37
|
authorization: Basic cm9vdDpzZWNyZXQ=
|
|
38
|
+
accept: application/yaml
|
|
34
39
|
content-type: application/yaml
|
|
35
40
|
|
|
36
41
|
role: test
|
|
@@ -38,6 +43,8 @@ Feature: Roles management
|
|
|
38
43
|
Then the following reply is sent:
|
|
39
44
|
"""
|
|
40
45
|
201 Created
|
|
46
|
+
|
|
47
|
+
grantor: 72cf9b0ab0ac4ab2b8036e4e940ddcae
|
|
41
48
|
"""
|
|
42
49
|
When the following request is received:
|
|
43
50
|
# user now have the role
|
|
@@ -49,3 +56,200 @@ Feature: Roles management
|
|
|
49
56
|
"""
|
|
50
57
|
200 OK
|
|
51
58
|
"""
|
|
59
|
+
|
|
60
|
+
Scenario Outline: Delegating roles
|
|
61
|
+
# moderator:secret
|
|
62
|
+
# assistant:pass
|
|
63
|
+
Given the `identity.basic` database contains:
|
|
64
|
+
| _id | username | password |
|
|
65
|
+
| 72cf9b0ab0ac4ab2b8036e4e940ddcae | moderator | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
|
|
66
|
+
| 4344518184ad44228baffce7a44fd0b1 | assistant | $2b$10$JoiAQUS7tzobDAFIDBWhWeEIJv933dQetyjRzSmfQGaJE5ZlJbmYy |
|
|
67
|
+
And the `identity.roles` database contains:
|
|
68
|
+
| _id | identity | role |
|
|
69
|
+
| 9c4702490ff84f2a9e1b1da2ab64bdd4 | 72cf9b0ab0ac4ab2b8036e4e940ddcae | system:identity:roles:delegation |
|
|
70
|
+
| 30c969e05ff6437097ed5f07fc52358e | 72cf9b0ab0ac4ab2b8036e4e940ddcae | app:moderation |
|
|
71
|
+
And the annotation:
|
|
72
|
+
"""yaml
|
|
73
|
+
/:
|
|
74
|
+
io:output: true
|
|
75
|
+
auth:role: app:moderation:photos
|
|
76
|
+
GET:
|
|
77
|
+
dev:stub:
|
|
78
|
+
access: granted!
|
|
79
|
+
"""
|
|
80
|
+
When the following request is received:
|
|
81
|
+
# assistant doesn't have the required role
|
|
82
|
+
"""
|
|
83
|
+
GET / HTTP/1.1
|
|
84
|
+
authorization: Basic YXNzaXN0YW50OnBhc3M=
|
|
85
|
+
"""
|
|
86
|
+
Then the following reply is sent:
|
|
87
|
+
"""
|
|
88
|
+
403 Forbidden
|
|
89
|
+
"""
|
|
90
|
+
When the following request is received:
|
|
91
|
+
# moderator delegates a role to an assistant
|
|
92
|
+
"""
|
|
93
|
+
POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
|
|
94
|
+
authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
|
|
95
|
+
content-type: application/yaml
|
|
96
|
+
|
|
97
|
+
role: <role>
|
|
98
|
+
"""
|
|
99
|
+
Then the following reply is sent:
|
|
100
|
+
"""
|
|
101
|
+
201 Created
|
|
102
|
+
"""
|
|
103
|
+
When the following request is received:
|
|
104
|
+
# assistant has access
|
|
105
|
+
"""
|
|
106
|
+
GET / HTTP/1.1
|
|
107
|
+
authorization: Basic YXNzaXN0YW50OnBhc3M=
|
|
108
|
+
"""
|
|
109
|
+
Then the following reply is sent:
|
|
110
|
+
"""
|
|
111
|
+
200 OK
|
|
112
|
+
"""
|
|
113
|
+
Examples:
|
|
114
|
+
| role |
|
|
115
|
+
| app:moderation |
|
|
116
|
+
| app:moderation:photos |
|
|
117
|
+
|
|
118
|
+
Scenario: Delegating role out of own scope
|
|
119
|
+
Given the `identity.basic` database contains:
|
|
120
|
+
| _id | username | password |
|
|
121
|
+
| 72cf9b0ab0ac4ab2b8036e4e940ddcae | moderator | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
|
|
122
|
+
| 4344518184ad44228baffce7a44fd0b1 | assistant | $2b$10$JoiAQUS7tzobDAFIDBWhWeEIJv933dQetyjRzSmfQGaJE5ZlJbmYy |
|
|
123
|
+
And the `identity.roles` database contains:
|
|
124
|
+
| _id | identity | role |
|
|
125
|
+
| 9c4702490ff84f2a9e1b1da2ab64bdd4 | 72cf9b0ab0ac4ab2b8036e4e940ddcae | system:identity:roles:delegation |
|
|
126
|
+
| 30c969e05ff6437097ed5f07fc52358e | 72cf9b0ab0ac4ab2b8036e4e940ddcae | app:moderation |
|
|
127
|
+
And the annotation:
|
|
128
|
+
"""yaml
|
|
129
|
+
/:
|
|
130
|
+
io:output: true
|
|
131
|
+
auth:role: app:moderation:photos
|
|
132
|
+
GET:
|
|
133
|
+
dev:stub:
|
|
134
|
+
access: granted!
|
|
135
|
+
"""
|
|
136
|
+
When the following request is received:
|
|
137
|
+
"""
|
|
138
|
+
POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
|
|
139
|
+
accept: application/yaml
|
|
140
|
+
content-type: application/yaml
|
|
141
|
+
authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
|
|
142
|
+
|
|
143
|
+
role: app:finance
|
|
144
|
+
"""
|
|
145
|
+
Then the following reply is sent:
|
|
146
|
+
"""
|
|
147
|
+
409 Conflict
|
|
148
|
+
|
|
149
|
+
code: OUT_OF_SCOPE
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
Scenario: Delegating role without `system:identity:roles:delegation` role
|
|
153
|
+
Given the `identity.basic` database contains:
|
|
154
|
+
| _id | username | password |
|
|
155
|
+
| 72cf9b0ab0ac4ab2b8036e4e940ddcae | moderator | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
|
|
156
|
+
| 4344518184ad44228baffce7a44fd0b1 | assistant | $2b$10$JoiAQUS7tzobDAFIDBWhWeEIJv933dQetyjRzSmfQGaJE5ZlJbmYy |
|
|
157
|
+
And the `identity.roles` database contains:
|
|
158
|
+
| _id | identity | role |
|
|
159
|
+
| 30c969e05ff6437097ed5f07fc52358e | 72cf9b0ab0ac4ab2b8036e4e940ddcae | app:moderation |
|
|
160
|
+
And the annotation:
|
|
161
|
+
"""yaml
|
|
162
|
+
/:
|
|
163
|
+
io:output: true
|
|
164
|
+
auth:role: app:moderation:photos
|
|
165
|
+
GET:
|
|
166
|
+
dev:stub:
|
|
167
|
+
access: granted!
|
|
168
|
+
"""
|
|
169
|
+
When the following request is received:
|
|
170
|
+
"""
|
|
171
|
+
POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
|
|
172
|
+
content-type: application/yaml
|
|
173
|
+
authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
|
|
174
|
+
|
|
175
|
+
role: app:moderation
|
|
176
|
+
"""
|
|
177
|
+
Then the following reply is sent:
|
|
178
|
+
"""
|
|
179
|
+
403 Forbidden
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
Scenario Outline: Invalid role name
|
|
183
|
+
Given the `identity.basic` database contains:
|
|
184
|
+
| _id | username | password |
|
|
185
|
+
| 72cf9b0ab0ac4ab2b8036e4e940ddcae | root | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
|
|
186
|
+
And the `identity.roles` database contains:
|
|
187
|
+
| _id | identity | role |
|
|
188
|
+
| 9c4702490ff84f2a9e1b1da2ab64bdd4 | 72cf9b0ab0ac4ab2b8036e4e940ddcae | system:identity:roles |
|
|
189
|
+
When the following request is received:
|
|
190
|
+
# root adds a role to a user
|
|
191
|
+
"""
|
|
192
|
+
POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
|
|
193
|
+
authorization: Basic cm9vdDpzZWNyZXQ=
|
|
194
|
+
content-type: application/yaml
|
|
195
|
+
|
|
196
|
+
role: <role>
|
|
197
|
+
"""
|
|
198
|
+
Then the following reply is sent:
|
|
199
|
+
"""
|
|
200
|
+
400 Bad Request
|
|
201
|
+
"""
|
|
202
|
+
Examples:
|
|
203
|
+
| role |
|
|
204
|
+
| app! |
|
|
205
|
+
| app: |
|
|
206
|
+
| app:no spaces |
|
|
207
|
+
|
|
208
|
+
Scenario: Dynamic roles
|
|
209
|
+
Given the `identity.basic` database contains:
|
|
210
|
+
| _id | username | password |
|
|
211
|
+
| 72cf9b0ab0ac4ab2b8036e4e940ddcae | moderator | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
|
|
212
|
+
And the `identity.roles` database contains:
|
|
213
|
+
| _id | identity | role |
|
|
214
|
+
| 30c969e05ff6437097ed5f07fc52358e | 72cf9b0ab0ac4ab2b8036e4e940ddcae | app:29e54ae1:moderation |
|
|
215
|
+
And the annotation:
|
|
216
|
+
"""yaml
|
|
217
|
+
/:
|
|
218
|
+
/broken:
|
|
219
|
+
auth:role: app:{org}:moderation
|
|
220
|
+
GET:
|
|
221
|
+
dev:stub: never
|
|
222
|
+
/:org:
|
|
223
|
+
io:output: true
|
|
224
|
+
auth:role: app:{org}:moderation
|
|
225
|
+
GET:
|
|
226
|
+
dev:stub:
|
|
227
|
+
access: granted!
|
|
228
|
+
"""
|
|
229
|
+
When the following request is received:
|
|
230
|
+
"""
|
|
231
|
+
GET /29e54ae1/ HTTP/1.1
|
|
232
|
+
authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
|
|
233
|
+
"""
|
|
234
|
+
Then the following reply is sent:
|
|
235
|
+
"""
|
|
236
|
+
200 OK
|
|
237
|
+
"""
|
|
238
|
+
When the following request is received:
|
|
239
|
+
"""
|
|
240
|
+
GET /88584c9b/ HTTP/1.1
|
|
241
|
+
authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
|
|
242
|
+
"""
|
|
243
|
+
Then the following reply is sent:
|
|
244
|
+
"""
|
|
245
|
+
403 Forbidden
|
|
246
|
+
"""
|
|
247
|
+
When the following request is received:
|
|
248
|
+
"""
|
|
249
|
+
GET /broken/ HTTP/1.1
|
|
250
|
+
authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
|
|
251
|
+
"""
|
|
252
|
+
Then the following reply is sent:
|
|
253
|
+
"""
|
|
254
|
+
500 Internal Server Error
|
|
255
|
+
"""
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@security
|
|
1
2
|
Feature: Tokens lifecycle
|
|
2
3
|
|
|
3
4
|
Scenario: Switching to Token authentication scheme
|
|
@@ -7,6 +8,7 @@ Feature: Tokens lifecycle
|
|
|
7
8
|
Given the annotation:
|
|
8
9
|
"""yaml
|
|
9
10
|
/:
|
|
11
|
+
io:output: true
|
|
10
12
|
/hello/:id:
|
|
11
13
|
auth:id: id
|
|
12
14
|
GET:
|
|
@@ -35,6 +37,7 @@ Feature: Tokens lifecycle
|
|
|
35
37
|
And the annotation:
|
|
36
38
|
"""yaml
|
|
37
39
|
/:
|
|
40
|
+
io:output: true
|
|
38
41
|
/hello/:id:
|
|
39
42
|
auth:id: id
|
|
40
43
|
GET:
|
|
@@ -64,6 +67,7 @@ Feature: Tokens lifecycle
|
|
|
64
67
|
"""
|
|
65
68
|
200 OK
|
|
66
69
|
authorization: Token
|
|
70
|
+
cache-control: no-store
|
|
67
71
|
|
|
68
72
|
Hello
|
|
69
73
|
"""
|
|
@@ -72,6 +76,7 @@ Feature: Tokens lifecycle
|
|
|
72
76
|
Given the annotation:
|
|
73
77
|
"""yaml
|
|
74
78
|
/:
|
|
79
|
+
io:output: true
|
|
75
80
|
/:id:
|
|
76
81
|
id: id
|
|
77
82
|
GET:
|
|
@@ -117,3 +122,96 @@ Feature: Tokens lifecycle
|
|
|
117
122
|
"""
|
|
118
123
|
401 Unauthorized
|
|
119
124
|
"""
|
|
125
|
+
|
|
126
|
+
Scenario: Issuing own token
|
|
127
|
+
Given the `identity.basic` database contains:
|
|
128
|
+
| _id | username | password |
|
|
129
|
+
| efe3a65ebbee47ed95a73edd911ea328 | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
|
|
130
|
+
When the following request is received:
|
|
131
|
+
"""
|
|
132
|
+
GET /identity/ HTTP/1.1
|
|
133
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
134
|
+
"""
|
|
135
|
+
Then the following reply is sent:
|
|
136
|
+
"""
|
|
137
|
+
200 OK
|
|
138
|
+
authorization: Token ${{ token }}
|
|
139
|
+
"""
|
|
140
|
+
When the following request is received:
|
|
141
|
+
"""
|
|
142
|
+
POST /identity/tokens/ HTTP/1.1
|
|
143
|
+
authorization: Token ${{ token }}
|
|
144
|
+
content-type: application/yaml
|
|
145
|
+
|
|
146
|
+
lifetime: 0
|
|
147
|
+
"""
|
|
148
|
+
Then the following reply is sent:
|
|
149
|
+
"""
|
|
150
|
+
201 Created
|
|
151
|
+
"""
|
|
152
|
+
# Token scheme must be used
|
|
153
|
+
When the following request is received:
|
|
154
|
+
"""
|
|
155
|
+
POST /identity/tokens/ HTTP/1.1
|
|
156
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
157
|
+
content-type: application/yaml
|
|
158
|
+
|
|
159
|
+
lifetime: 60
|
|
160
|
+
"""
|
|
161
|
+
Then the following reply is sent:
|
|
162
|
+
"""
|
|
163
|
+
403 Forbidden
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
Scenario: Responses with tokens comes with `no-store`
|
|
167
|
+
Given the `identity.tokens` configuration:
|
|
168
|
+
"""yaml
|
|
169
|
+
refresh: 1
|
|
170
|
+
"""
|
|
171
|
+
And the annotation:
|
|
172
|
+
"""yaml
|
|
173
|
+
/:
|
|
174
|
+
io:output: true
|
|
175
|
+
/hello/:id:
|
|
176
|
+
auth:id: id
|
|
177
|
+
GET:
|
|
178
|
+
dev:stub: Hello
|
|
179
|
+
/cacheable/:id:
|
|
180
|
+
auth:id: id
|
|
181
|
+
cache:control: max-age=10000
|
|
182
|
+
GET:
|
|
183
|
+
dev:stub: Keep it
|
|
184
|
+
"""
|
|
185
|
+
When the following request is received:
|
|
186
|
+
"""
|
|
187
|
+
GET /hello/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
188
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
189
|
+
"""
|
|
190
|
+
Then the following reply is sent:
|
|
191
|
+
"""
|
|
192
|
+
200 OK
|
|
193
|
+
authorization: Token ${{ token }}
|
|
194
|
+
cache-control: no-store
|
|
195
|
+
"""
|
|
196
|
+
Then after 1 second
|
|
197
|
+
When the following request is received:
|
|
198
|
+
"""
|
|
199
|
+
GET /cacheable/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
200
|
+
authorization: Token ${{ token }}
|
|
201
|
+
"""
|
|
202
|
+
Then the following reply is sent:
|
|
203
|
+
"""
|
|
204
|
+
200 OK
|
|
205
|
+
authorization: Token ${{ fresh_token }}
|
|
206
|
+
cache-control: no-store
|
|
207
|
+
"""
|
|
208
|
+
When the following request is received:
|
|
209
|
+
"""
|
|
210
|
+
GET /cacheable/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
211
|
+
authorization: Token ${{ fresh_token }}
|
|
212
|
+
"""
|
|
213
|
+
Then the following reply is sent:
|
|
214
|
+
"""
|
|
215
|
+
200 OK
|
|
216
|
+
cache-control: private, max-age=10000
|
|
217
|
+
"""
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
@security
|
|
2
|
+
Feature: IO restrictions
|
|
3
|
+
|
|
4
|
+
Background:
|
|
5
|
+
Given the `pots` database contains:
|
|
6
|
+
| _id | title | volume | temperature |
|
|
7
|
+
| 4c4759e6f9c74da989d64511df42d6f4 | First pot | 100 | 80 |
|
|
8
|
+
| 99988d785d7d445cad45dbf8531f560b | Second pot | 200 | 30 |
|
|
9
|
+
|
|
10
|
+
Scenario: Output is omitted by default
|
|
11
|
+
Given the `pots` is running with the following manifest:
|
|
12
|
+
"""yaml
|
|
13
|
+
exposition:
|
|
14
|
+
/:
|
|
15
|
+
GET: enumerate
|
|
16
|
+
/:id:
|
|
17
|
+
GET: observe
|
|
18
|
+
"""
|
|
19
|
+
When the following request is received:
|
|
20
|
+
"""
|
|
21
|
+
GET /pots/4c4759e6f9c74da989d64511df42d6f4/ HTTP/1.1
|
|
22
|
+
"""
|
|
23
|
+
Then the following reply is sent:
|
|
24
|
+
"""
|
|
25
|
+
200 OK
|
|
26
|
+
content-length: 0
|
|
27
|
+
"""
|
|
28
|
+
When the following request is received:
|
|
29
|
+
"""
|
|
30
|
+
GET /pots/ HTTP/1.1
|
|
31
|
+
accept: application/yaml
|
|
32
|
+
"""
|
|
33
|
+
Then the following reply is sent:
|
|
34
|
+
"""
|
|
35
|
+
200 OK
|
|
36
|
+
content-length: 0
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
Scenario: Output is omitted by intention
|
|
40
|
+
Given the `pots` is running with the following manifest:
|
|
41
|
+
"""yaml
|
|
42
|
+
exposition:
|
|
43
|
+
/:id:
|
|
44
|
+
io:output: false
|
|
45
|
+
GET: observe
|
|
46
|
+
"""
|
|
47
|
+
When the following request is received:
|
|
48
|
+
"""
|
|
49
|
+
GET /pots/4c4759e6f9c74da989d64511df42d6f4/ HTTP/1.1
|
|
50
|
+
accept: application/yaml
|
|
51
|
+
"""
|
|
52
|
+
Then the following reply is sent:
|
|
53
|
+
"""
|
|
54
|
+
200 OK
|
|
55
|
+
content-length: 0
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
Scenario: Output permissions
|
|
59
|
+
Given the `pots` is running with the following manifest:
|
|
60
|
+
"""yaml
|
|
61
|
+
exposition:
|
|
62
|
+
/:
|
|
63
|
+
io:output: [id, volume]
|
|
64
|
+
GET: enumerate
|
|
65
|
+
/:id:
|
|
66
|
+
GET: observe
|
|
67
|
+
"""
|
|
68
|
+
When the following request is received:
|
|
69
|
+
"""
|
|
70
|
+
GET /pots/4c4759e6f9c74da989d64511df42d6f4/ HTTP/1.1
|
|
71
|
+
accept: application/yaml
|
|
72
|
+
"""
|
|
73
|
+
Then the following reply is sent:
|
|
74
|
+
"""
|
|
75
|
+
200 OK
|
|
76
|
+
|
|
77
|
+
id: 4c4759e6f9c74da989d64511df42d6f4
|
|
78
|
+
volume: 100
|
|
79
|
+
"""
|
|
80
|
+
And the reply does not contain:
|
|
81
|
+
"""
|
|
82
|
+
title:
|
|
83
|
+
temperature:
|
|
84
|
+
"""
|
|
85
|
+
When the following request is received:
|
|
86
|
+
"""
|
|
87
|
+
GET /pots/ HTTP/1.1
|
|
88
|
+
accept: application/yaml
|
|
89
|
+
"""
|
|
90
|
+
Then the following reply is sent:
|
|
91
|
+
"""
|
|
92
|
+
200 OK
|
|
93
|
+
content-type: application/yaml
|
|
94
|
+
|
|
95
|
+
- id: 4c4759e6f9c74da989d64511df42d6f4
|
|
96
|
+
volume: 100
|
|
97
|
+
- id: 99988d785d7d445cad45dbf8531f560b
|
|
98
|
+
volume: 200
|
|
99
|
+
"""
|
|
100
|
+
And the reply does not contain:
|
|
101
|
+
"""
|
|
102
|
+
title:
|
|
103
|
+
temperature:
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
Scenario: Input is unrestricted by default
|
|
107
|
+
Given the `pots` is running with the following manifest:
|
|
108
|
+
"""yaml
|
|
109
|
+
exposition:
|
|
110
|
+
/:
|
|
111
|
+
io:output: true
|
|
112
|
+
POST: create
|
|
113
|
+
"""
|
|
114
|
+
When the following request is received:
|
|
115
|
+
"""
|
|
116
|
+
POST /pots/ HTTP/1.1
|
|
117
|
+
accept: application/yaml
|
|
118
|
+
content-type: application/yaml
|
|
119
|
+
|
|
120
|
+
title: Hello
|
|
121
|
+
volume: 1.5
|
|
122
|
+
temperature: 80
|
|
123
|
+
"""
|
|
124
|
+
Then the following reply is sent:
|
|
125
|
+
"""
|
|
126
|
+
201 Created
|
|
127
|
+
|
|
128
|
+
title: Hello
|
|
129
|
+
volume: 1.5
|
|
130
|
+
temperature: 80
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
Scenario: Input permissions
|
|
134
|
+
Given the `pots` is running with the following manifest:
|
|
135
|
+
"""yaml
|
|
136
|
+
exposition:
|
|
137
|
+
/:
|
|
138
|
+
io:input: [title, volume]
|
|
139
|
+
io:output: [id]
|
|
140
|
+
POST: create
|
|
141
|
+
"""
|
|
142
|
+
When the following request is received:
|
|
143
|
+
"""
|
|
144
|
+
POST /pots/ HTTP/1.1
|
|
145
|
+
accept: text/plain
|
|
146
|
+
content-type: application/yaml
|
|
147
|
+
|
|
148
|
+
title: Hello
|
|
149
|
+
volume: 1.5
|
|
150
|
+
temperature: 80
|
|
151
|
+
"""
|
|
152
|
+
Then the following reply is sent:
|
|
153
|
+
"""
|
|
154
|
+
400 Bad Request
|
|
155
|
+
|
|
156
|
+
Unexpected input: temperature
|
|
157
|
+
"""
|
|
158
|
+
When the following request is received:
|
|
159
|
+
"""
|
|
160
|
+
POST /pots/ HTTP/1.1
|
|
161
|
+
content-type: application/yaml
|
|
162
|
+
|
|
163
|
+
title: Hello
|
|
164
|
+
volume: 1.5
|
|
165
|
+
"""
|
|
166
|
+
Then the following reply is sent:
|
|
167
|
+
"""
|
|
168
|
+
201 Created
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
Scenario: IO shortcuts
|
|
172
|
+
Given the `pots` is running with the following manifest:
|
|
173
|
+
"""yaml
|
|
174
|
+
exposition:
|
|
175
|
+
/:
|
|
176
|
+
input: [title, volume]
|
|
177
|
+
output: [id, title, volume]
|
|
178
|
+
POST: create
|
|
179
|
+
"""
|
|
180
|
+
When the following request is received:
|
|
181
|
+
"""
|
|
182
|
+
POST /pots/ HTTP/1.1
|
|
183
|
+
accept: application/yaml
|
|
184
|
+
content-type: application/yaml
|
|
185
|
+
|
|
186
|
+
title: Hello
|
|
187
|
+
volume: 1.5
|
|
188
|
+
"""
|
|
189
|
+
Then the following reply is sent:
|
|
190
|
+
"""
|
|
191
|
+
201 Created
|
|
192
|
+
|
|
193
|
+
id:
|
|
194
|
+
title: Hello
|
|
195
|
+
volume: 1.5
|
|
196
|
+
"""
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
Feature: Accessing
|
|
1
|
+
Feature: Accessing entries
|
|
2
2
|
|
|
3
3
|
Scenario: Entries are not accessible by default
|
|
4
4
|
Given the annotation:
|
|
5
5
|
"""yaml
|
|
6
6
|
/:
|
|
7
|
+
io:output: true
|
|
7
8
|
auth:anonymous: true
|
|
8
9
|
octets:context: octets
|
|
9
10
|
POST:
|
|
@@ -50,6 +51,7 @@ Feature: Accessing entires
|
|
|
50
51
|
Given the annotation:
|
|
51
52
|
"""yaml
|
|
52
53
|
/:
|
|
54
|
+
io:output: true
|
|
53
55
|
auth:anonymous: true
|
|
54
56
|
octets:context: octets
|
|
55
57
|
POST:
|
package/features/octets.feature
CHANGED
|
@@ -4,6 +4,7 @@ Feature: Octets directive family
|
|
|
4
4
|
Given the annotation:
|
|
5
5
|
"""yaml
|
|
6
6
|
/:
|
|
7
|
+
io:output: true
|
|
7
8
|
auth:anonymous: true
|
|
8
9
|
octets:context: octets
|
|
9
10
|
POST:
|
|
@@ -32,6 +33,9 @@ Feature: Octets directive family
|
|
|
32
33
|
POST:
|
|
33
34
|
octets:store:
|
|
34
35
|
accept: image/*
|
|
36
|
+
/*:
|
|
37
|
+
GET:
|
|
38
|
+
octets:fetch: ~
|
|
35
39
|
"""
|
|
36
40
|
|
|
37
41
|
Scenario: Basic storage operations
|
|
@@ -186,23 +190,40 @@ Feature: Octets directive family
|
|
|
186
190
|
201 Created
|
|
187
191
|
"""
|
|
188
192
|
|
|
189
|
-
Scenario Outline:
|
|
190
|
-
When the stream of `sample.<
|
|
193
|
+
Scenario Outline: Detecting `<type>`
|
|
194
|
+
When the stream of `sample.<ext>` is received with the following headers:
|
|
191
195
|
"""
|
|
192
196
|
POST /media/images/ HTTP/1.1
|
|
197
|
+
accept: application/yaml
|
|
193
198
|
"""
|
|
194
199
|
Then the following reply is sent:
|
|
195
200
|
"""
|
|
196
201
|
201 Created
|
|
202
|
+
|
|
203
|
+
type: <type>
|
|
197
204
|
"""
|
|
198
205
|
Examples:
|
|
199
|
-
|
|
|
200
|
-
| jpeg
|
|
201
|
-
| jxl
|
|
202
|
-
| gif
|
|
203
|
-
| heic
|
|
204
|
-
| avif
|
|
205
|
-
| webp
|
|
206
|
+
| ext | type |
|
|
207
|
+
| jpeg | image/jpeg |
|
|
208
|
+
| jxl | image/jxl |
|
|
209
|
+
| gif | image/gif |
|
|
210
|
+
| heic | image/heic |
|
|
211
|
+
| avif | image/avif |
|
|
212
|
+
| webp | image/webp |
|
|
213
|
+
|
|
214
|
+
Scenario: Accepting `image/svg+xml`
|
|
215
|
+
When the stream of `sample.svg` is received with the following headers:
|
|
216
|
+
"""
|
|
217
|
+
POST /media/images/ HTTP/1.1
|
|
218
|
+
content-type: image/svg+xml
|
|
219
|
+
accept: application/yaml
|
|
220
|
+
"""
|
|
221
|
+
Then the following reply is sent:
|
|
222
|
+
"""
|
|
223
|
+
201 Created
|
|
224
|
+
|
|
225
|
+
type: image/svg+xml
|
|
226
|
+
"""
|
|
206
227
|
|
|
207
228
|
Scenario: Fetching non-existent BLOB
|
|
208
229
|
When the following request is received:
|
|
@@ -234,10 +255,11 @@ Feature: Octets directive family
|
|
|
234
255
|
Trailing slash is redundant.
|
|
235
256
|
"""
|
|
236
257
|
|
|
237
|
-
Scenario: Original
|
|
258
|
+
Scenario: Original BLOB is not accessible
|
|
238
259
|
Given the annotation:
|
|
239
260
|
"""yaml
|
|
240
261
|
/:
|
|
262
|
+
io:output: true
|
|
241
263
|
auth:anonymous: true
|
|
242
264
|
octets:context: octets
|
|
243
265
|
POST:
|
|
@@ -5,6 +5,7 @@ Feature: Octets `content-meta` header
|
|
|
5
5
|
And the annotation:
|
|
6
6
|
"""yaml
|
|
7
7
|
/:
|
|
8
|
+
io:output: true
|
|
8
9
|
auth:anonymous: true
|
|
9
10
|
octets:context: octets
|
|
10
11
|
/*:
|
|
@@ -55,11 +56,11 @@ Feature: Octets `content-meta` header
|
|
|
55
56
|
When the following request is received:
|
|
56
57
|
"""
|
|
57
58
|
OPTIONS / HTTP/1.1
|
|
58
|
-
origin:
|
|
59
|
+
origin: https://example.com
|
|
59
60
|
"""
|
|
60
61
|
Then the following reply is sent:
|
|
61
62
|
"""
|
|
62
63
|
204 No Content
|
|
63
|
-
access-control-allow-origin:
|
|
64
|
-
access-control-allow-headers: accept, authorization, content-type, content-meta
|
|
64
|
+
access-control-allow-origin: https://example.com
|
|
65
|
+
access-control-allow-headers: accept, authorization, content-type, etag, if-match, if-none-match, content-meta
|
|
65
66
|
"""
|