@toa.io/extensions.exposition 1.0.0-alpha.10 → 1.0.0-alpha.12

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.
@@ -4,10 +4,10 @@ name: roles
4
4
  entity:
5
5
  schema:
6
6
  identity*: string
7
- role*: /^[a-zA-Z0-9]{1,16}(:[a-zA-Z0-9]{1,16}){0,8}$/
7
+ role*: /^[a-zA-Z0-9]{1,32}(:[a-zA-Z0-9]{1,32}){0,8}$/
8
8
  delegator: string
9
9
  unique:
10
- unique: [identity, role]
10
+ role: [identity, role]
11
11
 
12
12
  operations:
13
13
  grant:
@@ -26,16 +26,17 @@ operations:
26
26
 
27
27
  receivers:
28
28
  identity.basic.principal: principal
29
+ identity.federation.principal: principal
29
30
 
30
31
  exposition:
31
32
  isolated: true
32
33
  /:identity:
33
34
  auth:role: system:identity:roles
34
- auth:rule:
35
- delegate: delegator
36
- role: system:identity:roles:delegation
37
35
  POST:
38
36
  io:output: [id]
37
+ auth:rule:
38
+ delegate: delegator
39
+ role: system:identity:roles:delegation
39
40
  endpoint: grant
40
41
  GET:
41
42
  io:output: true # array of strings
@@ -72,6 +72,9 @@ The following request headers are allowed:
72
72
  - `accept`
73
73
  - `authorization`
74
74
  - `content-type`
75
+ - `etag`
76
+ - `if-match`
77
+ - `if-none-match`
75
78
  - headers used by the [`vary:embed` directive](vary.md#embeddings)
76
79
 
77
80
  The following response headers are exposed:
@@ -37,6 +37,7 @@ Feature: Identity Federation
37
37
  Then the following reply is sent:
38
38
  """
39
39
  200 OK
40
+
40
41
  id: ${{ User.id }}
41
42
  """
42
43
  # ensuring identity idempotency
@@ -49,6 +50,7 @@ Feature: Identity Federation
49
50
  Then the following reply is sent:
50
51
  """
51
52
  200 OK
53
+
52
54
  id: ${{ User.id }}
53
55
  """
54
56
 
@@ -151,3 +153,45 @@ Feature: Identity Federation
151
153
  """
152
154
  403 Forbidden
153
155
  """
156
+
157
+ Scenario: Granting a `system` role to a Principal
158
+ Given the `identity.federation` configuration:
159
+ """yaml
160
+ explicit_identity_creation: false
161
+ trust:
162
+ - issuer: http://localhost:44444
163
+ principal:
164
+ iss: http://localhost:44444
165
+ sub: root-mock-id
166
+ """
167
+ And the IDP token for root is issued
168
+ When the following request is received:
169
+ """
170
+ GET /identity/ HTTP/1.1
171
+ authorization: Bearer ${{ root.id_token }}
172
+ accept: application/yaml
173
+ content-type: application/yaml
174
+ """
175
+ # create an identity
176
+ Then the following reply is sent:
177
+ """
178
+ 200 OK
179
+ authorization: Token ${{ root.token }}
180
+
181
+ id: ${{ root.id }}
182
+ """
183
+ # check the role
184
+ When the following request is received:
185
+ """
186
+ GET /identity/ HTTP/1.1
187
+ accept: application/yaml
188
+ authorization: Token ${{ root.token }}
189
+ """
190
+ Then the following reply is sent:
191
+ """
192
+ 200 OK
193
+
194
+ id: ${{ root.id }}
195
+ roles:
196
+ - system
197
+ """
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/extensions.exposition",
3
- "version": "1.0.0-alpha.10",
3
+ "version": "1.0.0-alpha.12",
4
4
  "description": "Toa Exposition",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -17,9 +17,9 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@toa.io/core": "1.0.0-alpha.10",
21
- "@toa.io/generic": "1.0.0-alpha.10",
22
- "@toa.io/schemas": "1.0.0-alpha.10",
20
+ "@toa.io/core": "1.0.0-alpha.12",
21
+ "@toa.io/generic": "1.0.0-alpha.12",
22
+ "@toa.io/schemas": "1.0.0-alpha.12",
23
23
  "bcryptjs": "2.4.3",
24
24
  "error-value": "0.3.0",
25
25
  "js-yaml": "4.1.0",
@@ -43,11 +43,11 @@
43
43
  "features": "cucumber-js"
44
44
  },
45
45
  "devDependencies": {
46
- "@toa.io/agent": "1.0.0-alpha.10",
47
- "@toa.io/extensions.storages": "1.0.0-alpha.10",
46
+ "@toa.io/agent": "1.0.0-alpha.12",
47
+ "@toa.io/extensions.storages": "1.0.0-alpha.12",
48
48
  "@types/bcryptjs": "2.4.3",
49
49
  "@types/cors": "2.8.13",
50
50
  "@types/negotiator": "0.6.1"
51
51
  },
52
- "gitHead": "472d582389fbfbfe6804cf01683276ce2cc45bf2"
52
+ "gitHead": "897206fbcf724fa88f427b6aee35bff571b2a3a1"
53
53
  }