@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.
Files changed (145) hide show
  1. package/components/context.toa.yaml +2 -2
  2. package/components/identity.basic/manifest.toa.yaml +18 -9
  3. package/components/identity.basic/operations/authenticate.d.ts +5 -1
  4. package/components/identity.basic/operations/authenticate.js +2 -2
  5. package/components/identity.basic/operations/authenticate.js.map +1 -1
  6. package/components/identity.basic/operations/incept.d.ts +11 -0
  7. package/components/identity.basic/operations/incept.js +13 -0
  8. package/components/identity.basic/operations/incept.js.map +1 -0
  9. package/components/identity.basic/operations/transit.d.ts +3 -3
  10. package/components/identity.basic/operations/transit.js +5 -3
  11. package/components/identity.basic/operations/transit.js.map +1 -1
  12. package/components/identity.basic/operations/tsconfig.tsbuildinfo +1 -1
  13. package/components/identity.basic/operations/types.d.ts +2 -0
  14. package/components/identity.basic/source/authenticate.ts +12 -5
  15. package/components/identity.basic/source/incept.ts +22 -0
  16. package/components/identity.basic/source/transit.ts +7 -5
  17. package/components/identity.basic/source/types.ts +2 -0
  18. package/components/identity.federation/manifest.toa.yaml +28 -11
  19. package/components/identity.federation/operations/authenticate.d.ts +2 -2
  20. package/components/identity.federation/operations/authenticate.js +6 -5
  21. package/components/identity.federation/operations/authenticate.js.map +1 -1
  22. package/components/identity.federation/operations/incept.d.ts +11 -0
  23. package/components/identity.federation/operations/{create.js → incept.js} +6 -7
  24. package/components/identity.federation/operations/incept.js.map +1 -0
  25. package/components/identity.federation/operations/lib/jwt.js +3 -3
  26. package/components/identity.federation/operations/lib/jwt.js.map +1 -1
  27. package/components/identity.federation/operations/schemas.d.ts +7 -3
  28. package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
  29. package/components/identity.federation/operations/types.d.ts +5 -0
  30. package/components/identity.federation/source/authenticate.ts +9 -6
  31. package/components/identity.federation/source/{create.ts → incept.ts} +10 -9
  32. package/components/identity.federation/source/lib/jwt.test.ts +2 -2
  33. package/components/identity.federation/source/lib/jwt.ts +3 -3
  34. package/components/identity.federation/source/schemas.ts +7 -3
  35. package/components/identity.federation/source/types.ts +6 -0
  36. package/components/identity.tokens/manifest.toa.yaml +7 -1
  37. package/components/identity.tokens/operations/authenticate.d.ts +2 -2
  38. package/components/identity.tokens/operations/authenticate.js +5 -2
  39. package/components/identity.tokens/operations/authenticate.js.map +1 -1
  40. package/components/identity.tokens/operations/decrypt.js +1 -0
  41. package/components/identity.tokens/operations/decrypt.js.map +1 -1
  42. package/components/identity.tokens/operations/encrypt.js +1 -0
  43. package/components/identity.tokens/operations/encrypt.js.map +1 -1
  44. package/components/identity.tokens/operations/tsconfig.tsbuildinfo +1 -1
  45. package/components/identity.tokens/operations/types.d.ts +7 -0
  46. package/components/identity.tokens/source/authenticate.test.ts +11 -4
  47. package/components/identity.tokens/source/authenticate.ts +7 -3
  48. package/components/identity.tokens/source/decrypt.test.ts +5 -3
  49. package/components/identity.tokens/source/decrypt.ts +9 -8
  50. package/components/identity.tokens/source/encrypt.test.ts +4 -1
  51. package/components/identity.tokens/source/encrypt.ts +1 -0
  52. package/components/identity.tokens/source/types.ts +8 -0
  53. package/documentation/authorities.md +53 -0
  54. package/documentation/components.md +3 -3
  55. package/documentation/identity.md +17 -22
  56. package/documentation/vary.md +5 -11
  57. package/features/access.feature +55 -7
  58. package/features/annotation.feature +1 -0
  59. package/features/authorities.basic.feature +140 -0
  60. package/features/authorities.feature +32 -0
  61. package/features/authorities.federation.feature +99 -0
  62. package/features/authorities.tokens.feature +118 -0
  63. package/features/body.feature +2 -0
  64. package/features/cache.feature +39 -5
  65. package/features/cors.feature +4 -0
  66. package/features/directives.feature +3 -0
  67. package/features/dynamic.feature +4 -0
  68. package/features/errors.feature +12 -1
  69. package/features/etag.feature +6 -0
  70. package/features/identity.bans.feature +12 -3
  71. package/features/identity.basic.feature +34 -15
  72. package/features/identity.feature +7 -2
  73. package/features/identity.federation.feature +14 -4
  74. package/features/identity.roles.feature +29 -17
  75. package/features/identity.tokens.feature +18 -6
  76. package/features/io.feature +9 -0
  77. package/features/octets.entries.feature +8 -0
  78. package/features/octets.feature +22 -0
  79. package/features/octets.meta.feature +3 -0
  80. package/features/octets.workflows.feature +13 -0
  81. package/features/queries.feature +8 -0
  82. package/features/require.feature +3 -0
  83. package/features/response.feature +5 -2
  84. package/features/routes.feature +7 -0
  85. package/features/steps/Gateway.ts +23 -6
  86. package/features/streams.feature +1 -0
  87. package/features/timing.feature +3 -0
  88. package/features/vary.feature +49 -0
  89. package/package.json +7 -7
  90. package/readme.md +19 -14
  91. package/schemas/annotation.cos.yaml +1 -1
  92. package/source/Annotation.ts +3 -3
  93. package/source/Endpoint.ts +1 -1
  94. package/source/Factory.ts +8 -10
  95. package/source/Gateway.ts +2 -6
  96. package/source/HTTP/Context.ts +3 -1
  97. package/source/HTTP/Server.ts +23 -26
  98. package/source/HTTP/exceptions.ts +6 -0
  99. package/source/Query.ts +9 -5
  100. package/source/deployment.ts +25 -21
  101. package/source/directives/auth/Authorization.ts +18 -8
  102. package/source/directives/auth/Incept.ts +2 -1
  103. package/source/directives/vary/embeddings/Authority.ts +8 -0
  104. package/source/directives/vary/embeddings/index.ts +3 -1
  105. package/source/schemas.ts +1 -1
  106. package/transpiled/Annotation.d.ts +3 -3
  107. package/transpiled/Endpoint.js +1 -1
  108. package/transpiled/Endpoint.js.map +1 -1
  109. package/transpiled/Factory.js +9 -8
  110. package/transpiled/Factory.js.map +1 -1
  111. package/transpiled/Gateway.js.map +1 -1
  112. package/transpiled/HTTP/Context.d.ts +2 -1
  113. package/transpiled/HTTP/Context.js +3 -1
  114. package/transpiled/HTTP/Context.js.map +1 -1
  115. package/transpiled/HTTP/Server.d.ts +8 -1
  116. package/transpiled/HTTP/Server.js +14 -20
  117. package/transpiled/HTTP/Server.js.map +1 -1
  118. package/transpiled/HTTP/exceptions.d.ts +3 -0
  119. package/transpiled/HTTP/exceptions.js +7 -1
  120. package/transpiled/HTTP/exceptions.js.map +1 -1
  121. package/transpiled/Query.js +2 -2
  122. package/transpiled/Query.js.map +1 -1
  123. package/transpiled/deployment.d.ts +1 -1
  124. package/transpiled/deployment.js +21 -19
  125. package/transpiled/deployment.js.map +1 -1
  126. package/transpiled/directives/auth/Authorization.js +9 -4
  127. package/transpiled/directives/auth/Authorization.js.map +1 -1
  128. package/transpiled/directives/auth/Incept.js +2 -1
  129. package/transpiled/directives/auth/Incept.js.map +1 -1
  130. package/transpiled/directives/vary/embeddings/Authority.d.ts +5 -0
  131. package/transpiled/directives/vary/embeddings/Authority.js +10 -0
  132. package/transpiled/directives/vary/embeddings/Authority.js.map +1 -0
  133. package/transpiled/directives/vary/embeddings/index.js +3 -1
  134. package/transpiled/directives/vary/embeddings/index.js.map +1 -1
  135. package/transpiled/schemas.d.ts +1 -1
  136. package/transpiled/schemas.js +2 -2
  137. package/transpiled/schemas.js.map +1 -1
  138. package/transpiled/tsconfig.tsbuildinfo +1 -1
  139. package/components/identity.basic/operations/create.d.ts +0 -10
  140. package/components/identity.basic/operations/create.js +0 -10
  141. package/components/identity.basic/operations/create.js.map +0 -1
  142. package/components/identity.basic/source/create.ts +0 -18
  143. package/components/identity.federation/operations/create.d.ts +0 -10
  144. package/components/identity.federation/operations/create.js.map +0 -1
  145. package/source/HTTP/Server.test.ts +0 -126
