@toa.io/extensions.exposition 1.0.0-alpha.102 → 1.0.0-alpha.103

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 (25) hide show
  1. package/components/identity.keys/manifest.toa.yaml +19 -6
  2. package/components/identity.keys/operations/create.d.ts +5 -2
  3. package/components/identity.keys/operations/create.js +4 -2
  4. package/components/identity.keys/operations/create.js.map +1 -1
  5. package/components/identity.keys/operations/tsconfig.tsbuildinfo +1 -1
  6. package/components/identity.keys/source/create.ts +10 -4
  7. package/components/identity.tokens/manifest.toa.yaml +65 -17
  8. package/components/identity.tokens/operations/decrypt.js +1 -1
  9. package/components/identity.tokens/operations/decrypt.js.map +1 -1
  10. package/components/identity.tokens/operations/encrypt.js +1 -1
  11. package/components/identity.tokens/operations/encrypt.js.map +1 -1
  12. package/components/identity.tokens/operations/issue.d.ts +9 -3
  13. package/components/identity.tokens/operations/issue.js +16 -2
  14. package/components/identity.tokens/operations/issue.js.map +1 -1
  15. package/components/identity.tokens/operations/lib/types.d.ts +5 -1
  16. package/components/identity.tokens/operations/tsconfig.tsbuildinfo +1 -1
  17. package/components/identity.tokens/source/authenticate.test.ts +4 -1
  18. package/components/identity.tokens/source/decrypt.test.ts +4 -1
  19. package/components/identity.tokens/source/decrypt.ts +1 -1
  20. package/components/identity.tokens/source/encrypt.test.ts +4 -1
  21. package/components/identity.tokens/source/encrypt.ts +2 -2
  22. package/components/identity.tokens/source/issue.ts +28 -5
  23. package/components/identity.tokens/source/lib/types.ts +5 -1
  24. package/features/identtiy.tokens.custom.feature +30 -19
  25. package/package.json +2 -2
@@ -30,23 +30,25 @@ Feature: Custom tokens
30
30
  access: granted!
31
31
  """
32
32
 
33
- Scenario: Issuing token
33
+ Scenario: Issuing a token
34
34
  When the following request is received:
35
35
  """
36
36
  POST /identity/tokens/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
37
37
  host: nex.toa.io
38
38
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
39
39
  content-type: application/yaml
40
- accept: application/json
40
+ accept: application/yaml
41
41
 
42
- lifetime: 0
43
- name: Dev token
42
+ label: Dev token
43
+ lifetime: 600
44
44
  """
45
45
  Then the following reply is sent:
46
46
  """
47
47
  201 Created
48
48
 
49
- "${{ token }}"
49
+ kid: ${{ kid }}
50
+ exp: ${{ exp }}
51
+ token: ${{ token }}
50
52
  """
51
53
  When the following request is received:
52
54
  """
@@ -80,17 +82,18 @@ Feature: Custom tokens
80
82
  POST /identity/tokens/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
81
83
  host: nex.toa.io
82
84
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
83
- accept: application/json
85
+ accept: application/yaml
84
86
  content-type: application/yaml
85
87
 
86
- lifetime: 10
88
+ label: Production token
89
+ lifetime: 0
87
90
  scopes: [app:notes:public]
88
91
  """
89
92
  Then the following reply is sent:
90
93
  """
91
94
  201 Created
92
95
 
93
- "${{ token }}"
96
+ token: ${{ token }}
94
97
  """
95
98
  When the following request is received:
96
99
  """
@@ -119,10 +122,11 @@ Feature: Custom tokens
119
122
  POST /identity/tokens/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
120
123
  host: nex.toa.io
121
124
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
122
- accept: application/json
125
+ accept: application/yaml
123
126
  content-type: application/yaml
124
127
 
125
- lifetime: 10
128
+ label: Restricted token
129
+ lifetime: 0
126
130
  permissions: {
127
131
  /notes/: [GET]
128
132
  }
@@ -131,7 +135,7 @@ Feature: Custom tokens
131
135
  """
132
136
  201 Created
133
137
 
134
- "${{ token }}"
138
+ token: ${{ token }}
135
139
  """
136
140
  When the following request is received:
137
141
  """
@@ -171,24 +175,25 @@ Feature: Custom tokens
171
175
  Scenario: Token revocation
172
176
  Given the `identity.tokens` configuration:
173
177
  """yaml
174
- cache: 1
178
+ cache:
179
+ ttl: 1
175
180
  """
176
181
  When the following request is received:
177
182
  """
178
183
  POST /identity/tokens/efe3a65ebbee47ed95a73edd911ea328/ HTTP/1.1
179
184
  host: nex.toa.io
180
185
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
186
+ accept: application/yaml
181
187
  content-type: application/yaml
182
- accept: application/json
183
188
 
184
- lifetime: 0
185
- name: One-time token
189
+ label: One-time token
190
+ lifetime: 60
186
191
  """
187
192
  Then the following reply is sent:
188
193
  """
189
194
  201 Created
190
195
 
191
- "${{ token }}"
196
+ token: ${{ token }}
192
197
  """
193
198
  When the following request is received:
194
199
  """
@@ -214,15 +219,21 @@ Feature: Custom tokens
214
219
  """
215
220
  200 OK
216
221
 
217
- - id: ${{ token.kid }}
218
- name: One-time token
222
+ - id: ${{ kid }}
223
+ label: One-time token
224
+ expires: ${{ expires }}
225
+ _created: ${{ created }}
219
226
  """
220
227
  When the following request is received:
221
228
  """
222
- DELETE /identity/keys/efe3a65ebbee47ed95a73edd911ea328/${{ token.kid }}/ HTTP/1.1
229
+ DELETE /identity/keys/efe3a65ebbee47ed95a73edd911ea328/${{ kid }}/ HTTP/1.1
223
230
  host: nex.toa.io
224
231
  authorization: Basic ZGV2ZWxvcGVyOnNlY3JldA==
225
232
  """
233
+ Then the following reply is sent:
234
+ """
235
+ 200 OK
236
+ """
226
237
  And after 1 second
227
238
  When the following request is received:
228
239
  """
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/extensions.exposition",
3
- "version": "1.0.0-alpha.102",
3
+ "version": "1.0.0-alpha.103",
4
4
  "description": "Toa Exposition",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -61,5 +61,5 @@
61
61
  "@types/negotiator": "0.6.1",
62
62
  "jest-esbuild": "0.3.0"
63
63
  },
64
- "gitHead": "ce5b6e22c1adbec4cc5d4dc5dd8f6bafc41d93d0"
64
+ "gitHead": "a52ca7d2b22f5855e2f539f5fb3425854ba476c7"
65
65
  }