@toa.io/extensions.exposition 1.0.0-alpha.92 → 1.0.0-alpha.94

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 (32) hide show
  1. package/components/identity.federation/manifest.toa.yaml +8 -2
  2. package/components/identity.federation/operations/authenticate.d.ts +13 -2
  3. package/components/identity.federation/operations/authenticate.js +1 -1
  4. package/components/identity.federation/operations/authenticate.js.map +1 -1
  5. package/components/identity.federation/operations/incept.js +1 -1
  6. package/components/identity.federation/operations/incept.js.map +1 -1
  7. package/components/identity.federation/operations/lib/jwt.d.ts +1 -1
  8. package/components/identity.federation/operations/lib/jwt.js +3 -3
  9. package/components/identity.federation/operations/lib/jwt.js.map +1 -1
  10. package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
  11. package/components/identity.federation/operations/types/context.d.ts +0 -10
  12. package/components/identity.federation/source/authenticate.ts +16 -5
  13. package/components/identity.federation/source/incept.ts +2 -3
  14. package/components/identity.federation/source/lib/jwt.ts +2 -2
  15. package/components/identity.federation/source/types/context.ts +0 -12
  16. package/components/octets.storage/manifest.toa.yaml +1 -0
  17. package/components/octets.storage/operations/put.js +11 -0
  18. package/documentation/octets.md +5 -1
  19. package/features/access.feature +2 -2
  20. package/features/authorities.federation.feature +12 -9
  21. package/features/etag.feature +1 -1
  22. package/features/identity.basic.feature +2 -2
  23. package/features/identity.federation.feature +57 -2
  24. package/features/octets.feature +1 -1
  25. package/features/{octets.attributes.feature → octets.meta.feature} +53 -7
  26. package/package.json +8 -8
  27. package/source/directives/flow/Compose.ts +1 -1
  28. package/source/directives/octets/Put.ts +1 -0
  29. package/transpiled/directives/flow/Compose.js.map +1 -1
  30. package/transpiled/directives/octets/Put.js +1 -1
  31. package/transpiled/directives/octets/Put.js.map +1 -1
  32. package/transpiled/tsconfig.tsbuildinfo +1 -1
@@ -53,15 +53,3 @@ export interface IdToken {
53
53
  iat: number
54
54
  nbf?: number
55
55
  }
56
-
57
- export interface AuthenticateInput {
58
- authority: string
59
- credentials: string
60
- }
61
-
62
- export interface AuthenticateOutput {
63
- identity: {
64
- id: string
65
- claim: Pick<IdToken, 'iss' | 'sub' | 'aud'>
66
- }
67
- }
@@ -16,6 +16,7 @@ operations:
16
16
  - LOCATION_UNTRUSTED
17
17
  - LOCATION_LENGTH
18
18
  - LOCATION_UNAVAILABLE
19
+ - INVALID_ID
19
20
  get: &simple
20
21
  bindings: ~
21
22
  input:
@@ -7,6 +7,7 @@ const { match } = require('matchacho')
7
7
  async function put (input, context) {
8
8
  const { storage, request, accept, limit, trust } = input
9
9
  const path = request.url
10
+ const id = request.headers['content-id']
10
11
  const claim = request.headers['content-type']
11
12
  const attributes = parseAttributes(request.headers['content-attributes'])
12
13
  const location = request.headers['content-location']
@@ -16,6 +17,13 @@ async function put (input, context) {
16
17
 
17
18
  const options = { claim, accept, attributes }
18
19
 
20
+ if (id !== undefined) {
21
+ if (!ID_RX.test(id))
22
+ return ERR_INVALID_ID
23
+
24
+ options.id = id
25
+ }
26
+
19
27
  if (location !== undefined) {
20
28
  const length = Number.parseInt(request.headers['content-length'])
21
29
 
@@ -114,6 +122,9 @@ function toURL (location) {
114
122
  const ERR_UNTRUSTED = Err('LOCATION_UNTRUSTED', 'Location is not trusted')
115
123
  const ERR_LENGTH = Err('LOCATION_LENGTH', 'Content-Length must be 0 when Content-Location is used')
116
124
  const ERR_UNAVAILABLE = Err('LOCATION_UNAVAILABLE', 'Location is not available')
125
+ const ERR_INVALID_ID = Err('INVALID_ID', 'Invalid Content-ID')
126
+
127
+ const ID_RX = /^[a-zA-Z0-9-_]{1,16}$/
117
128
 
118
129
  exports.effect = put
119
130
 
@@ -45,15 +45,19 @@ The value of the directive is `null` or an object with the following properties:
45
45
  analyze: images.analyze
46
46
  ```
47
47
 
48
+ `content-id` header can be used to set the ID of the Entry.
49
+ The value must match the following regular expression `^[a-zA-Z0-9-_]{1,16}$`.
50
+
48
51
  Non-standard `content-attributes` header can be used
49
52
  to set initial [metadata](/extensions/storages/readme.md#entry) value for the Entry.
50
53
 
51
- The value of the `content-meta` header is a comma-separated list of key-value string pairs.
54
+ The value of the `content-attributes` header is a comma-separated list of key-value string pairs.
52
55
  If no value is provided for a key, the string `true` is used.
53
56
 
54
57
  ```http
55
58
  POST /images/ HTTP/1.1
56
59
  content-type: image/jpeg
60
+ content-id: example-id
57
61
  content-attributes: foo, bar=baz
58
62
  content-attributes: baz=1
59
63
  ```
@@ -421,12 +421,12 @@ Feature: Access authorization
421
421
  """
422
422
  403 Forbidden
423
423
 
424
- Basic authentication scheme is required to access this resource.
424
+ Basic authentication scheme is required to access this resource
425
425
  """
426
426
 
427
427
  Scenario: Adding a role without required permissions
428
428
 
429
- Trunk directives should not be applied to the Identity management resources.
429
+ Trunk directives should not be applied to the Identity management resources
430
430
 
431
431
  Given the annotation:
432
432
  """yaml
@@ -1,5 +1,15 @@
1
1
  Feature: OIDC tokens with authorities
2
2
 
3
+ Background:
4
+ Given local IDP is running
5
+ And the `identity.federation` database is empty
6
+ And the `identity.federation` configuration:
7
+ """yaml
8
+ trust:
9
+ - iss: http://localhost:44444
10
+ """
11
+
12
+
3
13
  Scenario: OIDC tokens are scoped to authorities
4
14
  Given the annotation:
5
15
  """yaml
@@ -11,13 +21,6 @@ Feature: OIDC tokens with authorities
11
21
  GET:
12
22
  dev:stub: Hello
13
23
  """
14
- And local IDP is running
15
- And the `identity.federation` database is empty
16
- And the `identity.federation` configuration:
17
- """yaml
18
- trust:
19
- - iss: http://localhost:44444
20
- """
21
24
  And the IDP token for One is issued
22
25
  And the IDP token for Two is issued
23
26
 
@@ -29,7 +32,7 @@ Feature: OIDC tokens with authorities
29
32
  accept: application/yaml
30
33
  content-type: application/yaml
31
34
 
32
- credentials: ${{ One.id_token }}
35
+ token: ${{ One.id_token }}
33
36
  """
34
37
  Then the following reply is sent:
35
38
  """
@@ -44,7 +47,7 @@ Feature: OIDC tokens with authorities
44
47
  accept: application/yaml
45
48
  content-type: application/yaml
46
49
 
47
- credentials: ${{ Two.id_token }}
50
+ token: ${{ Two.id_token }}
48
51
  """
49
52
  Then the following reply is sent:
50
53
  """
@@ -176,7 +176,7 @@ Feature: Optimistic concurrency control
176
176
  """
177
177
  400 Bad Request
178
178
 
179
- Invalid ETag.
179
+ Invalid ETag
180
180
  """
181
181
 
182
182
  Scenario: Etag with non-queryable operation
@@ -207,7 +207,7 @@ Feature: Basic authentication
207
207
  422 Unprocessable Entity
208
208
 
209
209
  code: <code>
210
- message: <problem> is not meeting the requirements.
210
+ message: <problem> is not meeting the requirements
211
211
  """
212
212
  Examples:
213
213
  | username | password | problem | code |
@@ -318,7 +318,7 @@ Feature: Basic authentication
318
318
  422 Unprocessable Entity
319
319
 
320
320
  code: PRINCIPAL_LOCKED
321
- message: Principal username cannot be changed.
321
+ message: Principal username cannot be changed
322
322
  """
323
323
 
324
324
  Scenario: Creating an Identity using inception with existing credentials
@@ -18,7 +18,6 @@ Feature: Identity Federation
18
18
  host: nex.toa.io
19
19
  authorization: Bearer ${{ User.id_token }}
20
20
  accept: application/yaml
21
- content-type: application/yaml
22
21
  """
23
22
  Then the following reply is sent:
24
23
  """
@@ -76,7 +75,6 @@ Feature: Identity Federation
76
75
  host: nex.toa.io
77
76
  authorization: Bearer ${{ GoodUser.id_token }}
78
77
  accept: application/yaml
79
- content-type: application/yaml
80
78
  """
81
79
  Then the following reply is sent:
82
80
  """
@@ -206,3 +204,60 @@ Feature: Identity Federation
206
204
  roles:
207
205
  - system
208
206
  """
207
+
208
+ Scenario: Adding federation to an existing identity
209
+ Given the `identity.federation` configuration:
210
+ """yaml
211
+ trust:
212
+ - iss: http://localhost:44444
213
+ """
214
+ And the `identity.basic` database is empty
215
+
216
+ # create an identity
217
+ When the following request is received:
218
+ """
219
+ POST /identity/basic/ HTTP/1.1
220
+ host: nex.toa.io
221
+ content-type: application/yaml
222
+ accept: application/yaml
223
+
224
+ username: #{{ id | set Bob.username }}
225
+ password: #{{ password 8 | set Bob.password }}
226
+ """
227
+ Then the following reply is sent:
228
+ """
229
+ 201 Created
230
+
231
+ id: ${{ Bob.id }}
232
+ """
233
+
234
+ When the IDP token for Bob is issued
235
+
236
+ # add federation
237
+ When the following request is received:
238
+ """
239
+ POST /identity/federation/${{ Bob.id }}/ HTTP/1.1
240
+ host: nex.toa.io
241
+ authorization: Basic #{{ basic Bob }}
242
+ content-type: application/yaml
243
+ accept: application/yaml
244
+
245
+ credentials: ${{ Bob.id_token }}
246
+ """
247
+ Then the following reply is sent:
248
+ """
249
+ 201 Created
250
+ """
251
+ And the following request is received:
252
+ """
253
+ GET /identity/ HTTP/1.1
254
+ host: nex.toa.io
255
+ authorization: Bearer ${{ Bob.id_token }}
256
+ accept: application/yaml
257
+ """
258
+ Then the following reply is sent:
259
+ """
260
+ 200 OK
261
+
262
+ id: ${{ Bob.id }}
263
+ """
@@ -243,5 +243,5 @@ Feature: Octets directive family
243
243
  404 Not Found
244
244
  content-type: text/plain
245
245
 
246
- Trailing slash is redundant.
246
+ Trailing slash is redundant
247
247
  """
@@ -1,8 +1,51 @@
1
- Feature: Octets `content-attributes` header
1
+ Feature: Octets metadata
2
2
 
3
- Scenario: Sending `content-attributes` header
4
- Given the `octets.tester` is running
5
- And the annotation:
3
+ Scenario: Content-ID
4
+ Given the annotation:
5
+ """yaml
6
+ /:
7
+ io:output: true
8
+ auth:anonymous: true
9
+ octets:context: octets
10
+ /*:
11
+ POST:
12
+ octets:put: ~
13
+ /*:
14
+ GET:
15
+ octets:get:
16
+ meta: true
17
+ """
18
+ When the stream of `lenna.ascii` is received with the following headers:
19
+ """
20
+ POST /attributes/ HTTP/1.1
21
+ host: nex.toa.io
22
+ accept: application/yaml
23
+ content-type: application/octet-stream
24
+ content-id: hello
25
+ """
26
+ Then the following reply is sent:
27
+ """
28
+ 201 Created
29
+
30
+ id: hello
31
+ """
32
+ When the stream of `lenna.ascii` is received with the following headers:
33
+ """
34
+ POST /attributes/ HTTP/1.1
35
+ host: nex.toa.io
36
+ accept: text/plain
37
+ content-type: application/octet-stream
38
+ content-id: hello.txt
39
+ """
40
+ Then the following reply is sent:
41
+ """
42
+ 400 Bad Request
43
+
44
+ Invalid Content-ID
45
+ """
46
+
47
+ Scenario: Content-Attributes
48
+ Given the annotation:
6
49
  """yaml
7
50
  /:
8
51
  io:output: true
@@ -18,8 +61,9 @@ Feature: Octets `content-attributes` header
18
61
  """
19
62
  When the stream of `lenna.ascii` is received with the following headers:
20
63
  """
21
- POST /attributes-header/ HTTP/1.1
64
+ POST /attributes/ HTTP/1.1
22
65
  host: nex.toa.io
66
+ accept: application/yaml
23
67
  content-type: application/octet-stream
24
68
  content-attributes: foo, bar=baz=1
25
69
  content-attributes: baz=1
@@ -27,10 +71,12 @@ Feature: Octets `content-attributes` header
27
71
  Then the following reply is sent:
28
72
  """
29
73
  201 Created
74
+
75
+ id: ${{ id }}
30
76
  """
31
77
  When the following request is received:
32
78
  """
33
- GET /attributes-header/10cf16b458f759e0d617f2f3d83599ff HTTP/1.1
79
+ GET /attributes/${{ id }} HTTP/1.1
34
80
  host: nex.toa.io
35
81
  accept: application/vnd.toa.octets.entry+yaml
36
82
  """
@@ -38,7 +84,7 @@ Feature: Octets `content-attributes` header
38
84
  """
39
85
  200 OK
40
86
 
41
- id: 10cf16b458f759e0d617f2f3d83599ff
87
+ id: ${{ id }}
42
88
  type: application/octet-stream
43
89
  size: 8169
44
90
  checksum: 10cf16b458f759e0d617f2f3d83599ff
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/extensions.exposition",
3
- "version": "1.0.0-alpha.92",
3
+ "version": "1.0.0-alpha.94",
4
4
  "description": "Toa Exposition",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@isaacs/ttlcache": "1.4.1",
21
- "@toa.io/core": "1.0.0-alpha.92",
22
- "@toa.io/generic": "1.0.0-alpha.63",
23
- "@toa.io/schemas": "1.0.0-alpha.63",
21
+ "@toa.io/core": "1.0.0-alpha.93",
22
+ "@toa.io/generic": "1.0.0-alpha.93",
23
+ "@toa.io/schemas": "1.0.0-alpha.93",
24
24
  "bcryptjs": "2.4.3",
25
25
  "error-value": "0.3.0",
26
26
  "http-cache-semantics": "4.1.1",
@@ -28,7 +28,7 @@
28
28
  "matchacho": "0.3.5",
29
29
  "msgpackr": "1.10.1",
30
30
  "negotiator": "0.6.3",
31
- "openspan": "1.0.0-alpha.92",
31
+ "openspan": "1.0.0-alpha.93",
32
32
  "paseto": "3.1.4"
33
33
  },
34
34
  "jest": {
@@ -50,13 +50,13 @@
50
50
  "features:octets": "cucumber-js features/octets.*"
51
51
  },
52
52
  "devDependencies": {
53
- "@toa.io/agent": "1.0.0-alpha.79",
54
- "@toa.io/extensions.storages": "1.0.0-alpha.92",
53
+ "@toa.io/agent": "1.0.0-alpha.93",
54
+ "@toa.io/extensions.storages": "1.0.0-alpha.94",
55
55
  "@types/bcryptjs": "2.4.3",
56
56
  "@types/cors": "2.8.13",
57
57
  "@types/http-cache-semantics": "4.0.4",
58
58
  "@types/negotiator": "0.6.1",
59
59
  "jest-esbuild": "0.3.0"
60
60
  },
61
- "gitHead": "975ee5af6194354efb6dd8c646b22a89c4d96f7a"
61
+ "gitHead": "73d05c94348477a608ec4eead9641c6417923012"
62
62
  }
@@ -56,7 +56,7 @@ function json (node: object | string): string {
56
56
  return node
57
57
 
58
58
  if (Array.isArray(node))
59
- return `[${node.map((v) => json(v)).join(',')}]`
59
+ return `[${node.map((v) => json(v as object | string)).join(',')}]`
60
60
 
61
61
  if (node.constructor !== Object)
62
62
  return JSON.stringify(node)
@@ -102,6 +102,7 @@ export class Put extends Directive {
102
102
  'LOCATION_UNTRUSTED', () => new http.Forbidden(error.message),
103
103
  'LOCATION_LENGTH', () => new http.BadRequest(error.message),
104
104
  'LOCATION_UNAVAILABLE', () => new http.NotFound(error.message),
105
+ 'INVALID_ID', () => new http.BadRequest(error.message),
105
106
  error)
106
107
  }
107
108
 
@@ -1 +1 @@
1
- {"version":3,"file":"Compose.js","sourceRoot":"","sources":["../../../source/directives/flow/Compose.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAkC;AAClC,oDAAqC;AACrC,6CAAsC;AACtC,uCAAkC;AAKlC,MAAa,OAAO;IACD,UAAU,CAAY;IAEvC,YAAoB,WAAgB;QAClC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,WAAqB,CAAC,CAAA;IAClD,CAAC;IAEM,MAAM,CAAE,OAAgB;QAC7B,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,OAAwB,EAAE,EAAE;YACjE,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,YAAY,sBAAQ,CAAC,EAAE,CAAC;gBACxC,kBAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAA;gBAEnE,OAAM;YACR,CAAC;YAED,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,YAAY,sBAAQ,EAAE,+BAA+B,CAAC,CAAA;YAE5E,uEAAuE;YACvE,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,uCAAuC,CAAC,CAAA;YAE1F,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAE1C,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QACnC,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,OAAO,CAAE,MAAgB;QACrC,MAAM,CAAC,GAAc,EAAE,CAAA;QAEvB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QAEzC,MAAM,IAA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1B,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACvB,OAAO,IAAI,IAAI,GAAG,CAAA;;YAElB,OAAO,IAAI,CAAA;IAEf,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACrB,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAA;IAErE,IAAI,IAAI,CAAC,WAAW,KAAK,MAAM;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAE7B,OAAO,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;SAC9B,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,KAAwB,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;AACzF,CAAC"}
@@ -84,7 +84,7 @@ class Put extends Directive_1.Directive {
84
84
  return stream;
85
85
  }
86
86
  throw(error) {
87
- throw (0, matchacho_1.match)(error.code, 'NOT_ACCEPTABLE', () => new http.UnsupportedMediaType(), 'TYPE_MISMATCH', () => new http.BadRequest(), 'LIMIT_EXCEEDED', () => new http.RequestEntityTooLarge(`Size limit is ${this.limitString}`), 'LOCATION_UNTRUSTED', () => new http.Forbidden(error.message), 'LOCATION_LENGTH', () => new http.BadRequest(error.message), 'LOCATION_UNAVAILABLE', () => new http.NotFound(error.message), error);
87
+ throw (0, matchacho_1.match)(error.code, 'NOT_ACCEPTABLE', () => new http.UnsupportedMediaType(), 'TYPE_MISMATCH', () => new http.BadRequest(), 'LIMIT_EXCEEDED', () => new http.RequestEntityTooLarge(`Size limit is ${this.limitString}`), 'LOCATION_UNTRUSTED', () => new http.Forbidden(error.message), 'LOCATION_LENGTH', () => new http.BadRequest(error.message), 'LOCATION_UNAVAILABLE', () => new http.NotFound(error.message), 'INVALID_ID', () => new http.BadRequest(error.message), error);
88
88
  }
89
89
  attributes(value) {
90
90
  if (Array.isArray(value))
@@ -1 +1 @@
1
- {"version":3,"file":"Put.js","sourceRoot":"","sources":["../../../source/directives/octets/Put.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,yCAAiC;AACjC,iDAAkC;AAClC,kCAA8B;AAC9B,mDAAoC;AACpC,2CAAsC;AACtC,2CAAuC;AACvC,mCAAiC;AAWjC,MAAa,GAAI,SAAQ,qBAAS;IAChB,QAAQ,GAAG,KAAK,CAAA;IAEf,MAAM,CAAS;IACf,KAAK,CAAQ;IACb,WAAW,CAAQ;IACnB,KAAK,CAAyB;IAC9B,QAAQ,CAAW;IACnB,SAAS,GAAuC,EAAE,CAAA;IAC3D,OAAO,GAAqB,IAAI,CAAA;IAExC,YACC,OAAuB,EAAE,SAA6B,EAAE,OAAgB;QACvE,KAAK,EAAE,CAAA;QAEP,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAU,OAAO,CAAC,CAAA;QAEtC,IAAI,CAAC,MAAM,GAAG,IAAA,iBAAK,EAAC,OAAO,EAAE,MAAM,EACjC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,EAChC,KAAK,EAAE,CAAC,KAAe,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAC3C,SAAS,CAAC,CAAA;QAEZ,IAAI,OAAO,EAAE,QAAQ,KAAK,SAAS;YACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAEzD,IAAI,OAAO,EAAE,KAAK,KAAK,SAAS;YAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAC/C,KAAK,CAAC,UAAU,CA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