@@ -5,9 +5,9 @@ Feature: Roles management
5
5
  # root:secret
6
6
  # user:pass
7
7
  Given the `identity.basic` database contains:
8
- | _id | username | password |
9
- | 72cf9b0ab0ac4ab2b8036e4e940ddcae | root | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
10
- | 4344518184ad44228baffce7a44fd0b1 | user | $2b$10$JoiAQUS7tzobDAFIDBWhWeEIJv933dQetyjRzSmfQGaJE5ZlJbmYy |
8
+ | _id | authority | username | password |
9
+ | 72cf9b0ab0ac4ab2b8036e4e940ddcae | nex | root | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
10
+ | 4344518184ad44228baffce7a44fd0b1 | nex | user | $2b$10$JoiAQUS7tzobDAFIDBWhWeEIJv933dQetyjRzSmfQGaJE5ZlJbmYy |
11
11
  And the `identity.roles` database contains:
12
12
  | _id | identity | role |
13
13
  | 9c4702490ff84f2a9e1b1da2ab64bdd4 | 72cf9b0ab0ac4ab2b8036e4e940ddcae | system:identity:roles |
@@ -24,6 +24,7 @@ Feature: Roles management
24
24
  # user doesn't have the required role
25
25
  """
26
26
  GET / HTTP/1.1
27
+ host: nex.toa.io
27
28
  authorization: Basic dXNlcjpwYXNz
28
29
  """
