@toa.io/extensions.exposition 1.0.0-alpha.254 → 1.0.0-alpha.257
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/CHANGELOG.md +34 -0
- package/components/identity.basic/manifest.toa.yaml +7 -1
- package/components/identity.basic/operations/add.js +2 -1
- package/components/identity.basic/operations/add.js.map +1 -1
- package/components/identity.basic/operations/transit.js +2 -1
- 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/add.ts +2 -1
- package/components/identity.basic/source/transit.ts +2 -1
- package/components/identity.basic/source/types.ts +3 -0
- package/components/identity.federation/events/principal.js +2 -2
- package/components/identity.federation/manifest.toa.yaml +15 -6
- package/components/identity.federation/operations/authenticate.js +13 -15
- package/components/identity.federation/operations/authenticate.js.map +1 -1
- package/components/identity.federation/operations/create.d.ts +8 -0
- package/components/identity.federation/operations/create.js +27 -0
- package/components/identity.federation/operations/create.js.map +1 -0
- package/components/identity.federation/operations/delete.js +1 -1
- package/components/identity.federation/operations/delete.js.map +1 -1
- package/components/identity.federation/operations/incept.d.ts +1 -1
- package/components/identity.federation/operations/incept.js +3 -26
- package/components/identity.federation/operations/incept.js.map +1 -1
- package/components/identity.federation/operations/lib/index.d.ts +1 -0
- package/components/identity.federation/operations/lib/index.js +3 -1
- package/components/identity.federation/operations/lib/index.js.map +1 -1
- package/components/identity.federation/operations/lib/resolve.d.ts +3 -0
- package/components/identity.federation/operations/lib/resolve.js +17 -0
- package/components/identity.federation/operations/lib/resolve.js.map +1 -0
- package/components/identity.federation/operations/list.js +1 -5
- package/components/identity.federation/operations/list.js.map +1 -1
- package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/types/context.d.ts +2 -5
- package/components/identity.federation/operations/types/entity.d.ts +2 -1
- package/components/identity.federation/source/authenticate.ts +15 -18
- package/components/identity.federation/source/create.ts +39 -0
- package/components/identity.federation/source/delete.ts +1 -1
- package/components/identity.federation/source/incept.ts +5 -37
- package/components/identity.federation/source/lib/index.ts +1 -0
- package/components/identity.federation/source/lib/resolve.ts +17 -0
- package/components/identity.federation/source/list.test.ts +3 -5
- package/components/identity.federation/source/list.ts +1 -8
- package/components/identity.federation/source/types/context.ts +2 -6
- package/components/identity.federation/source/types/entity.ts +2 -1
- package/components/identity.passkeys/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.roles/receivers/identity.federation.principal.js +6 -0
- package/{components/context.toa.yaml → context.toa.yaml} +0 -1
- package/documentation/credentials.md +5 -2
- package/features/identity.basic.feature +54 -0
- package/features/identity.federation.feature +94 -1
- package/features/map.feature +2 -1
- package/package.json +3 -3
- package/transpiled/tsconfig.tsbuildinfo +1 -1
|
@@ -57,12 +57,15 @@ constraints, and principal configuration.
|
|
|
57
57
|
|
|
58
58
|
## Federated credentials
|
|
59
59
|
|
|
60
|
-
- `POST /identity/federation/:identity/` associates credentials from a trusted issuer
|
|
60
|
+
- `POST /identity/federation/:identity/` associates credentials from a trusted issuer and returns
|
|
61
|
+
the associated credential as it is listed.
|
|
61
62
|
- `GET /identity/federation/:identity/` lists federated credentials.
|
|
62
63
|
- `DELETE /identity/federation/:identity/:credential/` removes one federated credential.
|
|
63
64
|
|
|
65
|
+
If the credentials are already associated with the Identity, the existing credential is returned.
|
|
66
|
+
|
|
64
67
|
An Identity can have credentials from multiple issuers and can have multiple subjects from the
|
|
65
|
-
same issuer. The `:credential` segment is the `id` returned by
|
|
68
|
+
same issuer. The `:credential` segment is the `id` returned by any of these resources. Federation
|
|
66
69
|
resources are provider-independent; issuer-specific authorization flows remain the responsibility
|
|
67
70
|
of the application.
|
|
68
71
|
|
|
@@ -474,3 +474,57 @@ Feature: Basic authentication
|
|
|
474
474
|
|
|
475
475
|
code: EXISTS
|
|
476
476
|
"""
|
|
477
|
+
|
|
478
|
+
Scenario: Adding basic credentials after they have been deleted
|
|
479
|
+
Given transient identity
|
|
480
|
+
When the following request is received:
|
|
481
|
+
"""
|
|
482
|
+
POST /identity/basic/${{ identity.id }}/ HTTP/1.1
|
|
483
|
+
host: nex.toa.io
|
|
484
|
+
authorization: Token ${{ identity.token }}
|
|
485
|
+
content-type: application/yaml
|
|
486
|
+
|
|
487
|
+
username: developer
|
|
488
|
+
password: secret#1234
|
|
489
|
+
"""
|
|
490
|
+
Then the following reply is sent:
|
|
491
|
+
"""
|
|
492
|
+
201 Created
|
|
493
|
+
"""
|
|
494
|
+
When the following request is received:
|
|
495
|
+
"""
|
|
496
|
+
DELETE /identity/basic/${{ identity.id }}/ HTTP/1.1
|
|
497
|
+
host: nex.toa.io
|
|
498
|
+
authorization: Token ${{ identity.token }}
|
|
499
|
+
"""
|
|
500
|
+
Then the following reply is sent:
|
|
501
|
+
"""
|
|
502
|
+
200 OK
|
|
503
|
+
"""
|
|
504
|
+
When the following request is received:
|
|
505
|
+
"""
|
|
506
|
+
POST /identity/basic/${{ identity.id }}/ HTTP/1.1
|
|
507
|
+
host: nex.toa.io
|
|
508
|
+
authorization: Token ${{ identity.token }}
|
|
509
|
+
content-type: application/yaml
|
|
510
|
+
|
|
511
|
+
username: painter
|
|
512
|
+
password: secret#4321
|
|
513
|
+
"""
|
|
514
|
+
Then the following reply is sent:
|
|
515
|
+
"""
|
|
516
|
+
201 Created
|
|
517
|
+
"""
|
|
518
|
+
When the following request is received:
|
|
519
|
+
"""
|
|
520
|
+
GET /identity/ HTTP/1.1
|
|
521
|
+
host: nex.toa.io
|
|
522
|
+
authorization: Basic cGFpbnRlcjpzZWNyZXQjNDMyMQ==
|
|
523
|
+
accept: application/yaml
|
|
524
|
+
"""
|
|
525
|
+
Then the following reply is sent:
|
|
526
|
+
"""
|
|
527
|
+
200 OK
|
|
528
|
+
|
|
529
|
+
id: ${{ identity.id }}
|
|
530
|
+
"""
|
|
@@ -54,6 +54,21 @@ Feature: Identity Federation
|
|
|
54
54
|
|
|
55
55
|
id: ${{ User.id }}
|
|
56
56
|
"""
|
|
57
|
+
# credential id is detached from the Identity
|
|
58
|
+
When the following request is received:
|
|
59
|
+
"""
|
|
60
|
+
GET /identity/federation/${{ User.id }}/ HTTP/1.1
|
|
61
|
+
host: nex.toa.io
|
|
62
|
+
authorization: Bearer ${{ User.id_token }}
|
|
63
|
+
accept: application/yaml
|
|
64
|
+
"""
|
|
65
|
+
Then the following reply is sent:
|
|
66
|
+
"""
|
|
67
|
+
200 OK
|
|
68
|
+
|
|
69
|
+
- id: ${{ User.credential }}
|
|
70
|
+
iss: http://localhost:44444
|
|
71
|
+
"""
|
|
57
72
|
|
|
58
73
|
Scenario: Creating an Identity using inception
|
|
59
74
|
Given the `identity.federation` configuration:
|
|
@@ -88,8 +103,10 @@ Feature: Identity Federation
|
|
|
88
103
|
"""
|
|
89
104
|
201 Created
|
|
90
105
|
authorization: Token ${{ Bill.token }}
|
|
106
|
+
|
|
107
|
+
id: ${{ Bill.id }}
|
|
91
108
|
"""
|
|
92
|
-
# check that both tokens authenticate the created
|
|
109
|
+
# check that both tokens authenticate the created user's Identity
|
|
93
110
|
When the following request is received:
|
|
94
111
|
"""
|
|
95
112
|
GET /identity/ HTTP/1.1
|
|
@@ -100,6 +117,8 @@ Feature: Identity Federation
|
|
|
100
117
|
Then the following reply is sent:
|
|
101
118
|
"""
|
|
102
119
|
200 OK
|
|
120
|
+
|
|
121
|
+
id: ${{ Bill.id }}
|
|
103
122
|
roles: []
|
|
104
123
|
"""
|
|
105
124
|
When the following request is received:
|
|
@@ -113,8 +132,24 @@ Feature: Identity Federation
|
|
|
113
132
|
"""
|
|
114
133
|
200 OK
|
|
115
134
|
|
|
135
|
+
id: ${{ Bill.id }}
|
|
116
136
|
roles: []
|
|
117
137
|
"""
|
|
138
|
+
# credential id is detached from the Identity
|
|
139
|
+
When the following request is received:
|
|
140
|
+
"""
|
|
141
|
+
GET /identity/federation/${{ Bill.id }}/ HTTP/1.1
|
|
142
|
+
host: nex.toa.io
|
|
143
|
+
authorization: Bearer ${{ Bill.id_token }}
|
|
144
|
+
accept: application/yaml
|
|
145
|
+
"""
|
|
146
|
+
Then the following reply is sent:
|
|
147
|
+
"""
|
|
148
|
+
200 OK
|
|
149
|
+
|
|
150
|
+
- id: ${{ Bill.credential }}
|
|
151
|
+
iss: http://localhost:44444
|
|
152
|
+
"""
|
|
118
153
|
And the following request is received:
|
|
119
154
|
# same credentials
|
|
120
155
|
"""
|
|
@@ -214,6 +249,64 @@ Feature: Identity Federation
|
|
|
214
249
|
content-type: application/yaml
|
|
215
250
|
accept: application/yaml
|
|
216
251
|
|
|
252
|
+
scheme: bearer
|
|
253
|
+
credentials: ${{ Bob.id_token }}
|
|
254
|
+
"""
|
|
255
|
+
Then the following reply is sent:
|
|
256
|
+
"""
|
|
257
|
+
201 Created
|
|
258
|
+
|
|
259
|
+
id: ${{ Bob.credential }}
|
|
260
|
+
iss: http://localhost:44444
|
|
261
|
+
"""
|
|
262
|
+
# the created credential is listed as is
|
|
263
|
+
When the following request is received:
|
|
264
|
+
"""
|
|
265
|
+
GET /identity/federation/${{ Bob.id }}/ HTTP/1.1
|
|
266
|
+
host: nex.toa.io
|
|
267
|
+
authorization: Basic #{{ basic Bob }}
|
|
268
|
+
accept: application/yaml
|
|
269
|
+
"""
|
|
270
|
+
Then the following reply is sent:
|
|
271
|
+
"""
|
|
272
|
+
200 OK
|
|
273
|
+
|
|
274
|
+
- id: ${{ Bob.credential }}
|
|
275
|
+
iss: http://localhost:44444
|
|
276
|
+
"""
|
|
277
|
+
And the following request is received:
|
|
278
|
+
"""
|
|
279
|
+
GET /identity/ HTTP/1.1
|
|
280
|
+
host: nex.toa.io
|
|
281
|
+
authorization: Bearer ${{ Bob.id_token }}
|
|
282
|
+
accept: application/yaml
|
|
283
|
+
"""
|
|
284
|
+
Then the following reply is sent:
|
|
285
|
+
"""
|
|
286
|
+
200 OK
|
|
287
|
+
|
|
288
|
+
id: ${{ Bob.id }}
|
|
289
|
+
"""
|
|
290
|
+
# delete the federation credential
|
|
291
|
+
When the following request is received:
|
|
292
|
+
"""
|
|
293
|
+
DELETE /identity/federation/${{ Bob.id }}/${{ Bob.credential }}/ HTTP/1.1
|
|
294
|
+
host: nex.toa.io
|
|
295
|
+
authorization: Basic #{{ basic Bob }}
|
|
296
|
+
"""
|
|
297
|
+
Then the following reply is sent:
|
|
298
|
+
"""
|
|
299
|
+
200 OK
|
|
300
|
+
"""
|
|
301
|
+
# add the same federation again
|
|
302
|
+
When the following request is received:
|
|
303
|
+
"""
|
|
304
|
+
POST /identity/federation/${{ Bob.id }}/ HTTP/1.1
|
|
305
|
+
host: nex.toa.io
|
|
306
|
+
authorization: Basic #{{ basic Bob }}
|
|
307
|
+
content-type: application/yaml
|
|
308
|
+
accept: application/yaml
|
|
309
|
+
|
|
217
310
|
scheme: bearer
|
|
218
311
|
credentials: ${{ Bob.id_token }}
|
|
219
312
|
"""
|
package/features/map.feature
CHANGED
|
@@ -269,6 +269,7 @@ Feature: HTTP context mapping
|
|
|
269
269
|
"""yaml
|
|
270
270
|
trust:
|
|
271
271
|
- iss: http://localhost:44444
|
|
272
|
+
assert: false
|
|
272
273
|
"""
|
|
273
274
|
And the `pots` is running with the following manifest:
|
|
274
275
|
"""yaml
|
|
@@ -299,8 +300,8 @@ Feature: HTTP context mapping
|
|
|
299
300
|
201 Created
|
|
300
301
|
|
|
301
302
|
id: ${{ id }}
|
|
302
|
-
title: ${{ random.email }}
|
|
303
303
|
volume: 1.5
|
|
304
|
+
title: ${{ random.email }}
|
|
304
305
|
"""
|
|
305
306
|
|
|
306
307
|
Scenario: Mapping non-exposed properties
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.exposition",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.257",
|
|
4
4
|
"description": "Toa Exposition",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@simplewebauthn/server": "13.3.2",
|
|
21
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
21
|
+
"@toa.io/core": "1.0.0-alpha.257",
|
|
22
22
|
"@toa.io/generic": "1.0.0-alpha.254",
|
|
23
23
|
"@toa.io/schemas": "1.0.0-alpha.254",
|
|
24
24
|
"bcryptjs": "3.0.3",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
},
|
|
63
63
|
"testEnvironment": "node"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "2db23a4e2ff6740a5f852208a9b896812ec6f819"
|
|
66
66
|
}
|