@toa.io/extensions.exposition 1.0.0-alpha.2 → 1.0.0-alpha.20
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
package/features/cache.feature
CHANGED
|
@@ -14,6 +14,7 @@ Feature: Caching
|
|
|
14
14
|
Given the annotation:
|
|
15
15
|
"""yaml
|
|
16
16
|
/:
|
|
17
|
+
io:output: true
|
|
17
18
|
anonymous: true
|
|
18
19
|
GET:
|
|
19
20
|
cache:control: max-age=60000
|
|
@@ -37,6 +38,7 @@ Feature: Caching
|
|
|
37
38
|
Given the annotation:
|
|
38
39
|
"""yaml
|
|
39
40
|
/:
|
|
41
|
+
io:output: true
|
|
40
42
|
cache:control: max-age=30000
|
|
41
43
|
GET:
|
|
42
44
|
anonymous: true
|
|
@@ -120,6 +122,7 @@ Feature: Caching
|
|
|
120
122
|
Given the annotation:
|
|
121
123
|
"""yaml
|
|
122
124
|
/:
|
|
125
|
+
io:output: true
|
|
123
126
|
auth:role: developer
|
|
124
127
|
cache:exact: max-age=60000, public
|
|
125
128
|
GET:
|
|
@@ -158,3 +161,39 @@ Feature: Caching
|
|
|
158
161
|
"""
|
|
159
162
|
cache-control:
|
|
160
163
|
"""
|
|
164
|
+
|
|
165
|
+
Scenario: Private responses are sent with `vary: authorization`
|
|
166
|
+
Given the `identity.basic` database contains:
|
|
167
|
+
| _id | username | password |
|
|
168
|
+
| efe3a65ebbee47ed95a73edd911ea328 | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
|
|
169
|
+
And the annotation:
|
|
170
|
+
"""yaml
|
|
171
|
+
/:
|
|
172
|
+
/:id:
|
|
173
|
+
auth:id: id
|
|
174
|
+
cache:control: max-age=10000
|
|
175
|
+
GET:
|
|
176
|
+
dev:stub: Keep it
|
|
177
|
+
"""
|
|
178
|
+
When the following request is received:
|
|
179
|
+
"""
|
|
180
|
+
GET /efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
181
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
182
|
+
"""
|
|
183
|
+
# `no-store` when token is issued
|
|
184
|
+
Then the following reply is sent:
|
|
185
|
+
"""
|
|
186
|
+
200 OK
|
|
187
|
+
authorization: Token ${{ token }}
|
|
188
|
+
"""
|
|
189
|
+
When the following request is received:
|
|
190
|
+
"""
|
|
191
|
+
GET /efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
192
|
+
authorization: Token ${{ token }}
|
|
193
|
+
"""
|
|
194
|
+
Then the following reply is sent:
|
|
195
|
+
"""
|
|
196
|
+
200 OK
|
|
197
|
+
cache-control: private, max-age=10000
|
|
198
|
+
vary: authorization
|
|
199
|
+
"""
|
package/features/cors.feature
CHANGED
|
@@ -19,10 +19,10 @@ Feature: CORS Support
|
|
|
19
19
|
204 No Content
|
|
20
20
|
access-control-allow-origin: https://hello.world
|
|
21
21
|
access-control-allow-methods: GET, POST, PUT, PATCH, DELETE
|
|
22
|
-
access-control-allow-headers: accept, authorization, content-type
|
|
22
|
+
access-control-allow-headers: accept, authorization, content-type, etag, if-match, if-none-match
|
|
23
23
|
access-control-allow-credentials: true
|
|
24
24
|
access-control-max-age: 3600
|
|
25
|
-
cache-control:
|
|
25
|
+
cache-control: max-age=3600
|
|
26
26
|
vary: origin
|
|
27
27
|
"""
|
|
28
28
|
When the following request is received:
|
|
@@ -4,6 +4,7 @@ Feature: Directives
|
|
|
4
4
|
Given the annotation:
|
|
5
5
|
"""yaml
|
|
6
6
|
/:
|
|
7
|
+
io:output: true
|
|
7
8
|
anonymous: true
|
|
8
9
|
GET:
|
|
9
10
|
dev:stub:
|
|
@@ -26,6 +27,7 @@ Feature: Directives
|
|
|
26
27
|
Given the annotation:
|
|
27
28
|
"""yaml
|
|
28
29
|
/:
|
|
30
|
+
io:output: true
|
|
29
31
|
anonymous: true
|
|
30
32
|
dev:stub:
|
|
31
33
|
hello: again
|
package/features/dynamic.feature
CHANGED
|
@@ -11,6 +11,7 @@ Feature: Dynamic tree updates
|
|
|
11
11
|
"""yaml
|
|
12
12
|
exposition:
|
|
13
13
|
/:
|
|
14
|
+
io:output: true
|
|
14
15
|
isolated: true
|
|
15
16
|
GET: enumerate
|
|
16
17
|
"""
|
|
@@ -27,6 +28,7 @@ Feature: Dynamic tree updates
|
|
|
27
28
|
"""yaml
|
|
28
29
|
exposition:
|
|
29
30
|
/:
|
|
31
|
+
io:output: true
|
|
30
32
|
GET: enumerate
|
|
31
33
|
"""
|
|
32
34
|
When the following request is received:
|
|
@@ -44,19 +46,22 @@ Feature: Dynamic tree updates
|
|
|
44
46
|
"""yaml
|
|
45
47
|
exposition:
|
|
46
48
|
/:id:
|
|
49
|
+
io:output: true
|
|
47
50
|
GET: observe
|
|
48
51
|
"""
|
|
49
52
|
Then the `pots` is stopped
|
|
50
53
|
Then the `pots` is running with the following manifest:
|
|
51
54
|
"""yaml
|
|
52
55
|
exposition:
|
|
53
|
-
/:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
/:
|
|
57
|
+
io:output: true
|
|
58
|
+
/:id:
|
|
59
|
+
GET: observe
|
|
60
|
+
/big:
|
|
61
|
+
GET:
|
|
62
|
+
endpoint: enumerate
|
|
63
|
+
query:
|
|
64
|
+
criteria: volume>200
|
|
60
65
|
"""
|
|
61
66
|
When the following request is received:
|
|
62
67
|
"""
|
|
@@ -73,6 +78,7 @@ Feature: Dynamic tree updates
|
|
|
73
78
|
"""yaml
|
|
74
79
|
exposition:
|
|
75
80
|
/big:
|
|
81
|
+
io:output: true
|
|
76
82
|
GET:
|
|
77
83
|
endpoint: enumerate
|
|
78
84
|
query:
|
|
@@ -83,6 +89,7 @@ Feature: Dynamic tree updates
|
|
|
83
89
|
"""yaml
|
|
84
90
|
exposition:
|
|
85
91
|
/big:
|
|
92
|
+
io:output: true
|
|
86
93
|
GET:
|
|
87
94
|
endpoint: enumerate
|
|
88
95
|
query:
|
package/features/errors.feature
CHANGED
|
@@ -8,11 +8,13 @@ Feature: Errors
|
|
|
8
8
|
When the following request is received:
|
|
9
9
|
"""
|
|
10
10
|
GET <path> HTTP/1.1
|
|
11
|
-
accept:
|
|
11
|
+
accept: text/plain
|
|
12
12
|
"""
|
|
13
13
|
Then the following reply is sent:
|
|
14
14
|
"""
|
|
15
15
|
404 Not Found
|
|
16
|
+
|
|
17
|
+
Route not found
|
|
16
18
|
"""
|
|
17
19
|
Examples:
|
|
18
20
|
| path |
|
|
@@ -46,7 +48,7 @@ Feature: Errors
|
|
|
46
48
|
accept: application/yaml
|
|
47
49
|
"""
|
|
48
50
|
Then the following reply is sent:
|
|
49
|
-
"""
|
|
51
|
+
"""
|
|
50
52
|
405 Method Not Allowed
|
|
51
53
|
"""
|
|
52
54
|
|
|
@@ -57,7 +59,7 @@ Feature: Errors
|
|
|
57
59
|
accept: application/yaml
|
|
58
60
|
"""
|
|
59
61
|
Then the following reply is sent:
|
|
60
|
-
"""
|
|
62
|
+
"""
|
|
61
63
|
501 Not Implemented
|
|
62
64
|
"""
|
|
63
65
|
|
|
@@ -66,7 +68,7 @@ Feature: Errors
|
|
|
66
68
|
"""yaml
|
|
67
69
|
exposition:
|
|
68
70
|
/:
|
|
69
|
-
POST:
|
|
71
|
+
POST: create
|
|
70
72
|
"""
|
|
71
73
|
When the following request is received:
|
|
72
74
|
"""
|
|
@@ -197,6 +199,7 @@ Feature: Errors
|
|
|
197
199
|
"""yaml
|
|
198
200
|
/:
|
|
199
201
|
GET:
|
|
202
|
+
io:output: true
|
|
200
203
|
anonymous: true
|
|
201
204
|
dev:stub: hello
|
|
202
205
|
"""
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Feature: Optimistic concurrency control
|
|
2
|
+
|
|
3
|
+
Scenario: Using `etag`
|
|
4
|
+
Given the `pots` is running with the following manifest:
|
|
5
|
+
"""yaml
|
|
6
|
+
exposition:
|
|
7
|
+
/:
|
|
8
|
+
io:output: true
|
|
9
|
+
POST: create
|
|
10
|
+
/:id:
|
|
11
|
+
GET: observe
|
|
12
|
+
PUT: transit
|
|
13
|
+
"""
|
|
14
|
+
When the following request is received:
|
|
15
|
+
"""
|
|
16
|
+
POST /pots/ HTTP/1.1
|
|
17
|
+
accept: application/yaml
|
|
18
|
+
content-type: application/yaml
|
|
19
|
+
|
|
20
|
+
title: Hello
|
|
21
|
+
volume: 1.5
|
|
22
|
+
"""
|
|
23
|
+
Then the following reply is sent:
|
|
24
|
+
"""
|
|
25
|
+
201 Created
|
|
26
|
+
etag: "1"
|
|
27
|
+
|
|
28
|
+
id: ${{ id }}
|
|
29
|
+
"""
|
|
30
|
+
When the following request is received:
|
|
31
|
+
"""
|
|
32
|
+
GET /pots/${{ id }}/ HTTP/1.1
|
|
33
|
+
"""
|
|
34
|
+
Then the following reply is sent:
|
|
35
|
+
"""
|
|
36
|
+
200 OK
|
|
37
|
+
etag: "1"
|
|
38
|
+
"""
|
|
39
|
+
When the following request is received:
|
|
40
|
+
"""
|
|
41
|
+
GET /pots/${{ id }}/ HTTP/1.1
|
|
42
|
+
if-none-match: "1"
|
|
43
|
+
"""
|
|
44
|
+
Then the following reply is sent:
|
|
45
|
+
"""
|
|
46
|
+
304 Not Modified
|
|
47
|
+
etag: "1"
|
|
48
|
+
"""
|
|
49
|
+
When the following request is received:
|
|
50
|
+
"""
|
|
51
|
+
PUT /pots/${{ id }}/ HTTP/1.1
|
|
52
|
+
content-type: application/yaml
|
|
53
|
+
if-match: "38"
|
|
54
|
+
|
|
55
|
+
volume: 2.5
|
|
56
|
+
"""
|
|
57
|
+
Then the following reply is sent:
|
|
58
|
+
"""
|
|
59
|
+
412 Precondition Failed
|
|
60
|
+
"""
|
|
61
|
+
When the following request is received:
|
|
62
|
+
"""
|
|
63
|
+
PUT /pots/${{ id }}/ HTTP/1.1
|
|
64
|
+
content-type: application/yaml
|
|
65
|
+
if-match: "1"
|
|
66
|
+
|
|
67
|
+
volume: 2.5
|
|
68
|
+
"""
|
|
69
|
+
Then the following reply is sent:
|
|
70
|
+
"""
|
|
71
|
+
200 OK
|
|
72
|
+
etag: "2"
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
Scenario: Unexpected `if-match` format
|
|
76
|
+
Given the `pots` is running with the following manifest:
|
|
77
|
+
"""yaml
|
|
78
|
+
exposition:
|
|
79
|
+
/:
|
|
80
|
+
/:id:
|
|
81
|
+
PUT: transit
|
|
82
|
+
"""
|
|
83
|
+
When the following request is received:
|
|
84
|
+
"""
|
|
85
|
+
PUT /pots/fa177da8393544139915795816ad6b97/ HTTP/1.1
|
|
86
|
+
accept: text/plain
|
|
87
|
+
content-type: application/yaml
|
|
88
|
+
if-match: "oopsie"
|
|
89
|
+
|
|
90
|
+
volume: 2.5
|
|
91
|
+
"""
|
|
92
|
+
Then the following reply is sent:
|
|
93
|
+
"""
|
|
94
|
+
400 Bad Request
|
|
95
|
+
|
|
96
|
+
Invalid ETag.
|
|
97
|
+
"""
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
@security
|
|
2
|
+
Feature: Bans
|
|
3
|
+
|
|
4
|
+
Background:
|
|
5
|
+
Given the `identity.basic` database contains:
|
|
6
|
+
# developer:secret
|
|
7
|
+
# user:12345
|
|
8
|
+
| _id | username | password | _deleted |
|
|
9
|
+
| efe3a65ebbee47ed95a73edd911ea328 | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O | null |
|
|
10
|
+
| e8e4f9c2a68d419b861403d71fabc915 | user | $2b$10$Frszmrmsz9iwSXzBbRRMKeDVKsNxozkrLNSsN.SnVC.KPxLtQr/bK | null |
|
|
11
|
+
And the `identity.bans` database is empty
|
|
12
|
+
|
|
13
|
+
Scenario: Banning an Identity
|
|
14
|
+
Given the `identity.roles` database contains:
|
|
15
|
+
| _id | identity | role |
|
|
16
|
+
| 775a648d054e4ce1a65f8f17e5b51803 | efe3a65ebbee47ed95a73edd911ea328 | system:identity:bans |
|
|
17
|
+
And the annotation:
|
|
18
|
+
"""yaml
|
|
19
|
+
/:
|
|
20
|
+
/:id:
|
|
21
|
+
io:output: true
|
|
22
|
+
auth:id: id
|
|
23
|
+
GET:
|
|
24
|
+
dev:stub:
|
|
25
|
+
access: granted!
|
|
26
|
+
"""
|
|
27
|
+
And the `identity.tokens` configuration:
|
|
28
|
+
"""yaml
|
|
29
|
+
refresh: 1
|
|
30
|
+
"""
|
|
31
|
+
When the following request is received:
|
|
32
|
+
"""
|
|
33
|
+
GET /e8e4f9c2a68d419b861403d71fabc915/ HTTP/1.1
|
|
34
|
+
authorization: Basic dXNlcjoxMjM0NQ==
|
|
35
|
+
"""
|
|
36
|
+
Then the following reply is sent:
|
|
37
|
+
"""
|
|
38
|
+
200 OK
|
|
39
|
+
authorization: Token ${{ token }}
|
|
40
|
+
"""
|
|
41
|
+
When the following request is received:
|
|
42
|
+
"""
|
|
43
|
+
PUT /identity/bans/e8e4f9c2a68d419b861403d71fabc915/ HTTP/1.1
|
|
44
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
45
|
+
content-type: application/yaml
|
|
46
|
+
|
|
47
|
+
banned: true
|
|
48
|
+
comment: Bye bye
|
|
49
|
+
"""
|
|
50
|
+
Then the following reply is sent:
|
|
51
|
+
"""
|
|
52
|
+
200 OK
|
|
53
|
+
"""
|
|
54
|
+
# accessing a resource with a banned Identity
|
|
55
|
+
When the following request is received:
|
|
56
|
+
"""
|
|
57
|
+
GET /e8e4f9c2a68d419b861403d71fabc915/ HTTP/1.1
|
|
58
|
+
authorization: Basic dXNlcjoxMjM0NQ==
|
|
59
|
+
"""
|
|
60
|
+
Then the following reply is sent:
|
|
61
|
+
"""
|
|
62
|
+
401 Unauthorized
|
|
63
|
+
"""
|
|
64
|
+
Then after 1 second
|
|
65
|
+
When the following request is received:
|
|
66
|
+
"""
|
|
67
|
+
GET /e8e4f9c2a68d419b861403d71fabc915/ HTTP/1.1
|
|
68
|
+
authorization: Token ${{ token }}
|
|
69
|
+
"""
|
|
70
|
+
Then the following reply is sent:
|
|
71
|
+
"""
|
|
72
|
+
401 Unauthorized
|
|
73
|
+
"""
|
|
74
|
+
When the following request is received:
|
|
75
|
+
"""
|
|
76
|
+
PUT /identity/bans/e8e4f9c2a68d419b861403d71fabc915/ HTTP/1.1
|
|
77
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
78
|
+
content-type: application/yaml
|
|
79
|
+
|
|
80
|
+
banned: false
|
|
81
|
+
"""
|
|
82
|
+
Then the following reply is sent:
|
|
83
|
+
"""
|
|
84
|
+
200 OK
|
|
85
|
+
"""
|
|
86
|
+
When the following request is received:
|
|
87
|
+
"""
|
|
88
|
+
GET /e8e4f9c2a68d419b861403d71fabc915/ HTTP/1.1
|
|
89
|
+
authorization: Basic dXNlcjoxMjM0NQ==
|
|
90
|
+
"""
|
|
91
|
+
Then the following reply is sent:
|
|
92
|
+
"""
|
|
93
|
+
200 OK
|
|
94
|
+
|
|
95
|
+
authorization: Token ${{ new_token }}
|
|
96
|
+
"""
|
|
97
|
+
# re-ban
|
|
98
|
+
When the following request is received:
|
|
99
|
+
"""
|
|
100
|
+
PUT /identity/bans/e8e4f9c2a68d419b861403d71fabc915/ HTTP/1.1
|
|
101
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
102
|
+
content-type: application/yaml
|
|
103
|
+
|
|
104
|
+
banned: true
|
|
105
|
+
"""
|
|
106
|
+
Then the following reply is sent:
|
|
107
|
+
"""
|
|
108
|
+
200 OK
|
|
109
|
+
"""
|
|
110
|
+
When the following request is received:
|
|
111
|
+
"""
|
|
112
|
+
GET /e8e4f9c2a68d419b861403d71fabc915/ HTTP/1.1
|
|
113
|
+
authorization: Basic dXNlcjoxMjM0NQ==
|
|
114
|
+
"""
|
|
115
|
+
Then the following reply is sent:
|
|
116
|
+
"""
|
|
117
|
+
401 Unauthorized
|
|
118
|
+
"""
|
|
119
|
+
Then after 1 second
|
|
120
|
+
When the following request is received:
|
|
121
|
+
"""
|
|
122
|
+
GET /e8e4f9c2a68d419b861403d71fabc915/ HTTP/1.1
|
|
123
|
+
authorization: Token ${{ new_token }}
|
|
124
|
+
"""
|
|
125
|
+
Then the following reply is sent:
|
|
126
|
+
"""
|
|
127
|
+
401 Unauthorized
|
|
128
|
+
"""
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@security
|
|
1
2
|
Feature: Basic authentication
|
|
2
3
|
|
|
3
4
|
Background:
|
|
@@ -16,20 +17,34 @@ Feature: Basic authentication
|
|
|
16
17
|
"""
|
|
17
18
|
201 Created
|
|
18
19
|
"""
|
|
20
|
+
When the following request is received:
|
|
21
|
+
"""
|
|
22
|
+
POST /identity/basic/ HTTP/1.1
|
|
23
|
+
content-type: application/yaml
|
|
24
|
+
accept: application/yaml
|
|
25
|
+
|
|
26
|
+
username: developer
|
|
27
|
+
password: secret#1234
|
|
28
|
+
"""
|
|
29
|
+
Then the following reply is sent:
|
|
30
|
+
"""
|
|
31
|
+
409 Conflict
|
|
32
|
+
"""
|
|
19
33
|
|
|
20
34
|
Scenario: Creating new Identity using inception
|
|
21
35
|
Given the `users` is running with the following manifest:
|
|
22
36
|
"""yaml
|
|
23
37
|
exposition:
|
|
24
38
|
/:
|
|
39
|
+
io:output: true
|
|
25
40
|
anonymous: true # checking compatibility with anonymous access
|
|
26
41
|
POST:
|
|
27
42
|
incept: id
|
|
28
43
|
endpoint: transit
|
|
29
44
|
query: ~
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
/:id: # credential testing route
|
|
46
|
+
id: id
|
|
47
|
+
GET: observe
|
|
33
48
|
"""
|
|
34
49
|
When the following request is received:
|
|
35
50
|
"""
|
|
@@ -67,11 +82,40 @@ Feature: Basic authentication
|
|
|
67
82
|
"""
|
|
68
83
|
200 OK
|
|
69
84
|
"""
|
|
85
|
+
# username is taken
|
|
86
|
+
When the following request is received:
|
|
87
|
+
"""
|
|
88
|
+
POST /users/ HTTP/1.1
|
|
89
|
+
authorization: Basic dXNlcjphbm90aGVycGFzczEyMzQ=
|
|
90
|
+
accept: application/yaml
|
|
91
|
+
content-type: application/yaml
|
|
92
|
+
|
|
93
|
+
name: Bill Smith
|
|
94
|
+
"""
|
|
95
|
+
Then the following reply is sent:
|
|
96
|
+
"""
|
|
97
|
+
409 Conflict
|
|
98
|
+
"""
|
|
99
|
+
# credentials already exists
|
|
100
|
+
When the following request is received:
|
|
101
|
+
"""
|
|
102
|
+
POST /users/ HTTP/1.1
|
|
103
|
+
authorization: Basic dXNlcjpwYXNzMTIzNA==
|
|
104
|
+
accept: application/yaml
|
|
105
|
+
content-type: application/yaml
|
|
106
|
+
|
|
107
|
+
name: Bill Smith
|
|
108
|
+
"""
|
|
109
|
+
Then the following reply is sent:
|
|
110
|
+
"""
|
|
111
|
+
403 Forbidden
|
|
112
|
+
"""
|
|
70
113
|
|
|
71
114
|
Scenario: Changing the password
|
|
72
115
|
Given the annotation:
|
|
73
116
|
"""yaml
|
|
74
117
|
/:
|
|
118
|
+
io:output: true
|
|
75
119
|
/:id:
|
|
76
120
|
id: id
|
|
77
121
|
GET:
|
|
@@ -115,6 +159,25 @@ Feature: Basic authentication
|
|
|
115
159
|
200 OK
|
|
116
160
|
"""
|
|
117
161
|
|
|
162
|
+
Scenario: Changing other identity the password
|
|
163
|
+
Given the `identity.basic` database contains:
|
|
164
|
+
| _id | username | password | _version |
|
|
165
|
+
| efe3a65ebbee47ed95a73edd911ea328 | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O | 1 |
|
|
166
|
+
| 6c0be50cbfb043acafe69cc7d3895f84 | attacker | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O | 1 |
|
|
167
|
+
When the following request is received:
|
|
168
|
+
"""
|
|
169
|
+
PATCH /identity/basic/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
170
|
+
authorization: Basic YXR0YWNrZXI6c2VjcmV0
|
|
171
|
+
accept: application/yaml
|
|
172
|
+
content-type: application/yaml
|
|
173
|
+
|
|
174
|
+
password: new-secret
|
|
175
|
+
"""
|
|
176
|
+
Then the following reply is sent:
|
|
177
|
+
"""
|
|
178
|
+
403 Forbidden
|
|
179
|
+
"""
|
|
180
|
+
|
|
118
181
|
Scenario Outline: <problem> not meeting the requirements
|
|
119
182
|
When the following request is received:
|
|
120
183
|
"""
|
|
@@ -173,6 +236,7 @@ Feature: Basic authentication
|
|
|
173
236
|
And the annotation:
|
|
174
237
|
"""yaml
|
|
175
238
|
/:
|
|
239
|
+
io:output: true
|
|
176
240
|
GET:
|
|
177
241
|
auth:role: system:stub
|
|
178
242
|
dev:stub:
|
|
@@ -244,6 +308,7 @@ Feature: Basic authentication
|
|
|
244
308
|
"""yaml
|
|
245
309
|
exposition:
|
|
246
310
|
/:
|
|
311
|
+
io:output: true
|
|
247
312
|
anonymous: true
|
|
248
313
|
POST:
|
|
249
314
|
incept: id
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
@security
|
|
1
2
|
Feature: Identity Federation
|
|
2
3
|
|
|
3
4
|
Background:
|
|
4
5
|
Given the `identity.federation` database is empty
|
|
5
6
|
Given local IDP is running
|
|
6
7
|
|
|
7
|
-
|
|
8
8
|
Scenario: Getting identity for a new user
|
|
9
9
|
Given the `identity.federation` configuration:
|
|
10
10
|
"""yaml
|
|
@@ -27,9 +27,8 @@ Feature: Identity Federation
|
|
|
27
27
|
|
|
28
28
|
id: ${{ User.id }}
|
|
29
29
|
roles: []
|
|
30
|
-
scheme: bearer
|
|
31
30
|
"""
|
|
32
|
-
# validate
|
|
31
|
+
# validate TOKEN
|
|
33
32
|
When the following request is received:
|
|
34
33
|
"""
|
|
35
34
|
GET /identity/ HTTP/1.1
|
|
@@ -39,9 +38,10 @@ Feature: Identity Federation
|
|
|
39
38
|
Then the following reply is sent:
|
|
40
39
|
"""
|
|
41
40
|
200 OK
|
|
41
|
+
|
|
42
42
|
id: ${{ User.id }}
|
|
43
43
|
"""
|
|
44
|
-
# ensuring identity
|
|
44
|
+
# ensuring identity idempotency
|
|
45
45
|
When the following request is received:
|
|
46
46
|
"""
|
|
47
47
|
GET /identity/ HTTP/1.1
|
|
@@ -51,9 +51,39 @@ Feature: Identity Federation
|
|
|
51
51
|
Then the following reply is sent:
|
|
52
52
|
"""
|
|
53
53
|
200 OK
|
|
54
|
+
|
|
54
55
|
id: ${{ User.id }}
|
|
55
56
|
"""
|
|
56
57
|
|
|
58
|
+
Scenario: Getting identity for a user with symmetric tokens
|
|
59
|
+
Given the `identity.federation` configuration:
|
|
60
|
+
"""yaml
|
|
61
|
+
explicit_identity_creation: false
|
|
62
|
+
trust:
|
|
63
|
+
- issuer: http://localhost:44444
|
|
64
|
+
secrets:
|
|
65
|
+
HS384:
|
|
66
|
+
k1: the-secret
|
|
67
|
+
"""
|
|
68
|
+
And the IDP HS384 token for GoodUser is issued with following secret:
|
|
69
|
+
"""
|
|
70
|
+
the-secret
|
|
71
|
+
"""
|
|
72
|
+
When the following request is received:
|
|
73
|
+
"""
|
|
74
|
+
GET /identity/ HTTP/1.1
|
|
75
|
+
authorization: Bearer ${{ GoodUser.id_token }}
|
|
76
|
+
accept: application/yaml
|
|
77
|
+
content-type: application/yaml
|
|
78
|
+
"""
|
|
79
|
+
Then the following reply is sent:
|
|
80
|
+
"""
|
|
81
|
+
200 OK
|
|
82
|
+
authorization: Token ${{ GoodUser.token }}
|
|
83
|
+
|
|
84
|
+
id: ${{ GoodUser.id }}
|
|
85
|
+
"""
|
|
86
|
+
|
|
57
87
|
Scenario: Creating an Identity using inception with existing credentials
|
|
58
88
|
Given the `identity.federation` configuration:
|
|
59
89
|
"""yaml
|
|
@@ -66,8 +96,9 @@ Feature: Identity Federation
|
|
|
66
96
|
/:
|
|
67
97
|
anonymous: true
|
|
68
98
|
POST:
|
|
99
|
+
io:output: true
|
|
69
100
|
incept: id
|
|
70
|
-
endpoint:
|
|
101
|
+
endpoint: create
|
|
71
102
|
"""
|
|
72
103
|
And the IDP token for Bill is issued
|
|
73
104
|
When the following request is received:
|
|
@@ -123,3 +154,45 @@ Feature: Identity Federation
|
|
|
123
154
|
"""
|
|
124
155
|
403 Forbidden
|
|
125
156
|
"""
|
|
157
|
+
|
|
158
|
+
Scenario: Granting a `system` role to a Principal
|
|
159
|
+
Given the `identity.federation` configuration:
|
|
160
|
+
"""yaml
|
|
161
|
+
explicit_identity_creation: false
|
|
162
|
+
trust:
|
|
163
|
+
- issuer: http://localhost:44444
|
|
164
|
+
principal:
|
|
165
|
+
iss: http://localhost:44444
|
|
166
|
+
sub: root-mock-id
|
|
167
|
+
"""
|
|
168
|
+
And the IDP token for root is issued
|
|
169
|
+
When the following request is received:
|
|
170
|
+
"""
|
|
171
|
+
GET /identity/ HTTP/1.1
|
|
172
|
+
authorization: Bearer ${{ root.id_token }}
|
|
173
|
+
accept: application/yaml
|
|
174
|
+
content-type: application/yaml
|
|
175
|
+
"""
|
|
176
|
+
# create an identity
|
|
177
|
+
Then the following reply is sent:
|
|
178
|
+
"""
|
|
179
|
+
200 OK
|
|
180
|
+
authorization: Token ${{ root.token }}
|
|
181
|
+
|
|
182
|
+
id: ${{ root.id }}
|
|
183
|
+
"""
|
|
184
|
+
# check the role
|
|
185
|
+
When the following request is received:
|
|
186
|
+
"""
|
|
187
|
+
GET /identity/ HTTP/1.1
|
|
188
|
+
accept: application/yaml
|
|
189
|
+
authorization: Token ${{ root.token }}
|
|
190
|
+
"""
|
|
191
|
+
Then the following reply is sent:
|
|
192
|
+
"""
|
|
193
|
+
200 OK
|
|
194
|
+
|
|
195
|
+
id: ${{ root.id }}
|
|
196
|
+
roles:
|
|
197
|
+
- system
|
|
198
|
+
"""
|