@toa.io/extensions.exposition 1.0.0-alpha.86 → 1.0.0-alpha.88
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.basic/operations/transit.js +3 -3
- package/components/identity.basic/operations/transit.js.map +1 -1
- package/components/identity.basic/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/source/transit.ts +3 -3
- package/components/octets.storage/manifest.toa.yaml +3 -5
- package/components/octets.storage/operations/get.js +1 -1
- package/components/octets.storage/operations/head.js +7 -0
- package/components/octets.storage/operations/{store.js → put.js} +9 -9
- package/documentation/octets.md +17 -47
- package/features/{octets.meta.feature → octets.attributes.feature} +13 -12
- package/features/octets.cloudinary.feature +68 -0
- package/features/octets.download.feature +6 -6
- package/features/octets.entries.feature +8 -57
- package/features/octets.feature +8 -60
- package/features/octets.workflows.feature +0 -36
- package/features/steps/.env.example +3 -0
- package/features/steps/Parameters.ts +10 -0
- package/features/steps/components/octets.tester/manifest.toa.yaml +0 -1
- package/features/steps/components/octets.tester/operations/bar.js +0 -1
- package/features/steps/components/octets.tester/operations/baz.js +0 -1
- package/features/steps/components/octets.tester/operations/foo.js +0 -1
- package/package.json +3 -3
- package/source/Endpoint.ts +3 -3
- package/source/HTTP/Server.ts +4 -0
- package/source/RTD/syntax/parse.test.ts +1 -1
- package/source/directives/auth/Scheme.ts +1 -1
- package/source/directives/io/Output.ts +1 -1
- package/source/directives/octets/Delete.ts +11 -11
- package/source/directives/octets/{Fetch.ts → Get.ts} +17 -34
- package/source/directives/octets/Octets.ts +6 -8
- package/source/directives/octets/{Store.ts → Put.ts} +9 -14
- package/source/directives/octets/Workflow.ts +1 -1
- package/source/directives/octets/schemas.ts +4 -6
- package/source/directives/octets/workflows/Workflow.ts +2 -3
- package/source/directives/vary/embeddings/Language.ts +2 -2
- package/transpiled/Endpoint.js +3 -3
- package/transpiled/Endpoint.js.map +1 -1
- package/transpiled/HTTP/Server.js +2 -0
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/directives/auth/Scheme.js +1 -1
- package/transpiled/directives/auth/Scheme.js.map +1 -1
- package/transpiled/directives/io/Output.js +1 -1
- package/transpiled/directives/io/Output.js.map +1 -1
- package/transpiled/directives/octets/Delete.js +8 -8
- package/transpiled/directives/octets/Delete.js.map +1 -1
- package/transpiled/directives/octets/{Fetch.d.ts → Get.d.ts} +2 -3
- package/transpiled/directives/octets/{Fetch.js → Get.js} +19 -24
- package/transpiled/directives/octets/Get.js.map +1 -0
- package/transpiled/directives/octets/Octets.js +6 -8
- package/transpiled/directives/octets/Octets.js.map +1 -1
- package/transpiled/directives/octets/{Store.d.ts → Put.d.ts} +2 -2
- package/transpiled/directives/octets/{Store.js → Put.js} +11 -14
- package/transpiled/directives/octets/Put.js.map +1 -0
- package/transpiled/directives/octets/Workflow.js +1 -1
- package/transpiled/directives/octets/Workflow.js.map +1 -1
- package/transpiled/directives/octets/schemas.d.ts +4 -6
- package/transpiled/directives/octets/schemas.js +3 -4
- package/transpiled/directives/octets/schemas.js.map +1 -1
- package/transpiled/directives/octets/workflows/Workflow.d.ts +1 -1
- package/transpiled/directives/octets/workflows/Workflow.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/tsconfig.tsbuildinfo +1 -1
- package/components/octets.storage/operations/fetch.js +0 -46
- package/components/octets.storage/operations/list.js +0 -7
- package/features/steps/components/octets.tester/operations/diversify.js +0 -16
- package/schemas/octets/fetch.cos.yaml +0 -3
- package/schemas/octets/permute.cos.yaml +0 -1
- package/source/directives/octets/List.ts +0 -72
- package/transpiled/directives/octets/Fetch.js.map +0 -1
- package/transpiled/directives/octets/List.d.ts +0 -16
- package/transpiled/directives/octets/List.js +0 -74
- package/transpiled/directives/octets/List.js.map +0 -1
- package/transpiled/directives/octets/Store.js.map +0 -1
- /package/schemas/octets/{list.cos.yaml → get.cos.yaml} +0 -0
- /package/schemas/octets/{store.cos.yaml → put.cos.yaml} +0 -0
package/documentation/octets.md
CHANGED
|
@@ -14,7 +14,7 @@ directives under the current RTD Node.
|
|
|
14
14
|
octets:context: images
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
## `octets:
|
|
17
|
+
## `octets:put`
|
|
18
18
|
|
|
19
19
|
Stores the content of the request body into a storage, under the request path with
|
|
20
20
|
specified `content-type`.
|
|
@@ -35,7 +35,7 @@ The value of the directive is `null` or an object with the following properties:
|
|
|
35
35
|
/images:
|
|
36
36
|
octets:context: images
|
|
37
37
|
POST:
|
|
38
|
-
octets:
|
|
38
|
+
octets:put:
|
|
39
39
|
accept:
|
|
40
40
|
- image/jpeg
|
|
41
41
|
- image/png
|
|
@@ -45,7 +45,7 @@ The value of the directive is `null` or an object with the following properties:
|
|
|
45
45
|
analyze: images.analyze
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
Non-standard `content-
|
|
48
|
+
Non-standard `content-attributes` header can be used
|
|
49
49
|
to set initial [metadata](/extensions/storages/readme.md#entry) value for the Entry.
|
|
50
50
|
|
|
51
51
|
The value of the `content-meta` header is a comma-separated list of key-value string pairs.
|
|
@@ -54,18 +54,18 @@ If no value is provided for a key, the string `true` is used.
|
|
|
54
54
|
```http
|
|
55
55
|
POST /images/ HTTP/1.1
|
|
56
56
|
content-type: image/jpeg
|
|
57
|
-
content-
|
|
58
|
-
content-
|
|
57
|
+
content-attributes: foo, bar=baz
|
|
58
|
+
content-attributes: baz=1
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
```yaml
|
|
62
|
-
|
|
62
|
+
attributes:
|
|
63
63
|
foo: 'true'
|
|
64
64
|
bar: 'baz'
|
|
65
65
|
baz: '1'
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
If the Entry already exists, the `content-
|
|
68
|
+
If the Entry already exists, the `content-attributes` header is ignored.
|
|
69
69
|
|
|
70
70
|
### Stream size limit
|
|
71
71
|
|
|
@@ -86,7 +86,7 @@ The default value is `64MiB`.
|
|
|
86
86
|
|
|
87
87
|
### Downloading external content
|
|
88
88
|
|
|
89
|
-
The `octets:
|
|
89
|
+
The `octets:put` directive can be used to download external content:
|
|
90
90
|
|
|
91
91
|
```http
|
|
92
92
|
POST /images/ HTTP/1.1
|
|
@@ -106,7 +106,7 @@ the [Entry](/extensions/storages/readme.md#entry).
|
|
|
106
106
|
/images:
|
|
107
107
|
octets:context: images
|
|
108
108
|
POST:
|
|
109
|
-
octets:
|
|
109
|
+
octets:put:
|
|
110
110
|
trust:
|
|
111
111
|
- https://example.com
|
|
112
112
|
- ^https://example\.com/[a-z]+\.jpe?g$
|
|
@@ -114,7 +114,7 @@ the [Entry](/extensions/storages/readme.md#entry).
|
|
|
114
114
|
|
|
115
115
|
### Response
|
|
116
116
|
|
|
117
|
-
The response of the `octets:
|
|
117
|
+
The response of the `octets:put` directive is the created Entry.
|
|
118
118
|
|
|
119
119
|
```
|
|
120
120
|
201 Created
|
|
@@ -125,7 +125,7 @@ type: image/jpeg
|
|
|
125
125
|
created: 1698004822358
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
If the `octets:
|
|
128
|
+
If the `octets:put` directive contains a `workflow`, the response
|
|
129
129
|
is [multipart](protocol.md#multipart-types).
|
|
130
130
|
The first part represents the created Entry, which is sent immediately after the BLOB is stored,
|
|
131
131
|
while subsequent parts are results from the workflow endpoints, sent as soon as they are available.
|
|
@@ -165,7 +165,7 @@ status: exception
|
|
|
165
165
|
--cut--
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
## `octets:
|
|
168
|
+
## `octets:get`
|
|
169
169
|
|
|
170
170
|
Fetches the content of a stored BLOB corresponding to the request path, and returns it as the
|
|
171
171
|
response body with the corresponding `content-type`, `content-length`
|
|
@@ -177,22 +177,18 @@ The value of the directive is an object with the following properties:
|
|
|
177
177
|
|
|
178
178
|
- `meta`: `boolean` indicating whether an Entry is accessible.
|
|
179
179
|
Defaults to `false`.
|
|
180
|
-
- `blob`: `boolean` indicating whether the original BLOB is accessible,
|
|
181
|
-
[BLOB variant](/extensions/storages/readme.md#async-fetchpath-string-maybereadable) must be
|
|
182
|
-
specified in the path otherwise.
|
|
183
|
-
Defaults to `true`.
|
|
184
180
|
|
|
185
181
|
```yaml
|
|
186
182
|
/images:
|
|
187
183
|
octets:context: images
|
|
188
184
|
/*:
|
|
189
185
|
GET:
|
|
190
|
-
octets:
|
|
186
|
+
octets:get:
|
|
191
187
|
blob: false # prevent access to the original BLOB
|
|
192
188
|
meta: true # allow access to an Entry
|
|
193
189
|
```
|
|
194
190
|
|
|
195
|
-
The `octets:
|
|
191
|
+
The `octets:get: ~` declaration is equivalent to defaults.
|
|
196
192
|
|
|
197
193
|
To access an Entry, the `accept` request header must contain the `octets.entry` subtype
|
|
198
194
|
in
|
|
@@ -203,32 +199,6 @@ GET /images/eecd837c HTTP/1.1
|
|
|
203
199
|
accept: application/vnd.toa.octets.entry+yaml
|
|
204
200
|
```
|
|
205
201
|
|
|
206
|
-
## `octets:list`
|
|
207
|
-
|
|
208
|
-
Lists the entries stored under the request path.
|
|
209
|
-
|
|
210
|
-
The value of the directive is an object with the following properties:
|
|
211
|
-
|
|
212
|
-
- `meta`: `boolean` indicating whether the list of Entries is accessible.
|
|
213
|
-
Defaults to `false`, which means that only entry identifiers are returned.
|
|
214
|
-
|
|
215
|
-
```yaml
|
|
216
|
-
/images:
|
|
217
|
-
octets:context: images
|
|
218
|
-
GET:
|
|
219
|
-
octets:list:
|
|
220
|
-
meta: true
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
The `octets:list: ~` declaration is equivalent to defaults.
|
|
224
|
-
|
|
225
|
-
To access a list of Entries, the `accept` request header must contain the `octets.entries` subtype:
|
|
226
|
-
|
|
227
|
-
```http
|
|
228
|
-
GET /images/ HTTP/1.1
|
|
229
|
-
accept: application/vnd.toa.octets.entries+yaml
|
|
230
|
-
```
|
|
231
|
-
|
|
232
202
|
## `octets:delete`
|
|
233
203
|
|
|
234
204
|
Delete the entry corresponding to the request path.
|
|
@@ -288,7 +258,7 @@ as value.
|
|
|
288
258
|
Steps within a workflow unit are executed in parallel.
|
|
289
259
|
|
|
290
260
|
```yaml
|
|
291
|
-
octets:
|
|
261
|
+
octets:put:
|
|
292
262
|
workflow:
|
|
293
263
|
resize: images.resize
|
|
294
264
|
analyze: images.analyze
|
|
@@ -298,7 +268,7 @@ A workflow can be a single unit, or an array of units.
|
|
|
298
268
|
If it's an array, the workflow units are executed in sequence.
|
|
299
269
|
|
|
300
270
|
```yaml
|
|
301
|
-
octets:
|
|
271
|
+
octets:put:
|
|
302
272
|
workflow:
|
|
303
273
|
- optimize: images.optimize # executed first
|
|
304
274
|
- resize: images.resize # executed second
|
|
@@ -313,7 +283,7 @@ the execution of the workflow is interrupted.
|
|
|
313
283
|
A workflow unit which value starts with `task:` prefix will be executed as a Task.
|
|
314
284
|
|
|
315
285
|
```yaml
|
|
316
|
-
octets:
|
|
286
|
+
octets:put:
|
|
317
287
|
workflow:
|
|
318
288
|
optimize: task:images.optimize
|
|
319
289
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Feature: Octets `content-
|
|
1
|
+
Feature: Octets `content-attributes` header
|
|
2
2
|
|
|
3
|
-
Scenario: Sending `content-
|
|
3
|
+
Scenario: Sending `content-attributes` header
|
|
4
4
|
Given the `octets.tester` is running
|
|
5
5
|
And the annotation:
|
|
6
6
|
"""yaml
|
|
@@ -10,19 +10,19 @@ Feature: Octets `content-meta` header
|
|
|
10
10
|
octets:context: octets
|
|
11
11
|
/*:
|
|
12
12
|
POST:
|
|
13
|
-
octets:
|
|
13
|
+
octets:put: ~
|
|
14
14
|
/*:
|
|
15
15
|
GET:
|
|
16
|
-
octets:
|
|
16
|
+
octets:get:
|
|
17
17
|
meta: true
|
|
18
18
|
"""
|
|
19
19
|
When the stream of `lenna.ascii` is received with the following headers:
|
|
20
20
|
"""
|
|
21
|
-
POST /
|
|
21
|
+
POST /attributes-header/ HTTP/1.1
|
|
22
22
|
host: nex.toa.io
|
|
23
23
|
content-type: application/octet-stream
|
|
24
|
-
content-
|
|
25
|
-
content-
|
|
24
|
+
content-attributes: foo, bar=baz=1
|
|
25
|
+
content-attributes: baz=1
|
|
26
26
|
"""
|
|
27
27
|
Then the following reply is sent:
|
|
28
28
|
"""
|
|
@@ -30,7 +30,7 @@ Feature: Octets `content-meta` header
|
|
|
30
30
|
"""
|
|
31
31
|
When the following request is received:
|
|
32
32
|
"""
|
|
33
|
-
GET /
|
|
33
|
+
GET /attributes-header/10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
|
|
34
34
|
host: nex.toa.io
|
|
35
35
|
accept: application/vnd.toa.octets.entry+yaml
|
|
36
36
|
"""
|
|
@@ -41,19 +41,20 @@ Feature: Octets `content-meta` header
|
|
|
41
41
|
id: 10cf16b458f759e0d617f2f3d83599ff
|
|
42
42
|
type: application/octet-stream
|
|
43
43
|
size: 8169
|
|
44
|
-
|
|
44
|
+
checksum: 10cf16b458f759e0d617f2f3d83599ff
|
|
45
|
+
attributes:
|
|
45
46
|
foo: 'true'
|
|
46
47
|
bar: baz=1
|
|
47
48
|
baz: '1'
|
|
48
49
|
"""
|
|
49
50
|
|
|
50
|
-
Scenario: CORS allows `content-
|
|
51
|
+
Scenario: CORS allows `content-attributes` header
|
|
51
52
|
Given the annotation:
|
|
52
53
|
"""yaml
|
|
53
54
|
/:
|
|
54
55
|
octets:context: octets
|
|
55
56
|
POST:
|
|
56
|
-
octets:
|
|
57
|
+
octets:put: ~
|
|
57
58
|
"""
|
|
58
59
|
When the following request is received:
|
|
59
60
|
"""
|
|
@@ -65,5 +66,5 @@ Feature: Octets `content-meta` header
|
|
|
65
66
|
"""
|
|
66
67
|
204 No Content
|
|
67
68
|
access-control-allow-origin: https://example.com
|
|
68
|
-
access-control-allow-headers: accept, authorization, content-type, etag, if-match, if-none-match, content-
|
|
69
|
+
access-control-allow-headers: accept, authorization, content-type, etag, if-match, if-none-match, content-attributes
|
|
69
70
|
"""
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Feature: Octets with Cloudinary storage
|
|
2
|
+
|
|
3
|
+
Background:
|
|
4
|
+
Given the annotation:
|
|
5
|
+
"""yaml
|
|
6
|
+
/:
|
|
7
|
+
io:output: true
|
|
8
|
+
auth:anonymous: true
|
|
9
|
+
octets:context: cloudinary
|
|
10
|
+
POST:
|
|
11
|
+
octets:put: ~
|
|
12
|
+
/*:
|
|
13
|
+
GET:
|
|
14
|
+
octets:get: ~
|
|
15
|
+
DELETE:
|
|
16
|
+
octets:delete: ~
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
Scenario: Upload an image
|
|
20
|
+
When the stream of `lenna.png` is received with the following headers:
|
|
21
|
+
"""
|
|
22
|
+
POST / HTTP/1.1
|
|
23
|
+
host: nex.toa.io
|
|
24
|
+
accept: application/yaml
|
|
25
|
+
content-type: application/octet-stream
|
|
26
|
+
"""
|
|
27
|
+
Then the following reply is sent:
|
|
28
|
+
"""
|
|
29
|
+
201 Created
|
|
30
|
+
content-type: application/yaml
|
|
31
|
+
|
|
32
|
+
id: 814a0034f5549e957ee61360d87457e5
|
|
33
|
+
type: image/png
|
|
34
|
+
size: 473831
|
|
35
|
+
"""
|
|
36
|
+
When the following request is received:
|
|
37
|
+
"""
|
|
38
|
+
GET /814a0034f5549e957ee61360d87457e5 HTTP/1.1
|
|
39
|
+
host: nex.toa.io
|
|
40
|
+
"""
|
|
41
|
+
Then the stream equals to `lenna.png` is sent with the following headers:
|
|
42
|
+
"""
|
|
43
|
+
200 OK
|
|
44
|
+
content-type: image/png
|
|
45
|
+
content-length: 473831
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
Scenario: Image transformations
|
|
49
|
+
When the stream of `lenna.png` is received with the following headers:
|
|
50
|
+
"""
|
|
51
|
+
POST / HTTP/1.1
|
|
52
|
+
host: nex.toa.io
|
|
53
|
+
content-type: image/png
|
|
54
|
+
"""
|
|
55
|
+
Then the following reply is sent:
|
|
56
|
+
"""
|
|
57
|
+
201 Created
|
|
58
|
+
"""
|
|
59
|
+
When the following request is received:
|
|
60
|
+
"""
|
|
61
|
+
GET /814a0034f5549e957ee61360d87457e5.48x48.jpeg HTTP/1.1
|
|
62
|
+
host: nex.toa.io
|
|
63
|
+
"""
|
|
64
|
+
Then the stream equals to `lenna.48x48.jpeg` is sent with the following headers:
|
|
65
|
+
"""
|
|
66
|
+
200 OK
|
|
67
|
+
content-type: image/jpeg
|
|
68
|
+
"""
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Feature: Download
|
|
1
|
+
Feature: Download external resources
|
|
2
2
|
|
|
3
3
|
Scenario Outline: Download from trusted location defined as <type>
|
|
4
4
|
Given the annotation:
|
|
@@ -8,13 +8,13 @@ Feature: Download and store
|
|
|
8
8
|
auth:anonymous: true
|
|
9
9
|
octets:context: octets
|
|
10
10
|
POST:
|
|
11
|
-
octets:
|
|
11
|
+
octets:put:
|
|
12
12
|
trust:
|
|
13
13
|
- <location> # <type>
|
|
14
14
|
- https://github.com
|
|
15
15
|
/*:
|
|
16
16
|
GET:
|
|
17
|
-
octets:
|
|
17
|
+
octets:get:
|
|
18
18
|
meta: true
|
|
19
19
|
"""
|
|
20
20
|
|
|
@@ -143,7 +143,7 @@ Feature: Download and store
|
|
|
143
143
|
auth:anonymous: true
|
|
144
144
|
octets:context: octets
|
|
145
145
|
POST:
|
|
146
|
-
octets:
|
|
146
|
+
octets:put:
|
|
147
147
|
limit: 1kb
|
|
148
148
|
trust:
|
|
149
149
|
- https://avatars.githubusercontent.com
|
|
@@ -171,7 +171,7 @@ Feature: Download and store
|
|
|
171
171
|
auth:anonymous: true
|
|
172
172
|
octets:context: octets
|
|
173
173
|
POST:
|
|
174
|
-
octets:
|
|
174
|
+
octets:put:
|
|
175
175
|
limit: 1kb
|
|
176
176
|
trust:
|
|
177
177
|
- https://avatars.githubusercontent.com
|
|
@@ -185,5 +185,5 @@ Feature: Download and store
|
|
|
185
185
|
Then the following reply is sent:
|
|
186
186
|
"""
|
|
187
187
|
204 No Content
|
|
188
|
-
access-control-allow-headers: accept, authorization, content-type, etag, if-match, if-none-match, content-
|
|
188
|
+
access-control-allow-headers: accept, authorization, content-type, etag, if-match, if-none-match, content-attributes, content-location
|
|
189
189
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Feature: Accessing
|
|
1
|
+
Feature: Accessing metadata
|
|
2
2
|
|
|
3
|
-
Scenario:
|
|
3
|
+
Scenario: Metadata is not accessible by default
|
|
4
4
|
Given the annotation:
|
|
5
5
|
"""yaml
|
|
6
6
|
/:
|
|
@@ -8,12 +8,10 @@ Feature: Accessing entries
|
|
|
8
8
|
auth:anonymous: true
|
|
9
9
|
octets:context: octets
|
|
10
10
|
POST:
|
|
11
|
-
octets:
|
|
12
|
-
GET:
|
|
13
|
-
octets:list: ~
|
|
11
|
+
octets:put: ~
|
|
14
12
|
/*:
|
|
15
13
|
GET:
|
|
16
|
-
octets:
|
|
14
|
+
octets:get: ~
|
|
17
15
|
"""
|
|
18
16
|
When the stream of `lenna.ascii` is received with the following headers:
|
|
19
17
|
"""
|
|
@@ -25,18 +23,6 @@ Feature: Accessing entries
|
|
|
25
23
|
"""
|
|
26
24
|
201 Created
|
|
27
25
|
"""
|
|
28
|
-
When the following request is received:
|
|
29
|
-
"""
|
|
30
|
-
GET / HTTP/1.1
|
|
31
|
-
host: nex.toa.io
|
|
32
|
-
accept: application/vnd.toa.octets.entries+yaml
|
|
33
|
-
"""
|
|
34
|
-
Then the following reply is sent:
|
|
35
|
-
"""
|
|
36
|
-
403 Forbidden
|
|
37
|
-
|
|
38
|
-
Metadata is not accessible.
|
|
39
|
-
"""
|
|
40
26
|
When the following request is received:
|
|
41
27
|
"""
|
|
42
28
|
GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
|
|
@@ -47,10 +33,10 @@ Feature: Accessing entries
|
|
|
47
33
|
"""
|
|
48
34
|
403 Forbidden
|
|
49
35
|
|
|
50
|
-
Metadata is not accessible
|
|
36
|
+
Metadata is not accessible
|
|
51
37
|
"""
|
|
52
38
|
|
|
53
|
-
Scenario: Accessing
|
|
39
|
+
Scenario: Accessing metadata
|
|
54
40
|
Given the annotation:
|
|
55
41
|
"""yaml
|
|
56
42
|
/:
|
|
@@ -58,13 +44,10 @@ Feature: Accessing entries
|
|
|
58
44
|
auth:anonymous: true
|
|
59
45
|
octets:context: octets
|
|
60
46
|
POST:
|
|
61
|
-
octets:
|
|
62
|
-
GET:
|
|
63
|
-
octets:list:
|
|
64
|
-
meta: true
|
|
47
|
+
octets:put: ~
|
|
65
48
|
/*:
|
|
66
49
|
GET:
|
|
67
|
-
octets:
|
|
50
|
+
octets:get:
|
|
68
51
|
meta: true
|
|
69
52
|
"""
|
|
70
53
|
When the stream of `lenna.ascii` is received with the following headers:
|
|
@@ -81,38 +64,6 @@ Feature: Accessing entries
|
|
|
81
64
|
accept: application/yaml
|
|
82
65
|
content-type: application/octet-stream
|
|
83
66
|
"""
|
|
84
|
-
When the following request is received:
|
|
85
|
-
"""
|
|
86
|
-
GET / HTTP/1.1
|
|
87
|
-
host: nex.toa.io
|
|
88
|
-
accept: application/yaml
|
|
89
|
-
"""
|
|
90
|
-
Then the following reply is sent:
|
|
91
|
-
"""
|
|
92
|
-
200 OK
|
|
93
|
-
content-type: application/yaml
|
|
94
|
-
|
|
95
|
-
- 10cf16b458f759e0d617f2f3d83599ff
|
|
96
|
-
- 814a0034f5549e957ee61360d87457e5
|
|
97
|
-
"""
|
|
98
|
-
When the following request is received:
|
|
99
|
-
"""
|
|
100
|
-
GET / HTTP/1.1
|
|
101
|
-
host: nex.toa.io
|
|
102
|
-
accept: application/vnd.toa.octets.entries+yaml
|
|
103
|
-
"""
|
|
104
|
-
Then the following reply is sent:
|
|
105
|
-
"""
|
|
106
|
-
200 OK
|
|
107
|
-
content-type: application/yaml
|
|
108
|
-
|
|
109
|
-
- id: 10cf16b458f759e0d617f2f3d83599ff
|
|
110
|
-
size: 8169
|
|
111
|
-
type: application/octet-stream
|
|
112
|
-
- id: 814a0034f5549e957ee61360d87457e5
|
|
113
|
-
size: 473831
|
|
114
|
-
type: image/png
|
|
115
|
-
"""
|
|
116
67
|
When the following request is received:
|
|
117
68
|
"""
|
|
118
69
|
GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
|
package/features/octets.feature
CHANGED
|
@@ -8,39 +8,37 @@ Feature: Octets directive family
|
|
|
8
8
|
auth:anonymous: true
|
|
9
9
|
octets:context: octets
|
|
10
10
|
POST:
|
|
11
|
-
octets:
|
|
12
|
-
GET:
|
|
13
|
-
octets:list: ~
|
|
11
|
+
octets:put: ~
|
|
14
12
|
/*:
|
|
15
13
|
GET:
|
|
16
|
-
octets:
|
|
14
|
+
octets:get: ~
|
|
17
15
|
DELETE:
|
|
18
16
|
octets:delete: ~
|
|
19
17
|
/media:
|
|
20
18
|
/jpeg:
|
|
21
19
|
POST:
|
|
22
|
-
octets:
|
|
20
|
+
octets:put:
|
|
23
21
|
accept: image/jpeg
|
|
24
22
|
/jpeg-or-png:
|
|
25
23
|
POST:
|
|
26
|
-
octets:
|
|
24
|
+
octets:put:
|
|
27
25
|
accept:
|
|
28
26
|
- image/jpeg
|
|
29
27
|
- image/png
|
|
30
28
|
/images:
|
|
31
29
|
POST:
|
|
32
|
-
octets:
|
|
30
|
+
octets:put:
|
|
33
31
|
accept: image/*
|
|
34
32
|
/*:
|
|
35
33
|
GET:
|
|
36
|
-
octets:
|
|
34
|
+
octets:get: ~
|
|
37
35
|
/limit-1kb:
|
|
38
36
|
POST:
|
|
39
|
-
octets:
|
|
37
|
+
octets:put:
|
|
40
38
|
limit: 1kb
|
|
41
39
|
/limit-100kb:
|
|
42
40
|
POST:
|
|
43
|
-
octets:
|
|
41
|
+
octets:put:
|
|
44
42
|
limit: 100kb
|
|
45
43
|
"""
|
|
46
44
|
|
|
@@ -83,19 +81,6 @@ Feature: Octets directive family
|
|
|
83
81
|
"""
|
|
84
82
|
304 Not Modified
|
|
85
83
|
"""
|
|
86
|
-
When the following request is received:
|
|
87
|
-
"""
|
|
88
|
-
GET / HTTP/1.1
|
|
89
|
-
host: nex.toa.io
|
|
90
|
-
accept: application/yaml
|
|
91
|
-
"""
|
|
92
|
-
Then the following reply is sent:
|
|
93
|
-
"""
|
|
94
|
-
200 OK
|
|
95
|
-
content-type: application/yaml
|
|
96
|
-
|
|
97
|
-
- 10cf16b458f759e0d617f2f3d83599ff
|
|
98
|
-
"""
|
|
99
84
|
When the following request is received:
|
|
100
85
|
"""
|
|
101
86
|
GET /10cf16b458f759e0d617f2f3d83599ff?foo=bar HTTP/1.1
|
|
@@ -260,40 +245,3 @@ Feature: Octets directive family
|
|
|
260
245
|
|
|
261
246
|
Trailing slash is redundant.
|
|
262
247
|
"""
|
|
263
|
-
|
|
264
|
-
Scenario: Original BLOB is not accessible
|
|
265
|
-
Given the annotation:
|
|
266
|
-
"""yaml
|
|
267
|
-
/:
|
|
268
|
-
io:output: true
|
|
269
|
-
auth:anonymous: true
|
|
270
|
-
octets:context: octets
|
|
271
|
-
POST:
|
|
272
|
-
octets:store: ~
|
|
273
|
-
/*:
|
|
274
|
-
GET:
|
|
275
|
-
octets:fetch:
|
|
276
|
-
meta: true
|
|
277
|
-
blob: false
|
|
278
|
-
"""
|
|
279
|
-
When the stream of `lenna.ascii` is received with the following headers:
|
|
280
|
-
"""
|
|
281
|
-
POST / HTTP/1.1
|
|
282
|
-
host: nex.toa.io
|
|
283
|
-
"""
|
|
284
|
-
Then the following reply is sent:
|
|
285
|
-
"""
|
|
286
|
-
201 Created
|
|
287
|
-
"""
|
|
288
|
-
When the following request is received:
|
|
289
|
-
"""
|
|
290
|
-
GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
|
|
291
|
-
host: nex.toa.io
|
|
292
|
-
accept: text/plain
|
|
293
|
-
"""
|
|
294
|
-
Then the following reply is sent:
|
|
295
|
-
"""
|
|
296
|
-
403 Forbidden
|
|
297
|
-
|
|
298
|
-
BLOB variant must be specified.
|
|
299
|
-
"""
|
|
@@ -13,7 +13,6 @@ Feature: Octets storage workflows
|
|
|
13
13
|
- add-foo: octets.tester.foo
|
|
14
14
|
add-bar: octets.tester.bar
|
|
15
15
|
- add-baz: octets.tester.baz
|
|
16
|
-
- diversify: octets.tester.diversify
|
|
17
16
|
/*:
|
|
18
17
|
io:output: true
|
|
19
18
|
GET:
|
|
@@ -51,43 +50,8 @@ Feature: Octets storage workflows
|
|
|
51
50
|
|
|
52
51
|
step: add-baz
|
|
53
52
|
status: completed
|
|
54
|
-
--cut
|
|
55
|
-
|
|
56
|
-
step: diversify
|
|
57
|
-
output: hello
|
|
58
|
-
status: completed
|
|
59
53
|
--cut--
|
|
60
54
|
"""
|
|
61
|
-
When the following request is received:
|
|
62
|
-
"""
|
|
63
|
-
GET /10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
|
|
64
|
-
host: nex.toa.io
|
|
65
|
-
accept: application/vnd.toa.octets.entry+yaml
|
|
66
|
-
"""
|
|
67
|
-
Then the following reply is sent:
|
|
68
|
-
"""
|
|
69
|
-
200 OK
|
|
70
|
-
content-type: application/yaml
|
|
71
|
-
|
|
72
|
-
id: 10cf16b458f759e0d617f2f3d83599ff
|
|
73
|
-
type: application/octet-stream
|
|
74
|
-
size: 8169
|
|
75
|
-
meta:
|
|
76
|
-
foo: bar
|
|
77
|
-
bar: baz
|
|
78
|
-
baz: qux
|
|
79
|
-
"""
|
|
80
|
-
When the following request is received:
|
|
81
|
-
"""
|
|
82
|
-
GET /10cf16b458f759e0d617f2f3d83599ff.hello.png HTTP/1.1
|
|
83
|
-
host: nex.toa.io
|
|
84
|
-
"""
|
|
85
|
-
Then the stream equals to `lenna.png` is sent with the following headers:
|
|
86
|
-
"""
|
|
87
|
-
200 OK
|
|
88
|
-
content-type: image/png
|
|
89
|
-
content-length: 473831
|
|
90
|
-
"""
|
|
91
55
|
|
|
92
56
|
Scenario: Getting error when running workflow on `store`
|
|
93
57
|
Given the `octets.tester` is running
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { join } from 'node:path'
|
|
2
|
+
import * as dotenv from 'dotenv'
|
|
1
3
|
import { setDefaultTimeout } from '@cucumber/cucumber'
|
|
2
4
|
import { encode } from '@toa.io/generic'
|
|
3
5
|
import { console } from 'openspan'
|
|
4
6
|
|
|
7
|
+
dotenv.config({ path: join(__dirname, '.env') })
|
|
8
|
+
|
|
5
9
|
export class Parameters {
|
|
6
10
|
public readonly origin: string
|
|
7
11
|
|
|
@@ -20,5 +24,11 @@ process.env.TOA_STORAGES = encode({
|
|
|
20
24
|
octets: {
|
|
21
25
|
provider: 'tmp',
|
|
22
26
|
directory: Math.random().toString(36).substring(2)
|
|
27
|
+
},
|
|
28
|
+
cloudinary: {
|
|
29
|
+
provider: 'cloudinary',
|
|
30
|
+
environment: process.env.CLOUDINARY_ENVIRONMENT ?? 'nope',
|
|
31
|
+
type: 'image',
|
|
32
|
+
prefix: 'toa-dev'
|
|
23
33
|
}
|
|
24
34
|
})
|