29
30
  Then the following reply is sent:
@@ -34,6 +35,7 @@ Feature: Roles management
34
35
  # root adds a role to a user
35
36
  """
36
37
  POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
38
+ host: nex.toa.io
37
39
  authorization: Basic cm9vdDpzZWNyZXQ=
38
40
  accept: application/yaml
39
41
  content-type: application/yaml
@@ -50,6 +52,7 @@ Feature: Roles management
50
52
  # user now have the role
51
53
  """
52
54
  GET / HTTP/1.1
55
+ host: nex.toa.io
53
56
  authorization: Basic dXNlcjpwYXNz
54
57
  """
55
58
  Then the following reply is sent:
@@ -61,9 +64,9 @@ Feature: Roles management
61
64
  # moderator:secret
62
65
  # assistant:pass
63
66
  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
+ | _id | authority | username | password |
68
+ | 72cf9b0ab0ac4ab2b8036e4e940ddcae | nex | moderator | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
69
+ | 4344518184ad44228baffce7a44fd0b1 | nex | assistant | $2b$10$JoiAQUS7tzobDAFIDBWhWeEIJv933dQetyjRzSmfQGaJE5ZlJbmYy |
67
70
  And the `identity.roles` database contains:
68
71
  | _id | identity | role |
69
72
  | 9c4702490ff84f2a9e1b1da2ab64bdd4 | 72cf9b0ab0ac4ab2b8036e4e940ddcae | system:identity:roles:delegation |
@@ -81,6 +84,7 @@ Feature: Roles management
81
84
  # assistant doesn't have the required role
82
85
  """
83
86
  GET / HTTP/1.1
87
+ host: nex.toa.io
84
88
  authorization: Basic YXNzaXN0YW50OnBhc3M=
85
89
  """
86
90
  Then the following reply is sent:
@@ -91,6 +95,7 @@ Feature: Roles management
91
95
  # moderator delegates a role to an assistant
92
96
  """
93
97
  POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
98
+ host: nex.toa.io
94
99
  authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
95
100
  content-type: application/yaml
96
101
 
@@ -104,6 +109,7 @@ Feature: Roles management
104
109
  # assistant has access
105
110
  """
106
111
  GET / HTTP/1.1
112
+ host: nex.toa.io
107
113
  authorization: Basic YXNzaXN0YW50OnBhc3M=
108
114
  """
109
115
  Then the following reply is sent:
@@ -117,9 +123,9 @@ Feature: Roles management
117
123
 
118
124
  Scenario: Delegating role out of own scope
119
125
  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 |
126
+ | _id | authority | username | password |
127
+ | 72cf9b0ab0ac4ab2b8036e4e940ddcae | nex | moderator | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
128
+ | 4344518184ad44228baffce7a44fd0b1 | nex | assistant | $2b$10$JoiAQUS7tzobDAFIDBWhWeEIJv933dQetyjRzSmfQGaJE5ZlJbmYy |
123
129
  And the `identity.roles` database contains:
124
130
  | _id | identity | role |
125
131
  | 9c4702490ff84f2a9e1b1da2ab64bdd4 | 72cf9b0ab0ac4ab2b8036e4e940ddcae | system:identity:roles:delegation |
@@ -136,6 +142,7 @@ Feature: Roles management
136
142
  When the following request is received:
137
143
  """
138
144
  POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
145
+ host: nex.toa.io
139
146
  accept: application/yaml
140
147
  content-type: application/yaml
141
148
  authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
@@ -144,16 +151,16 @@ Feature: Roles management
144
151
  """
145
152
  Then the following reply is sent:
146
153
  """
147
- 409 Conflict
154
+ 422 Unprocessable Entity
148
155
 
149
156
  code: OUT_OF_SCOPE
150
157
  """
151
158
 
152
159
  Scenario: Delegating role without `system:identity:roles:delegation` role
153
160
  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 |
161
+ | _id | authority | username | password |
162
+ | 72cf9b0ab0ac4ab2b8036e4e940ddcae | nex | moderator | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
163
+ | 4344518184ad44228baffce7a44fd0b1 | nex | assistant | $2b$10$JoiAQUS7tzobDAFIDBWhWeEIJv933dQetyjRzSmfQGaJE5ZlJbmYy |
157
164
  And the `identity.roles` database contains:
158
165
  | _id | identity | role |
159
166
  | 30c969e05ff6437097ed5f07fc52358e | 72cf9b0ab0ac4ab2b8036e4e940ddcae | app:moderation |
@@ -169,6 +176,7 @@ Feature: Roles management
169
176
  When the following request is received:
170
177
  """
171
178
  POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
179
+ host: nex.toa.io
172
180
  content-type: application/yaml
173
181
  authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
174
182
 
@@ -181,8 +189,8 @@ Feature: Roles management
181
189
 
182
190
  Scenario Outline: Invalid role name
183
191
  Given the `identity.basic` database contains:
184
- | _id | username | password |
185
- | 72cf9b0ab0ac4ab2b8036e4e940ddcae | root | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
192
+ | _id | authority | username | password |
193
+ | 72cf9b0ab0ac4ab2b8036e4e940ddcae | nex | root | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
186
194
  And the `identity.roles` database contains:
187
195
  | _id | identity | role |
188
196
  | 9c4702490ff84f2a9e1b1da2ab64bdd4 | 72cf9b0ab0ac4ab2b8036e4e940ddcae | system:identity:roles |
@@ -190,6 +198,7 @@ Feature: Roles management
190
198
  # root adds a role to a user
191
199
  """
192
200
  POST /identity/roles/4344518184ad44228baffce7a44fd0b1/ HTTP/1.1
201
+ host: nex.toa.io
193
202
  authorization: Basic cm9vdDpzZWNyZXQ=
194
203
  content-type: application/yaml
195
204
 
@@ -207,8 +216,8 @@ Feature: Roles management
207
216
 
208
217
  Scenario: Dynamic roles
209
218
  Given the `identity.basic` database contains:
210
- | _id | username | password |
211
- | 72cf9b0ab0ac4ab2b8036e4e940ddcae | moderator | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
219
+ | _id | authority | username | password |
220
+ | 72cf9b0ab0ac4ab2b8036e4e940ddcae | nex | moderator | $2b$10$Qq/qnyyU5wjrbDXyWok14OnqAZv/z.pLhz.UddatjI6eHU/rFof4i |
212
221
  And the `identity.roles` database contains:
213
222
  | _id | identity | role |
214
223
  | 30c969e05ff6437097ed5f07fc52358e | 72cf9b0ab0ac4ab2b8036e4e940ddcae | app:29e54ae1:moderation |
@@ -229,6 +238,7 @@ Feature: Roles management
229
238
  When the following request is received:
230
239
  """
231
240
  GET /29e54ae1/ HTTP/1.1
241
+ host: nex.toa.io
232
242
  authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
233
243
  """
234
244
  Then the following reply is sent:
@@ -238,6 +248,7 @@ Feature: Roles management
238
248
  When the following request is received:
239
249
  """
240
250
  GET /88584c9b/ HTTP/1.1
251
+ host: nex.toa.io
241
252
  authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
242
253
  """
243
254
  Then the following reply is sent:
@@ -247,6 +258,7 @@ Feature: Roles management
247
258
  When the following request is received:
