@toa.io/extensions.exposition 1.0.0-alpha.21 → 1.0.0-alpha.22
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/context.toa.yaml +2 -2
- package/components/identity.basic/manifest.toa.yaml +18 -9
- package/components/identity.basic/operations/authenticate.d.ts +5 -1
- package/components/identity.basic/operations/authenticate.js +2 -2
- package/components/identity.basic/operations/authenticate.js.map +1 -1
- package/components/identity.basic/operations/incept.d.ts +11 -0
- package/components/identity.basic/operations/incept.js +13 -0
- package/components/identity.basic/operations/incept.js.map +1 -0
- package/components/identity.basic/operations/transit.d.ts +3 -3
- package/components/identity.basic/operations/transit.js +5 -3
- package/components/identity.basic/operations/transit.js.map +1 -1
- package/components/identity.basic/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/operations/types.d.ts +2 -0
- package/components/identity.basic/source/authenticate.ts +12 -5
- package/components/identity.basic/source/incept.ts +22 -0
- package/components/identity.basic/source/transit.ts +7 -5
- package/components/identity.basic/source/types.ts +2 -0
- package/components/identity.federation/manifest.toa.yaml +28 -11
- package/components/identity.federation/operations/authenticate.d.ts +2 -2
- package/components/identity.federation/operations/authenticate.js +6 -5
- package/components/identity.federation/operations/authenticate.js.map +1 -1
- package/components/identity.federation/operations/incept.d.ts +11 -0
- package/components/identity.federation/operations/{create.js → incept.js} +6 -7
- package/components/identity.federation/operations/incept.js.map +1 -0
- package/components/identity.federation/operations/lib/jwt.js +3 -3
- package/components/identity.federation/operations/lib/jwt.js.map +1 -1
- package/components/identity.federation/operations/schemas.d.ts +7 -3
- package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/types.d.ts +5 -0
- package/components/identity.federation/source/authenticate.ts +9 -6
- package/components/identity.federation/source/{create.ts → incept.ts} +10 -9
- package/components/identity.federation/source/lib/jwt.test.ts +2 -2
- package/components/identity.federation/source/lib/jwt.ts +3 -3
- package/components/identity.federation/source/schemas.ts +7 -3
- package/components/identity.federation/source/types.ts +6 -0
- package/components/identity.tokens/manifest.toa.yaml +7 -1
- package/components/identity.tokens/operations/authenticate.d.ts +2 -2
- package/components/identity.tokens/operations/authenticate.js +5 -2
- package/components/identity.tokens/operations/authenticate.js.map +1 -1
- package/components/identity.tokens/operations/decrypt.js +1 -0
- package/components/identity.tokens/operations/decrypt.js.map +1 -1
- package/components/identity.tokens/operations/encrypt.js +1 -0
- 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 +7 -0
- package/components/identity.tokens/source/authenticate.test.ts +11 -4
- package/components/identity.tokens/source/authenticate.ts +7 -3
- package/components/identity.tokens/source/decrypt.test.ts +5 -3
- package/components/identity.tokens/source/decrypt.ts +9 -8
- package/components/identity.tokens/source/encrypt.test.ts +4 -1
- package/components/identity.tokens/source/encrypt.ts +1 -0
- package/components/identity.tokens/source/types.ts +8 -0
- package/documentation/authorities.md +53 -0
- package/documentation/components.md +3 -3
- package/documentation/identity.md +17 -22
- package/documentation/vary.md +5 -11
- package/features/access.feature +55 -7
- package/features/annotation.feature +1 -0
- package/features/authorities.basic.feature +140 -0
- package/features/authorities.feature +32 -0
- package/features/authorities.federation.feature +99 -0
- package/features/authorities.tokens.feature +118 -0
- package/features/body.feature +2 -0
- package/features/cache.feature +39 -5
- package/features/cors.feature +4 -0
- package/features/directives.feature +3 -0
- package/features/dynamic.feature +4 -0
- package/features/errors.feature +12 -1
- package/features/etag.feature +6 -0
- package/features/identity.bans.feature +12 -3
- package/features/identity.basic.feature +34 -15
- package/features/identity.feature +7 -2
- package/features/identity.federation.feature +14 -4
- package/features/identity.roles.feature +29 -17
- package/features/identity.tokens.feature +18 -6
- package/features/io.feature +9 -0
- package/features/octets.entries.feature +8 -0
- package/features/octets.feature +22 -0
- package/features/octets.meta.feature +3 -0
- package/features/octets.workflows.feature +13 -0
- package/features/queries.feature +8 -0
- package/features/require.feature +3 -0
- package/features/response.feature +5 -2
- package/features/routes.feature +7 -0
- package/features/steps/Gateway.ts +23 -6
- package/features/streams.feature +1 -0
- package/features/timing.feature +3 -0
- package/features/vary.feature +49 -0
- package/package.json +7 -7
- package/readme.md +19 -14
- package/schemas/annotation.cos.yaml +1 -1
- package/source/Annotation.ts +3 -3
- package/source/Endpoint.ts +1 -1
- package/source/Factory.ts +8 -10
- package/source/Gateway.ts +2 -6
- package/source/HTTP/Context.ts +3 -1
- package/source/HTTP/Server.ts +23 -26
- package/source/HTTP/exceptions.ts +6 -0
- package/source/Query.ts +9 -5
- package/source/deployment.ts +25 -21
- package/source/directives/auth/Authorization.ts +18 -8
- package/source/directives/auth/Incept.ts +2 -1
- package/source/directives/vary/embeddings/Authority.ts +8 -0
- package/source/directives/vary/embeddings/index.ts +3 -1
- package/source/schemas.ts +1 -1
- package/transpiled/Annotation.d.ts +3 -3
- package/transpiled/Endpoint.js +1 -1
- package/transpiled/Endpoint.js.map +1 -1
- package/transpiled/Factory.js +9 -8
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/Context.d.ts +2 -1
- package/transpiled/HTTP/Context.js +3 -1
- package/transpiled/HTTP/Context.js.map +1 -1
- package/transpiled/HTTP/Server.d.ts +8 -1
- package/transpiled/HTTP/Server.js +14 -20
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/HTTP/exceptions.d.ts +3 -0
- package/transpiled/HTTP/exceptions.js +7 -1
- package/transpiled/HTTP/exceptions.js.map +1 -1
- package/transpiled/Query.js +2 -2
- package/transpiled/Query.js.map +1 -1
- package/transpiled/deployment.d.ts +1 -1
- package/transpiled/deployment.js +21 -19
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/directives/auth/Authorization.js +9 -4
- package/transpiled/directives/auth/Authorization.js.map +1 -1
- package/transpiled/directives/auth/Incept.js +2 -1
- package/transpiled/directives/auth/Incept.js.map +1 -1
- package/transpiled/directives/vary/embeddings/Authority.d.ts +5 -0
- package/transpiled/directives/vary/embeddings/Authority.js +10 -0
- package/transpiled/directives/vary/embeddings/Authority.js.map +1 -0
- package/transpiled/directives/vary/embeddings/index.js +3 -1
- package/transpiled/directives/vary/embeddings/index.js.map +1 -1
- package/transpiled/schemas.d.ts +1 -1
- package/transpiled/schemas.js +2 -2
- package/transpiled/schemas.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/operations/create.d.ts +0 -10
- package/components/identity.basic/operations/create.js +0 -10
- package/components/identity.basic/operations/create.js.map +0 -1
- package/components/identity.basic/source/create.ts +0 -18
- package/components/identity.federation/operations/create.d.ts +0 -10
- package/components/identity.federation/operations/create.js.map +0 -1
- package/source/HTTP/Server.test.ts +0 -126
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Feature: Basic credentials with authorities
|
|
2
|
+
|
|
3
|
+
Scenario: Basic credentials are scoped to authorities
|
|
4
|
+
Given the annotation:
|
|
5
|
+
"""yaml
|
|
6
|
+
authorities:
|
|
7
|
+
one: the.one.com
|
|
8
|
+
two: the.two.com
|
|
9
|
+
/:
|
|
10
|
+
/:id:
|
|
11
|
+
auth:id: id
|
|
12
|
+
GET:
|
|
13
|
+
dev:stub: Hello
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
# create basic credentials within the `one` authority
|
|
17
|
+
When the following request is received:
|
|
18
|
+
"""
|
|
19
|
+
POST /identity/basic/ HTTP/1.1
|
|
20
|
+
host: the.one.com
|
|
21
|
+
content-type: application/yaml
|
|
22
|
+
accept: application/yaml
|
|
23
|
+
|
|
24
|
+
username: #{{ id | set one.username }}
|
|
25
|
+
password: '#{{ password 8 | set one.password }}'
|
|
26
|
+
"""
|
|
27
|
+
Then the following reply is sent:
|
|
28
|
+
"""
|
|
29
|
+
201 Created
|
|
30
|
+
|
|
31
|
+
id: ${{ one.id }}
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
# create basic credentials within the `two` authority
|
|
35
|
+
When the following request is received:
|
|
36
|
+
"""
|
|
37
|
+
POST /identity/basic/ HTTP/1.1
|
|
38
|
+
host: the.two.com
|
|
39
|
+
content-type: application/yaml
|
|
40
|
+
accept: application/yaml
|
|
41
|
+
|
|
42
|
+
username: #{{ id | set two.username }}
|
|
43
|
+
password: '#{{ password 8 | set two.password }}'
|
|
44
|
+
"""
|
|
45
|
+
Then the following reply is sent:
|
|
46
|
+
"""
|
|
47
|
+
201 Created
|
|
48
|
+
|
|
49
|
+
id: ${{ two.id }}
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
# access the resource with the `one` authority
|
|
53
|
+
When the following request is received:
|
|
54
|
+
"""
|
|
55
|
+
GET /${{ one.id }}/ HTTP/1.1
|
|
56
|
+
host: the.one.com
|
|
57
|
+
authorization: Basic #{{ basic one }}
|
|
58
|
+
"""
|
|
59
|
+
Then the following reply is sent:
|
|
60
|
+
"""
|
|
61
|
+
200 OK
|
|
62
|
+
"""
|
|
63
|
+
When the following request is received:
|
|
64
|
+
"""
|
|
65
|
+
GET /${{ two.id }}/ HTTP/1.1
|
|
66
|
+
host: the.one.com
|
|
67
|
+
authorization: Basic #{{ basic two }}
|
|
68
|
+
"""
|
|
69
|
+
Then the following reply is sent:
|
|
70
|
+
"""
|
|
71
|
+
401 Unauthorized
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
# access the resource with the `two` authority
|
|
75
|
+
When the following request is received:
|
|
76
|
+
"""
|
|
77
|
+
GET /${{ one.id }}/ HTTP/1.1
|
|
78
|
+
host: the.two.com
|
|
79
|
+
authorization: Basic #{{ basic one }}
|
|
80
|
+
"""
|
|
81
|
+
Then the following reply is sent:
|
|
82
|
+
"""
|
|
83
|
+
401 Unauthorized
|
|
84
|
+
"""
|
|
85
|
+
When the following request is received:
|
|
86
|
+
"""
|
|
87
|
+
GET /${{ two.id }}/ HTTP/1.1
|
|
88
|
+
host: the.two.com
|
|
89
|
+
authorization: Basic #{{ basic two }}
|
|
90
|
+
"""
|
|
91
|
+
Then the following reply is sent:
|
|
92
|
+
"""
|
|
93
|
+
200 OK
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
# create `one` credentials in the `two` authority
|
|
97
|
+
When the following request is received:
|
|
98
|
+
"""
|
|
99
|
+
POST /identity/basic/ HTTP/1.1
|
|
100
|
+
host: the.one.com
|
|
101
|
+
content-type: application/yaml
|
|
102
|
+
accept: application/yaml
|
|
103
|
+
|
|
104
|
+
username: ${{ one.username }}
|
|
105
|
+
password: ${{ one.password }}
|
|
106
|
+
"""
|
|
107
|
+
Then the following reply is sent:
|
|
108
|
+
"""
|
|
109
|
+
422 Unprocessable Entity
|
|
110
|
+
"""
|
|
111
|
+
When the following request is received:
|
|
112
|
+
"""
|
|
113
|
+
POST /identity/basic/ HTTP/1.1
|
|
114
|
+
host: the.two.com
|
|
115
|
+
content-type: application/yaml
|
|
116
|
+
accept: application/yaml
|
|
117
|
+
|
|
118
|
+
username: ${{ one.username }}
|
|
119
|
+
password: ${{ one.password }}
|
|
120
|
+
"""
|
|
121
|
+
Then the following reply is sent:
|
|
122
|
+
"""
|
|
123
|
+
201 Created
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
# create `two` credentials in the `one` authority
|
|
127
|
+
When the following request is received:
|
|
128
|
+
"""
|
|
129
|
+
POST /identity/basic/ HTTP/1.1
|
|
130
|
+
host: the.one.com
|
|
131
|
+
content-type: application/yaml
|
|
132
|
+
accept: application/yaml
|
|
133
|
+
|
|
134
|
+
username: ${{ two.username }}
|
|
135
|
+
password: ${{ two.password }}
|
|
136
|
+
"""
|
|
137
|
+
Then the following reply is sent:
|
|
138
|
+
"""
|
|
139
|
+
201 Created
|
|
140
|
+
"""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Feature: Authorities
|
|
2
|
+
|
|
3
|
+
Scenario: Accessing an authority
|
|
4
|
+
Given the annotation:
|
|
5
|
+
"""yaml
|
|
6
|
+
authorities:
|
|
7
|
+
example: the.example.com
|
|
8
|
+
/:
|
|
9
|
+
anonymous: true
|
|
10
|
+
GET:
|
|
11
|
+
dev:stub: Hello
|
|
12
|
+
"""
|
|
13
|
+
When the following request is received:
|
|
14
|
+
"""
|
|
15
|
+
GET / HTTP/1.1
|
|
16
|
+
host: the.example.com
|
|
17
|
+
"""
|
|
18
|
+
Then the following reply is sent:
|
|
19
|
+
"""
|
|
20
|
+
200 OK
|
|
21
|
+
"""
|
|
22
|
+
When the following request is received:
|
|
23
|
+
"""
|
|
24
|
+
GET / HTTP/1.1
|
|
25
|
+
host: the.other.com
|
|
26
|
+
"""
|
|
27
|
+
Then the following reply is sent:
|
|
28
|
+
"""
|
|
29
|
+
404 Not Found
|
|
30
|
+
|
|
31
|
+
Unknown authority
|
|
32
|
+
"""
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Feature: OIDC tokens with authorities
|
|
2
|
+
|
|
3
|
+
Scenario: OIDC tokens are scoped to authorities
|
|
4
|
+
Given the annotation:
|
|
5
|
+
"""yaml
|
|
6
|
+
authorities:
|
|
7
|
+
one: the.one.com
|
|
8
|
+
two: the.two.com
|
|
9
|
+
/:
|
|
10
|
+
/:id:
|
|
11
|
+
auth:id: id
|
|
12
|
+
GET:
|
|
13
|
+
dev:stub: Hello
|
|
14
|
+
"""
|
|
15
|
+
And local IDP is running
|
|
16
|
+
And the `identity.federation` database is empty
|
|
17
|
+
And the `identity.federation` configuration:
|
|
18
|
+
"""yaml
|
|
19
|
+
trust:
|
|
20
|
+
- iss: http://localhost:44444
|
|
21
|
+
"""
|
|
22
|
+
And the IDP token for One is issued
|
|
23
|
+
And the IDP token for Two is issued
|
|
24
|
+
|
|
25
|
+
# create identities
|
|
26
|
+
When the following request is received:
|
|
27
|
+
"""
|
|
28
|
+
POST /identity/federation/ HTTP/1.1
|
|
29
|
+
host: the.one.com
|
|
30
|
+
accept: application/yaml
|
|
31
|
+
content-type: application/yaml
|
|
32
|
+
|
|
33
|
+
credentials: ${{ One.id_token }}
|
|
34
|
+
"""
|
|
35
|
+
Then the following reply is sent:
|
|
36
|
+
"""
|
|
37
|
+
201 Created
|
|
38
|
+
|
|
39
|
+
id: ${{ One.id }}
|
|
40
|
+
"""
|
|
41
|
+
When the following request is received:
|
|
42
|
+
"""
|
|
43
|
+
POST /identity/federation/ HTTP/1.1
|
|
44
|
+
host: the.two.com
|
|
45
|
+
accept: application/yaml
|
|
46
|
+
content-type: application/yaml
|
|
47
|
+
|
|
48
|
+
credentials: ${{ Two.id_token }}
|
|
49
|
+
"""
|
|
50
|
+
Then the following reply is sent:
|
|
51
|
+
"""
|
|
52
|
+
201 Created
|
|
53
|
+
|
|
54
|
+
id: ${{ Two.id }}
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
# access `one` authority
|
|
58
|
+
When the following request is received:
|
|
59
|
+
"""
|
|
60
|
+
GET /${{ One.id }}/ HTTP/1.1
|
|
61
|
+
host: the.one.com
|
|
62
|
+
authorization: Bearer ${{ One.id_token }}
|
|
63
|
+
"""
|
|
64
|
+
Then the following reply is sent:
|
|
65
|
+
"""
|
|
66
|
+
200 OK
|
|
67
|
+
"""
|
|
68
|
+
When the following request is received:
|
|
69
|
+
"""
|
|
70
|
+
GET /${{ Two.id }}/ HTTP/1.1
|
|
71
|
+
host: the.one.com
|
|
72
|
+
authorization: Bearer ${{ Two.id_token }}
|
|
73
|
+
"""
|
|
74
|
+
Then the following reply is sent:
|
|
75
|
+
"""
|
|
76
|
+
401 Unauthorized
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
# access `two` authority
|
|
80
|
+
When the following request is received:
|
|
81
|
+
"""
|
|
82
|
+
GET /${{ One.id }}/ HTTP/1.1
|
|
83
|
+
host: the.two.com
|
|
84
|
+
authorization: Bearer ${{ One.id_token }}
|
|
85
|
+
"""
|
|
86
|
+
Then the following reply is sent:
|
|
87
|
+
"""
|
|
88
|
+
401 Unauthorized
|
|
89
|
+
"""
|
|
90
|
+
When the following request is received:
|
|
91
|
+
"""
|
|
92
|
+
GET /${{ Two.id }}/ HTTP/1.1
|
|
93
|
+
host: the.two.com
|
|
94
|
+
authorization: Bearer ${{ Two.id_token }}
|
|
95
|
+
"""
|
|
96
|
+
Then the following reply is sent:
|
|
97
|
+
"""
|
|
98
|
+
200 OK
|
|
99
|
+
"""
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
Feature: Token credentials with authorities
|
|
2
|
+
|
|
3
|
+
Scenario: Tokens are scoped to authorities
|
|
4
|
+
Given the annotation:
|
|
5
|
+
"""yaml
|
|
6
|
+
authorities:
|
|
7
|
+
one: the.one.com
|
|
8
|
+
two: the.two.com
|
|
9
|
+
/:
|
|
10
|
+
/:id:
|
|
11
|
+
auth:id: id
|
|
12
|
+
GET:
|
|
13
|
+
dev:stub: Hello
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
# create identity within the `one` authority
|
|
17
|
+
When the following request is received:
|
|
18
|
+
"""
|
|
19
|
+
POST /identity/basic/ HTTP/1.1
|
|
20
|
+
host: the.one.com
|
|
21
|
+
content-type: application/yaml
|
|
22
|
+
accept: application/yaml
|
|
23
|
+
|
|
24
|
+
username: #{{ id | set one.username }}
|
|
25
|
+
password: '#{{ password 8 | set one.password }}'
|
|
26
|
+
"""
|
|
27
|
+
Then the following reply is sent:
|
|
28
|
+
"""
|
|
29
|
+
201 Created
|
|
30
|
+
"""
|
|
31
|
+
When the following request is received:
|
|
32
|
+
"""
|
|
33
|
+
GET /identity/ HTTP/1.1
|
|
34
|
+
host: the.one.com
|
|
35
|
+
accept: application/yaml
|
|
36
|
+
authorization: Basic #{{ basic one }}
|
|
37
|
+
"""
|
|
38
|
+
Then the following reply is sent:
|
|
39
|
+
"""
|
|
40
|
+
200 OK
|
|
41
|
+
authorization: Token ${{ one.token }}
|
|
42
|
+
|
|
43
|
+
id: ${{ one.id }}
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
# create identity within the `two` authority
|
|
47
|
+
When the following request is received:
|
|
48
|
+
"""
|
|
49
|
+
POST /identity/basic/ HTTP/1.1
|
|
50
|
+
host: the.two.com
|
|
51
|
+
content-type: application/yaml
|
|
52
|
+
accept: application/yaml
|
|
53
|
+
|
|
54
|
+
username: #{{ id | set two.username }}
|
|
55
|
+
password: '#{{ password 8 | set two.password }}'
|
|
56
|
+
"""
|
|
57
|
+
Then the following reply is sent:
|
|
58
|
+
"""
|
|
59
|
+
201 Created
|
|
60
|
+
"""
|
|
61
|
+
When the following request is received:
|
|
62
|
+
"""
|
|
63
|
+
GET /identity/ HTTP/1.1
|
|
64
|
+
host: the.two.com
|
|
65
|
+
accept: application/yaml
|
|
66
|
+
authorization: Basic #{{ basic two }}
|
|
67
|
+
"""
|
|
68
|
+
Then the following reply is sent:
|
|
69
|
+
"""
|
|
70
|
+
200 OK
|
|
71
|
+
authorization: Token ${{ two.token }}
|
|
72
|
+
|
|
73
|
+
id: ${{ two.id }}
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
# access `one` authority
|
|
77
|
+
When the following request is received:
|
|
78
|
+
"""
|
|
79
|
+
GET /${{ one.id }}/ HTTP/1.1
|
|
80
|
+
host: the.one.com
|
|
81
|
+
authorization: Token ${{ one.token }}
|
|
82
|
+
"""
|
|
83
|
+
Then the following reply is sent:
|
|
84
|
+
"""
|
|
85
|
+
200 OK
|
|
86
|
+
"""
|
|
87
|
+
When the following request is received:
|
|
88
|
+
"""
|
|
89
|
+
GET /${{ two.id }}/ HTTP/1.1
|
|
90
|
+
host: the.one.com
|
|
91
|
+
authorization: Token ${{ two.token }}
|
|
92
|
+
"""
|
|
93
|
+
Then the following reply is sent:
|
|
94
|
+
"""
|
|
95
|
+
401 Unauthorized
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
# access `two` authority
|
|
99
|
+
When the following request is received:
|
|
100
|
+
"""
|
|
101
|
+
GET /${{ one.id }}/ HTTP/1.1
|
|
102
|
+
host: the.two.com
|
|
103
|
+
authorization: Token ${{ one.token }}
|
|
104
|
+
"""
|
|
105
|
+
Then the following reply is sent:
|
|
106
|
+
"""
|
|
107
|
+
401 Unauthorized
|
|
108
|
+
"""
|
|
109
|
+
When the following request is received:
|
|
110
|
+
"""
|
|
111
|
+
GET /${{ two.id }}/ HTTP/1.1
|
|
112
|
+
host: the.two.com
|
|
113
|
+
authorization: Token ${{ two.token }}
|
|
114
|
+
"""
|
|
115
|
+
Then the following reply is sent:
|
|
116
|
+
"""
|
|
117
|
+
200 OK
|
|
118
|
+
"""
|
package/features/body.feature
CHANGED
|
@@ -11,6 +11,7 @@ Feature: Request body
|
|
|
11
11
|
When the following request is received:
|
|
12
12
|
"""
|
|
13
13
|
POST /pots/ HTTP/1.1
|
|
14
|
+
host: nex.toa.io
|
|
14
15
|
content-type: application/yaml
|
|
15
16
|
|
|
16
17
|
title: Hello
|
|
@@ -32,6 +33,7 @@ Feature: Request body
|
|
|
32
33
|
When the following request is received:
|
|
33
34
|
"""
|
|
34
35
|
GET /echo/world/ HTTP/1.1
|
|
36
|
+
host: nex.toa.io
|
|
35
37
|
accept: text/plain
|
|
36
38
|
"""
|
|
37
39
|
Then the following reply is sent:
|
package/features/cache.feature
CHANGED
|
@@ -4,8 +4,8 @@ Feature: Caching
|
|
|
4
4
|
Given the `identity.basic` database contains:
|
|
5
5
|
# developer:secret
|
|
6
6
|
# user:12345
|
|
7
|
-
| _id | username | password |
|
|
8
|
-
| b70a7dbca6b14a2eaac8a9eb4b2ff4db | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
|
|
7
|
+
| _id | authority | username | password |
|
|
8
|
+
| b70a7dbca6b14a2eaac8a9eb4b2ff4db | nex | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
|
|
9
9
|
Given the `identity.roles` database contains:
|
|
10
10
|
| _id | identity | role |
|
|
11
11
|
| 775a648d054e4ce1a65f8f17e5b51803 | b70a7dbca6b14a2eaac8a9eb4b2ff4db | developer |
|
|
@@ -23,6 +23,7 @@ Feature: Caching
|
|
|
23
23
|
When the following request is received:
|
|
24
24
|
"""
|
|
25
25
|
GET / HTTP/1.1
|
|
26
|
+
host: nex.toa.io
|
|
26
27
|
accept: text/plain
|
|
27
28
|
"""
|
|
28
29
|
Then the following reply is sent:
|
|
@@ -53,9 +54,22 @@ Feature: Caching
|
|
|
53
54
|
GET:
|
|
54
55
|
dev:stub: hello
|
|
55
56
|
"""
|
|
57
|
+
When the following request is received:
|
|
58
|
+
"""
|
|
59
|
+
GET /identity/ HTTP/1.1
|
|
60
|
+
host: nex.toa.io
|
|
61
|
+
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
62
|
+
"""
|
|
63
|
+
Then the following reply is sent:
|
|
64
|
+
"""
|
|
65
|
+
200 OK
|
|
66
|
+
authorization: Token ${{ token }}
|
|
67
|
+
cache-control: no-store
|
|
68
|
+
"""
|
|
56
69
|
When the following request is received:
|
|
57
70
|
"""
|
|
58
71
|
GET / HTTP/1.1
|
|
72
|
+
host: nex.toa.io
|
|
59
73
|
accept: text/plain
|
|
60
74
|
"""
|
|
61
75
|
Then the following reply is sent:
|
|
@@ -69,8 +83,9 @@ Feature: Caching
|
|
|
69
83
|
When the following request is received:
|
|
70
84
|
"""
|
|
71
85
|
GET /foo/ HTTP/1.1
|
|
86
|
+
host: nex.toa.io
|
|
72
87
|
accept: text/plain
|
|
73
|
-
authorization:
|
|
88
|
+
authorization: Token ${{ token }}
|
|
74
89
|
"""
|
|
75
90
|
Then the following reply is sent:
|
|
76
91
|
"""
|
|
@@ -83,8 +98,9 @@ Feature: Caching
|
|
|
83
98
|
When the following request is received:
|
|
84
99
|
"""
|
|
85
100
|
GET /bar/ HTTP/1.1
|
|
101
|
+
host: nex.toa.io
|
|
86
102
|
accept: text/plain
|
|
87
|
-
authorization:
|
|
103
|
+
authorization: Token ${{ token }}
|
|
88
104
|
"""
|
|
89
105
|
Then the following reply is sent:
|
|
90
106
|
"""
|
|
@@ -111,6 +127,7 @@ Feature: Caching
|
|
|
111
127
|
When the following request is received:
|
|
112
128
|
"""
|
|
113
129
|
POST / HTTP/1.1
|
|
130
|
+
host: nex.toa.io
|
|
114
131
|
accept: application/yaml
|
|
115
132
|
"""
|
|
116
133
|
Then the reply does not contain:
|
|
@@ -130,8 +147,21 @@ Feature: Caching
|
|
|
130
147
|
"""
|
|
131
148
|
When the following request is received:
|
|
132
149
|
"""
|
|
133
|
-
GET / HTTP/1.1
|
|
150
|
+
GET /identity/ HTTP/1.1
|
|
151
|
+
host: nex.toa.io
|
|
134
152
|
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
153
|
+
"""
|
|
154
|
+
Then the following reply is sent:
|
|
155
|
+
"""
|
|
156
|
+
200 OK
|
|
157
|
+
authorization: Token ${{ token }}
|
|
158
|
+
cache-control: no-store
|
|
159
|
+
"""
|
|
160
|
+
When the following request is received:
|
|
161
|
+
"""
|
|
162
|
+
GET / HTTP/1.1
|
|
163
|
+
host: nex.toa.io
|
|
164
|
+
authorization: Token ${{ token }}
|
|
135
165
|
accept: text/plain
|
|
136
166
|
|
|
137
167
|
"""
|
|
@@ -155,6 +185,7 @@ Feature: Caching
|
|
|
155
185
|
When the following request is received:
|
|
156
186
|
"""
|
|
157
187
|
GET / HTTP/1.1
|
|
188
|
+
host: nex.toa.io
|
|
158
189
|
accept: text/plain
|
|
159
190
|
"""
|
|
160
191
|
Then the reply does not contain:
|
|
@@ -178,6 +209,7 @@ Feature: Caching
|
|
|
178
209
|
When the following request is received:
|
|
179
210
|
"""
|
|
180
211
|
GET /efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
212
|
+
host: nex.toa.io
|
|
181
213
|
authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
|
|
182
214
|
"""
|
|
183
215
|
# `no-store` when token is issued
|
|
@@ -185,10 +217,12 @@ Feature: Caching
|
|
|
185
217
|
"""
|
|
186
218
|
200 OK
|
|
187
219
|
authorization: Token ${{ token }}
|
|
220
|
+
cache-control: no-store
|
|
188
221
|
"""
|
|
189
222
|
When the following request is received:
|
|
190
223
|
"""
|
|
191
224
|
GET /efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
|
|
225
|
+
host: nex.toa.io
|
|
192
226
|
authorization: Token ${{ token }}
|
|
193
227
|
"""
|
|
194
228
|
Then the following reply is sent:
|
package/features/cors.feature
CHANGED
|
@@ -12,6 +12,7 @@ Feature: CORS Support
|
|
|
12
12
|
When the following request is received:
|
|
13
13
|
"""
|
|
14
14
|
OPTIONS / HTTP/1.1
|
|
15
|
+
host: nex.toa.io
|
|
15
16
|
origin: https://hello.world
|
|
16
17
|
"""
|
|
17
18
|
Then the following reply is sent:
|
|
@@ -28,6 +29,7 @@ Feature: CORS Support
|
|
|
28
29
|
When the following request is received:
|
|
29
30
|
"""
|
|
30
31
|
GET /foo/ HTTP/1.1
|
|
32
|
+
host: nex.toa.io
|
|
31
33
|
origin: https://hello.world
|
|
32
34
|
"""
|
|
33
35
|
Then the following reply is sent:
|
|
@@ -49,6 +51,7 @@ Feature: CORS Support
|
|
|
49
51
|
When the following request is received:
|
|
50
52
|
"""
|
|
51
53
|
GET /bar/ HTTP/1.1
|
|
54
|
+
host: nex.toa.io
|
|
52
55
|
origin: https://hello.world
|
|
53
56
|
"""
|
|
54
57
|
Then the following reply is sent:
|
|
@@ -61,6 +64,7 @@ Feature: CORS Support
|
|
|
61
64
|
When the following request is received:
|
|
62
65
|
"""
|
|
63
66
|
GET /foo/ HTTP/1.1
|
|
67
|
+
host: nex.toa.io
|
|
64
68
|
origin: https://hello.world
|
|
65
69
|
"""
|
|
66
70
|
Then the following reply is sent:
|
|
@@ -13,6 +13,7 @@ Feature: Directives
|
|
|
13
13
|
When the following request is received:
|
|
14
14
|
"""
|
|
15
15
|
GET / HTTP/1.1
|
|
16
|
+
host: nex.toa.io
|
|
16
17
|
accept: application/json
|
|
17
18
|
"""
|
|
18
19
|
Then the following reply is sent:
|
|
@@ -38,6 +39,7 @@ Feature: Directives
|
|
|
38
39
|
When the following request is received:
|
|
39
40
|
"""
|
|
40
41
|
GET /pots/ HTTP/1.1
|
|
42
|
+
host: nex.toa.io
|
|
41
43
|
accept: application/yaml
|
|
42
44
|
"""
|
|
43
45
|
Then the following reply is sent:
|
|
@@ -50,6 +52,7 @@ Feature: Directives
|
|
|
50
52
|
When the following request is received:
|
|
51
53
|
"""
|
|
52
54
|
GET /pots/non-existent/ HTTP/1.1
|
|
55
|
+
host: nex.toa.io
|
|
53
56
|
accept: application/yaml
|
|
54
57
|
"""
|
|
55
58
|
Then the following reply is sent:
|
package/features/dynamic.feature
CHANGED
|
@@ -18,6 +18,7 @@ Feature: Dynamic tree updates
|
|
|
18
18
|
When the following request is received:
|
|
19
19
|
"""
|
|
20
20
|
GET /pots/ HTTP/1.1
|
|
21
|
+
host: nex.toa.io
|
|
21
22
|
"""
|
|
22
23
|
Then the following reply is sent:
|
|
23
24
|
"""
|
|
@@ -34,6 +35,7 @@ Feature: Dynamic tree updates
|
|
|
34
35
|
When the following request is received:
|
|
35
36
|
"""
|
|
36
37
|
GET /pots/ HTTP/1.1
|
|
38
|
+
host: nex.toa.io
|
|
37
39
|
accept: application/yaml
|
|
38
40
|
"""
|
|
39
41
|
Then the following reply is sent:
|
|
@@ -66,6 +68,7 @@ Feature: Dynamic tree updates
|
|
|
66
68
|
When the following request is received:
|
|
67
69
|
"""
|
|
68
70
|
GET /pots/big/ HTTP/1.1
|
|
71
|
+
host: nex.toa.io
|
|
69
72
|
accept: application/yaml
|
|
70
73
|
"""
|
|
71
74
|
Then the following reply is sent:
|
|
@@ -98,6 +101,7 @@ Feature: Dynamic tree updates
|
|
|
98
101
|
When the following request is received:
|
|
99
102
|
"""
|
|
100
103
|
GET /pots/big/?criteria=temperature>50 HTTP/1.1
|
|
104
|
+
host: nex.toa.io
|
|
101
105
|
accept: application/yaml
|
|
102
106
|
"""
|
|
103
107
|
Then the following reply is sent:
|