248
259
  """
249
260
  GET /broken/ HTTP/1.1
261
+ host: nex.toa.io
250
262
  authorization: Basic bW9kZXJhdG9yOnNlY3JldA==
251
263
  """
252
264
  Then the following reply is sent:
@@ -3,8 +3,8 @@ Feature: Tokens lifecycle
3
3
 
4
4
  Scenario: Switching to Token authentication scheme
5
5
  Given the `identity.basic` database contains:
6
- | _id | username | password |
7
- | efe3a65ebbee47ed95a73edd911ea328 | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
6
+ | _id | authority | username | password |
7
+ | efe3a65ebbee47ed95a73edd911ea328 | nex | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
8
8
  Given the annotation:
9
9
  """yaml
10
10
  /:
@@ -17,6 +17,7 @@ Feature: Tokens lifecycle
17
17
  When the following request is received:
18
18
  """
19
19
  GET /hello/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
20
+ host: nex.toa.io
20
21
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
21
22
  accept: text/plain
22
23
  """
@@ -46,6 +47,7 @@ Feature: Tokens lifecycle
46
47
  When the following request is received:
47
48
  """
48
49
  GET /hello/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
50
+ host: nex.toa.io
49
51
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
50
52
  accept: text/plain
51
53
  """
@@ -60,6 +62,7 @@ Feature: Tokens lifecycle
60
62
  When the following request is received:
61
63
  """
62
64
  GET /hello/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
65
+ host: nex.toa.io
63
66
  authorization: Token ${{ token }}
64
67
  accept: text/plain
65
68
  """
@@ -88,11 +91,12 @@ Feature: Tokens lifecycle
88
91
  refresh: 0.1
89
92
  """
90
93
  And the `identity.basic` database contains:
91
- | _id | _version | username | password |
92
- | efe3a65ebbee47ed95a73edd911ea328 | 1 | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
94
+ | _id | _version | authority | username | password |
95
+ | efe3a65ebbee47ed95a73edd911ea328 | 1 | nex | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
93
96
  When the following request is received:
94
97
  """
95
98
  GET /efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
99
+ host: nex.toa.io
96
100
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
97
101
  """
98
102
  Then the following reply is sent:
@@ -103,6 +107,7 @@ Feature: Tokens lifecycle
103
107
  When the following request is received:
104
108
  """
105
109
  PATCH /identity/basic/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
110
+ host: nex.toa.io
106
111
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
107
112
  content-type: application/yaml
108
113
 
@@ -116,6 +121,7 @@ Feature: Tokens lifecycle
116
121
  When the following request is received:
117
122
  """
118
123
  GET /efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
124
+ host: nex.toa.io
119
125
  authorization: Token ${{ token }}
120
126
  """
121
127
  Then the following reply is sent:
@@ -125,11 +131,12 @@ Feature: Tokens lifecycle
125
131
 
126
132
  Scenario: Issuing own token
127
133
  Given the `identity.basic` database contains:
128
- | _id | username | password |
129
- | efe3a65ebbee47ed95a73edd911ea328 | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
134
+ | _id | authority | username | password |
135
+ | efe3a65ebbee47ed95a73edd911ea328 | nex | developer | $2b$10$ZRSKkgZoGnrcTNA5w5eCcu3pxDzdTduhteVYXcp56AaNcilNkwJ.O |
130
136
  When the following request is received:
131
137
  """
132
138
  GET /identity/ HTTP/1.1
139
+ host: nex.toa.io
133
140
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
134
141
  """
135
142
  Then the following reply is sent:
@@ -140,6 +147,7 @@ Feature: Tokens lifecycle
140
147
  When the following request is received:
141
148
  """
142
149
  POST /identity/tokens/ HTTP/1.1
150
+ host: nex.toa.io
143
151
  authorization: Token ${{ token }}
144
152
  content-type: application/yaml
145
153
 
@@ -153,6 +161,7 @@ Feature: Tokens lifecycle
153
161
  When the following request is received:
154
162
  """
155
163
  POST /identity/tokens/ HTTP/1.1
164
+ host: nex.toa.io
156
165
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
157
166
  content-type: application/yaml
158
167
 
@@ -185,6 +194,7 @@ Feature: Tokens lifecycle
185
194
  When the following request is received:
186
195
  """
187
196
  GET /hello/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
197
+ host: nex.toa.io
188
198
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
189
199
  """
190
200
  Then the following reply is sent:
@@ -197,6 +207,7 @@ Feature: Tokens lifecycle
197
207
  When the following request is received:
198
208
  """
199
209
  GET /cacheable/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
210
+ host: nex.toa.io
200
211
  authorization: Token ${{ token }}
201
212
  """
202
213
  Then the following reply is sent:
@@ -208,6 +219,7 @@ Feature: Tokens lifecycle
208
219
  When the following request is received:
209
220
  """
210
221
  GET /cacheable/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
222
+ host: nex.toa.io
211
223
  authorization: Token ${{ fresh_token }}
212
224
  """
213
225
  Then the following reply is sent:
@@ -19,6 +19,7 @@ Feature: IO restrictions
19
19
  When the following request is received:
20
20
  """
21
21
  GET /pots/4c4759e6f9c74da989d64511df42d6f4/ HTTP/1.1
22
+ host: nex.toa.io
22
23
  """
23
24
  Then the following reply is sent:
24
25
  """
@@ -28,6 +29,7 @@ Feature: IO restrictions
28
29
  When the following request is received:
29
30
  """
30
31
  GET /pots/ HTTP/1.1
32
+ host: nex.toa.io
31
33
  accept: application/yaml
32
34
  """
33
35
  Then the following reply is sent:
@@ -47,6 +49,7 @@ Feature: IO restrictions
47
49
  When the following request is received:
48
50
  """
49
51
  GET /pots/4c4759e6f9c74da989d64511df42d6f4/ HTTP/1.1
52
+ host: nex.toa.io
50
53
  accept: application/yaml
51
54
  """
52
55
  Then the following reply is sent:
@@ -68,6 +71,7 @@ Feature: IO restrictions
68
71
  When the following request is received:
69
72
  """
70
73
  GET /pots/4c4759e6f9c74da989d64511df42d6f4/ HTTP/1.1
74
+ host: nex.toa.io
71
75
  accept: application/yaml
72
76
  """
73
77
  Then the following reply is sent:
@@ -85,6 +89,7 @@ Feature: IO restrictions
85
89
  When the following request is received:
86
90
  """
87
91
  GET /pots/ HTTP/1.1
92
+ host: nex.toa.io
88
93
  accept: application/yaml
89
94
  """
90
95
  Then the following reply is sent:
@@ -114,6 +119,7 @@ Feature: IO restrictions
114
119
  When the following request is received:
115
120
  """
116
121
  POST /pots/ HTTP/1.1
122
+ host: nex.toa.io
117
123
  accept: application/yaml
118
124
  content-type: application/yaml
119
125
 
@@ -142,6 +148,7 @@ Feature: IO restrictions
142
148
  When the following request is received:
143
149
  """
144
150
  POST /pots/ HTTP/1.1
151
+ host: nex.toa.io
145
152
  accept: text/plain
146
153
  content-type: application/yaml
147
154
 
@@ -158,6 +165,7 @@ Feature: IO restrictions
158
165
  When the following request is received:
159
166
  """
160
167
  POST /pots/ HTTP/1.1
168
+ host: nex.toa.io
161
169
  content-type: application/yaml
162
170
 
163
171
  title: Hello
@@ -180,6 +188,7 @@ Feature: IO restrictions
180
188
  When the following request is received:
181
189
  """
182
190
  POST /pots/ HTTP/1.1
191
+ host: nex.toa.io
183
192
  accept: application/yaml
184
193
  content-type: application/yaml
185
194
 
@@ -18,6 +18,7 @@ Feature: Accessing entries
18
18
  When the stream of `lenna.ascii` is received with the following headers:
19
19
  """
20
20
  POST / HTTP/1.1
21
+ host: nex.toa.io
21
22
  content-type: application/octet-stream
22
23
  """
23
24
  Then the following reply is sent:
@@ -27,6 +28,7 @@ Feature: Accessing entries
27
28
  When the following request is received:
28
29
  """
29
30
  GET / HTTP/1.1
31
+ host: nex.toa.io
30
32
  accept: application/vnd.toa.octets.entries+yaml
31
33
  """
32
34
  Then the following reply is sent:
@@ -38,6 +40,7 @@ Feature: Accessing entries
38
40
  When the following request is received:
39
41
  """
40
42
  GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
43
+ host: nex.toa.io
41
44
  accept: text/vnd.toa.octets.entry+plain
42
45
  """
43
46
  Then the following reply is sent:
@@ -67,18 +70,21 @@ Feature: Accessing entries
67
70
  When the stream of `lenna.ascii` is received with the following headers:
68
71
  """
69
72
  POST / HTTP/1.1
73
+ host: nex.toa.io
70
74
  accept: application/yaml
71
75
  content-type: application/octet-stream
72
76
  """
73
77
  And the stream of `lenna.png` is received with the following headers:
74
78
  """
75
79
  POST / HTTP/1.1
80
+ host: nex.toa.io
76
81
  accept: application/yaml
77
82
  content-type: application/octet-stream
78
83
  """
79
84
  When the following request is received:
80
85
  """
81
86
  GET / HTTP/1.1
87
+ host: nex.toa.io
82
88
  accept: application/yaml
83
89
  """
84
90
  Then the following reply is sent:
@@ -92,6 +98,7 @@ Feature: Accessing entries
92
98
  When the following request is received:
93
99
  """
94
100
  GET / HTTP/1.1
101
+ host: nex.toa.io
95
102
  accept: application/vnd.toa.octets.entries+yaml
96
103
  """
97
104
  Then the following reply is sent:
@@ -109,6 +116,7 @@ Feature: Accessing entries
109
116
  When the following request is received:
110
117
  """
111
118
  GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
119
+ host: nex.toa.io
112
120
  accept: application/vnd.toa.octets.entry+yaml
113
121
  """
114
122
  Then the following reply is sent:
@@ -42,6 +42,7 @@ Feature: Octets directive family
42
42
  When the stream of `lenna.ascii` is received with the following headers:
43
43
  """
44
44
  POST / HTTP/1.1
45
+ host: nex.toa.io
45
46
  accept: application/yaml
46
47
  content-type: application/octet-stream
47
48
  """
@@ -57,6 +58,7 @@ Feature: Octets directive family
57
58
  When the following request is received:
58
59
  """
59
60
  GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
61
+ host: nex.toa.io
60
62
  """
61
63
  Then the stream equals to `lenna.ascii` is sent with the following headers:
62
64
  """
@@ -68,6 +70,7 @@ Feature: Octets directive family
68
70
  When the following request is received:
69
71
  """
70
72
  GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
73
+ host: nex.toa.io
71
74
  if-none-match: ${{ ETAG }}
72
75
  """
73
76
  Then the following reply is sent:
@@ -77,6 +80,7 @@ Feature: Octets directive family
77
80
  When the following request is received:
78
81
  """
79
82
  GET / HTTP/1.1
83
+ host: nex.toa.io
80
84
  accept: application/yaml
81
85
  """
82
86
  Then the following reply is sent:
@@ -89,6 +93,7 @@ Feature: Octets directive family
89
93
  When the following request is received:
90
94
  """
91
95
  GET /10cf16b458f759e0d617f2f3d83599ff?foo=bar HTTP/1.1
96
+ host: nex.toa.io
92
97
  """
93
98
  Then the following reply is sent:
94
99
  """
@@ -97,6 +102,7 @@ Feature: Octets directive family
97
102
  When the following request is received:
98
103
  """
99
104
  DELETE /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
105
+ host: nex.toa.io
100
106
  """
101
107
  Then the following reply is sent:
102
108
  """
@@ -105,6 +111,7 @@ Feature: Octets directive family
105
111
  When the following request is received:
106
112
  """
107
113
  GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
114
+ host: nex.toa.io
108
115
  """
109
116
  Then the following reply is sent:
110
117
  """
@@ -115,18 +122,21 @@ Feature: Octets directive family
115
122
  When the stream of `lenna.ascii` is received with the following headers:
116
123
  """
117
124
  POST / HTTP/1.1
125
+ host: nex.toa.io
118
126
  accept: application/yaml
119
127
  content-type: application/octet-stream
120
128
  """
121
129
  And the stream of `lenna.png` is received with the following headers:
122
130
  """
123
131
  POST / HTTP/1.1
132
+ host: nex.toa.io
124
133
  accept: application/yaml
125
134
  content-type: application/octet-stream
126
135
  """
127
136
  When the following request is received:
128
137
  """
129
138
  GET / HTTP/1.1
139
+ host: nex.toa.io
130
140
  accept: application/yaml
131
141
  """
132
142
  Then the following reply is sent:
@@ -140,6 +150,7 @@ Feature: Octets directive family
140
150
  When the following request is received:
141
151
  """
142
152
  PUT / HTTP/1.1
153
+ host: nex.toa.io
143
154
  content-type: application/yaml
144
155
 
145
156
  - 814a0034f5549e957ee61360d87457e5
@@ -152,6 +163,7 @@ Feature: Octets directive family
152
163
  When the following request is received:
153
164
  """
154
165
  GET / HTTP/1.1
166
+ host: nex.toa.io
155
167
  accept: application/yaml
156
168
  """
157
169
  Then the following reply is sent:
@@ -167,6 +179,7 @@ Feature: Octets directive family
167
179
  When the stream of `lenna.png` is received with the following headers:
168
180
  """
169
181
  POST /media/jpeg-or-png/ HTTP/1.1
182
+ host: nex.toa.io
170
183
  content-type: image/jpeg
171
184
  """
172
185
  Then the following reply is sent:
@@ -176,6 +189,7 @@ Feature: Octets directive family
176
189
  When the stream of `lenna.png` is received with the following headers:
177
190
  """
178
191
  POST /media/jpeg/ HTTP/1.1
192
+ host: nex.toa.io
179
193
  """
180
194
  Then the following reply is sent:
181
195
  """
@@ -184,6 +198,7 @@ Feature: Octets directive family
184
198
  When the stream of `lenna.png` is received with the following headers:
185
199
  """
186
200
  POST /media/jpeg-or-png/ HTTP/1.1
201
+ host: nex.toa.io
187
202
  """
188
203
  Then the following reply is sent:
189
204
  """
@@ -194,6 +209,7 @@ Feature: Octets directive family
194
209
  When the stream of `sample.<ext>` is received with the following headers:
195
210
  """
196
211
  POST /media/images/ HTTP/1.1
212
+ host: nex.toa.io
197
213
  accept: application/yaml
198
214
  """
199
215
  Then the following reply is sent:
@@ -215,6 +231,7 @@ Feature: Octets directive family
215
231
  When the stream of `sample.svg` is received with the following headers:
216
232
  """
217
233
  POST /media/images/ HTTP/1.1
234
+ host: nex.toa.io
218
235
  content-type: image/svg+xml
219
236
  accept: application/yaml
220
237
  """
@@ -229,6 +246,7 @@ Feature: Octets directive family
229
246
  When the following request is received:
230
247
  """
231
248
  GET /whatever HTTP/1.1
249
+ host: nex.toa.io
232
250
  """
233
251
  Then the following reply is sent:
234
252
  """
@@ -239,12 +257,14 @@ Feature: Octets directive family
239
257
  When the stream of `lenna.ascii` is received with the following headers:
240
258
  """
241
259
  POST / HTTP/1.1
260
+ host: nex.toa.io
242
261
  accept: application/yaml
243
262
  content-type: application/octet-stream
244
263
  """
245
264
  And the following request is received:
246
265
  """
247
266
  GET /10cf16b458f759e0d617f2f3d83599ff/ HTTP/1.1
267
+ host: nex.toa.io
248
268
  accept: text/plain
249
269
  """
250
270
  Then the following reply is sent:
@@ -273,6 +293,7 @@ Feature: Octets directive family
273
293
  When the stream of `lenna.ascii` is received with the following headers:
274
294
  """
275
295
  POST / HTTP/1.1
296
+ host: nex.toa.io
276
297
  """
277
298
  Then the following reply is sent:
278
299
  """
@@ -281,6 +302,7 @@ Feature: Octets directive family
281
302
  When the following request is received:
282
303
  """
283
304
  GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
305
+ host: nex.toa.io
284
306
  accept: text/plain
285
307
  """
286
308
  Then the following reply is sent:
@@ -19,6 +19,7 @@ Feature: Octets `content-meta` header
19
19
  When the stream of `lenna.ascii` is received with the following headers:
20
20
  """
21
21
  POST /meta-header/ HTTP/1.1
22
+ host: nex.toa.io
22
23
  content-type: application/octet-stream
23
24
  content-meta: foo, bar=baz=1
24
25
  content-meta: baz=1
@@ -30,6 +31,7 @@ Feature: Octets `content-meta` header
30
31
  When the following request is received:
31
32
  """
32
33
  GET /meta-header/10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
34
+ host: nex.toa.io
33
35
  accept: application/vnd.toa.octets.entry+yaml
34
36
  """
35
37
  Then the following reply is sent:
@@ -56,6 +58,7 @@ Feature: Octets `content-meta` header
56
58
  When the following request is received:
57
59
  """
58
60
  OPTIONS / HTTP/1.1
61
+ host: nex.toa.io
59
62
  origin: https://example.com
60
63
  """
61
64
  Then the following reply is sent: