@cubist-labs/cubesigner-sdk 0.2.24 → 0.3.1

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 (147) hide show
  1. package/README.md +30 -28
  2. package/dist/cjs/package.json +41 -0
  3. package/dist/cjs/spec/env/beta.json +9 -0
  4. package/dist/cjs/spec/env/gamma.json +9 -0
  5. package/dist/cjs/spec/env/prod.json +9 -0
  6. package/dist/cjs/src/api.d.ts +634 -0
  7. package/dist/cjs/src/api.js +1309 -0
  8. package/dist/cjs/src/client.d.ts +575 -0
  9. package/dist/cjs/src/client.js +378 -0
  10. package/dist/cjs/src/env.d.ts +15 -0
  11. package/dist/cjs/src/env.js +35 -0
  12. package/dist/cjs/src/error.d.ts +29 -0
  13. package/dist/cjs/src/error.js +36 -0
  14. package/dist/cjs/src/events.d.ts +84 -0
  15. package/dist/cjs/src/events.js +195 -0
  16. package/dist/cjs/src/index.d.ts +203 -0
  17. package/dist/cjs/src/index.js +298 -0
  18. package/dist/cjs/src/key.d.ts +152 -0
  19. package/dist/cjs/src/key.js +242 -0
  20. package/dist/{src/fido.d.ts → cjs/src/mfa.d.ts} +33 -15
  21. package/dist/cjs/src/mfa.js +169 -0
  22. package/dist/cjs/src/org.d.ts +99 -0
  23. package/dist/cjs/src/org.js +95 -0
  24. package/dist/cjs/src/paginator.d.ts +76 -0
  25. package/dist/cjs/src/paginator.js +99 -0
  26. package/dist/cjs/src/response.d.ts +101 -0
  27. package/dist/cjs/src/response.js +164 -0
  28. package/dist/cjs/src/role.d.ts +283 -0
  29. package/dist/cjs/src/role.js +253 -0
  30. package/dist/cjs/src/schema.d.ts +6209 -0
  31. package/dist/cjs/src/schema.js +7 -0
  32. package/dist/cjs/src/schema_types.d.ts +113 -0
  33. package/dist/cjs/src/schema_types.js +3 -0
  34. package/dist/cjs/src/session/session_storage.d.ts +27 -0
  35. package/dist/cjs/src/session/session_storage.js +47 -0
  36. package/dist/cjs/src/session/signer_session_manager.d.ts +125 -0
  37. package/dist/cjs/src/session/signer_session_manager.js +239 -0
  38. package/dist/cjs/src/signer_session.d.ts +41 -0
  39. package/dist/cjs/src/signer_session.js +77 -0
  40. package/dist/cjs/src/user_export.d.ts +52 -0
  41. package/dist/cjs/src/user_export.js +129 -0
  42. package/dist/cjs/src/util.d.ts +56 -0
  43. package/dist/cjs/src/util.js +86 -0
  44. package/dist/esm/package.json +41 -0
  45. package/dist/esm/spec/env/beta.json +9 -0
  46. package/dist/esm/spec/env/gamma.json +9 -0
  47. package/dist/esm/spec/env/prod.json +9 -0
  48. package/dist/esm/src/api.d.ts +634 -0
  49. package/dist/esm/src/api.js +1299 -0
  50. package/dist/esm/src/client.d.ts +575 -0
  51. package/dist/esm/src/client.js +374 -0
  52. package/dist/esm/src/env.d.ts +15 -0
  53. package/dist/esm/src/env.js +9 -0
  54. package/dist/esm/src/error.d.ts +29 -0
  55. package/dist/esm/src/error.js +31 -0
  56. package/dist/esm/src/events.d.ts +84 -0
  57. package/dist/esm/src/events.js +189 -0
  58. package/dist/esm/src/index.d.ts +203 -0
  59. package/dist/esm/src/index.js +276 -0
  60. package/dist/esm/src/key.d.ts +152 -0
  61. package/dist/esm/src/key.js +236 -0
  62. package/dist/esm/src/mfa.d.ts +94 -0
  63. package/dist/esm/src/mfa.js +163 -0
  64. package/dist/esm/src/org.d.ts +99 -0
  65. package/dist/esm/src/org.js +91 -0
  66. package/dist/esm/src/paginator.d.ts +76 -0
  67. package/dist/esm/src/paginator.js +94 -0
  68. package/dist/esm/src/response.d.ts +101 -0
  69. package/dist/esm/src/response.js +159 -0
  70. package/dist/esm/src/role.d.ts +283 -0
  71. package/dist/esm/src/role.js +248 -0
  72. package/dist/esm/src/schema.d.ts +6209 -0
  73. package/dist/esm/src/schema.js +6 -0
  74. package/dist/esm/src/schema_types.d.ts +113 -0
  75. package/dist/esm/src/schema_types.js +2 -0
  76. package/dist/esm/src/session/session_storage.d.ts +27 -0
  77. package/dist/esm/src/session/session_storage.js +43 -0
  78. package/dist/esm/src/session/signer_session_manager.d.ts +125 -0
  79. package/dist/esm/src/session/signer_session_manager.js +235 -0
  80. package/dist/esm/src/signer_session.d.ts +41 -0
  81. package/dist/esm/src/signer_session.js +72 -0
  82. package/dist/esm/src/user_export.d.ts +52 -0
  83. package/dist/esm/src/user_export.js +99 -0
  84. package/dist/esm/src/util.d.ts +56 -0
  85. package/dist/esm/src/util.js +76 -0
  86. package/dist/package.json +13 -45
  87. package/dist/src/api.d.ts +29 -18
  88. package/dist/src/api.js +70 -17
  89. package/dist/src/client.d.ts +35 -14
  90. package/dist/src/client.js +12 -8
  91. package/dist/src/error.d.ts +29 -0
  92. package/dist/src/error.js +36 -0
  93. package/dist/src/events.d.ts +1 -1
  94. package/dist/src/events.js +1 -1
  95. package/dist/src/index.d.ts +8 -11
  96. package/dist/src/index.js +11 -25
  97. package/dist/src/key.d.ts +18 -7
  98. package/dist/src/key.js +52 -19
  99. package/dist/src/role.d.ts +46 -3
  100. package/dist/src/role.js +60 -8
  101. package/dist/src/schema.d.ts +206 -72
  102. package/dist/src/schema.js +1 -1
  103. package/dist/src/schema_types.d.ts +3 -0
  104. package/dist/src/schema_types.js +1 -1
  105. package/dist/src/session/signer_session_manager.d.ts +49 -13
  106. package/dist/src/session/signer_session_manager.js +104 -26
  107. package/dist/src/util.d.ts +14 -0
  108. package/dist/src/util.js +24 -27
  109. package/package.json +19 -46
  110. package/src/api.ts +81 -23
  111. package/src/client.ts +12 -8
  112. package/src/error.ts +42 -0
  113. package/src/events.ts +3 -1
  114. package/src/index.ts +12 -24
  115. package/src/key.ts +36 -18
  116. package/src/role.ts +78 -7
  117. package/src/schema.ts +269 -110
  118. package/src/schema_types.ts +3 -0
  119. package/src/session/session_storage.ts +0 -32
  120. package/src/session/signer_session_manager.ts +137 -28
  121. package/src/util.ts +19 -10
  122. package/tsconfig.json +1 -21
  123. package/LICENSE-APACHE +0 -177
  124. package/LICENSE-MIT +0 -25
  125. package/NOTICE +0 -13
  126. package/dist/examples/ethers.d.ts +0 -1
  127. package/dist/examples/ethers.js +0 -142
  128. package/dist/src/ethers/index.d.ts +0 -95
  129. package/dist/src/ethers/index.js +0 -208
  130. package/dist/src/fido.js +0 -148
  131. package/dist/src/session/cognito_manager.d.ts +0 -71
  132. package/dist/src/session/cognito_manager.js +0 -129
  133. package/dist/src/session/generic.d.ts +0 -47
  134. package/dist/src/session/generic.js +0 -3
  135. package/dist/src/session/management_session_manager.d.ts +0 -59
  136. package/dist/src/session/management_session_manager.js +0 -111
  137. package/dist/src/session/oidc_session_manager.d.ts +0 -78
  138. package/dist/src/session/oidc_session_manager.js +0 -142
  139. package/dist/src/session/session_manager.d.ts +0 -99
  140. package/dist/src/session/session_manager.js +0 -136
  141. package/dist/src/sign.d.ts +0 -114
  142. package/dist/src/sign.js +0 -248
  143. package/dist/test/sessions.d.ts +0 -35
  144. package/dist/test/sessions.js +0 -56
  145. package/src/ethers/index.ts +0 -249
  146. package/src/session/cognito_manager.ts +0 -161
  147. package/src/session/session_manager.ts +0 -165
package/src/schema.ts CHANGED
@@ -3,6 +3,14 @@
3
3
  * Do not make direct changes to the file.
4
4
  */
5
5
 
6
+ /** OneOf type helpers */
7
+ type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
8
+ type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
9
+ type OneOf<T extends any[]> = T extends [infer Only]
10
+ ? Only
11
+ : T extends [infer A, infer B, ...infer Rest]
12
+ ? OneOf<[XOR<A, B>, ...Rest]>
13
+ : never;
6
14
 
7
15
  export interface paths {
8
16
  "/v0/about_me": {
@@ -60,6 +68,15 @@ export interface paths {
60
68
  */
61
69
  put: operations["deriveKey"];
62
70
  };
71
+ "/v0/org/{org_id}/evm/eip191/sign/{pubkey}": {
72
+ /**
73
+ * Sign EIP-191 Data
74
+ * @description Sign EIP-191 Data
75
+ *
76
+ * Signs a message using EIP-191 personal_sign with a given Secp256k1 key.
77
+ */
78
+ post: operations["eip191Sign"];
79
+ };
63
80
  "/v0/org/{org_id}/evm/eip712/sign/{pubkey}": {
64
81
  /**
65
82
  * Sign EIP-712 Typed Data
@@ -274,14 +291,15 @@ export interface paths {
274
291
  * @description Delete Role
275
292
  *
276
293
  * Deletes a role in an organization.
277
- * Only organization owners can perform this action.
294
+ * Only users in the role can perform this action.
278
295
  */
279
296
  delete: operations["deleteRole"];
280
297
  /**
281
298
  * Update Role
282
299
  * @description Update Role
283
300
  *
284
- * Enables or disables a role.
301
+ * Enables or disables a role (this requires the `manage:role:update:enable` scope).
302
+ * Updates the role's policies (this requires the `manage:role:update:policy` scope).
285
303
  * The user must be in the role or an owner of the organization.
286
304
  */
287
305
  patch: operations["updateRole"];
@@ -389,7 +407,8 @@ export interface paths {
389
407
  * Create new user session (management and/or signing)
390
408
  * @description Create new user session (management and/or signing)
391
409
  *
392
- * Create a new user session
410
+ * Creates a new user session, silently truncating requested session and auth lifetimes
411
+ * to be at most requestor's session and auth lifetime, respectively.
393
412
  */
394
413
  post: operations["createSession"];
395
414
  /**
@@ -775,7 +794,7 @@ export interface components {
775
794
  email: string;
776
795
  identity: components["schemas"]["OIDCIdentity"];
777
796
  /** @description Optional login MFA policy */
778
- mfa_policy?: Record<string, unknown> | null;
797
+ mfa_policy?: unknown;
779
798
  role: components["schemas"]["MemberRole"];
780
799
  };
781
800
  AddThirdPartyUserResponse: {
@@ -956,7 +975,13 @@ export interface components {
956
975
  signature: string;
957
976
  };
958
977
  /** @enum {string} */
959
- BtcSighashType: "All" | "None" | "Single" | "AllPlusAnyoneCanPay" | "NonePlusAnyoneCanPay" | "SinglePlusAnyoneCanPay";
978
+ BtcSighashType:
979
+ | "All"
980
+ | "None"
981
+ | "Single"
982
+ | "AllPlusAnyoneCanPay"
983
+ | "NonePlusAnyoneCanPay"
984
+ | "SinglePlusAnyoneCanPay";
960
985
  BtcSignRequest: {
961
986
  sig_kind: components["schemas"]["BtcSignatureKind"];
962
987
  /** @description The bitcoin transaction to sign */
@@ -991,6 +1016,19 @@ export interface components {
991
1016
  value: number;
992
1017
  };
993
1018
  };
1019
+ /** @description Describes how to derive a WebAuthn challenge value. */
1020
+ ChallengePieces: {
1021
+ /**
1022
+ * @description A base64url encoding of UTF8 JSON. The data in that JSON is endpoint specific, and describes what this FIDO challenge will be used for.
1023
+ *
1024
+ * Clients can use `preimage` along with `random_seed` to reconstruct the challenge like so:
1025
+ *
1026
+ * `challenge = HMAC-SHA256(key=random_seed, message=preimage)`
1027
+ */
1028
+ preimage: string;
1029
+ /** @description A random seed that prevents replay attacks */
1030
+ random_seed: string;
1031
+ };
994
1032
  /**
995
1033
  * @description Session information sent to the client.
996
1034
  * This struct works in tandem with its server-side counterpart [`SessionData`].
@@ -1011,17 +1049,19 @@ export interface components {
1011
1049
  /** @description Session ID */
1012
1050
  session_id: string;
1013
1051
  };
1014
- ConfiguredMfa: {
1015
- /** @enum {string} */
1016
- type: "totp";
1017
- } | {
1018
- /** @description A unique credential id */
1019
- id: string;
1020
- /** @description A human-readable name given to the key */
1021
- name: string;
1022
- /** @enum {string} */
1023
- type: "fido";
1024
- };
1052
+ ConfiguredMfa:
1053
+ | {
1054
+ /** @enum {string} */
1055
+ type: "totp";
1056
+ }
1057
+ | {
1058
+ /** @description A unique credential id */
1059
+ id: string;
1060
+ /** @description A human-readable name given to the key */
1061
+ name: string;
1062
+ /** @enum {string} */
1063
+ type: "fido";
1064
+ };
1025
1065
  CreateKeyImportKeyResponse: components["schemas"]["KeyImportKey"] & {
1026
1066
  /**
1027
1067
  * @description An attestation document from a secure enclave, including an
@@ -1093,7 +1133,7 @@ export interface components {
1093
1133
  */
1094
1134
  scopes: string[];
1095
1135
  };
1096
- CreateTokenRequest: components["schemas"]["RatchetConfig"] & ({
1136
+ CreateTokenRequest: components["schemas"]["RatchetConfig"] & {
1097
1137
  /**
1098
1138
  * @description A human readable description of the purpose of the key
1099
1139
  * @example Validator Signing
@@ -1107,7 +1147,16 @@ export interface components {
1107
1147
  * ]
1108
1148
  */
1109
1149
  scopes?: string[] | null;
1110
- });
1150
+ };
1151
+ /**
1152
+ * @description An extended form of `PublicKeyCredentialCreationOptions` that allows clients to derive the WebAuthn challenge
1153
+ * from a structured preimage.
1154
+ *
1155
+ * This ensures that the webuathn signature can only be used for a specific purpose
1156
+ */
1157
+ CreationOptionsWithHash: components["schemas"]["ChallengePieces"] & {
1158
+ options: components["schemas"]["PublicKeyCredentialCreationOptions"];
1159
+ };
1111
1160
  CubeSignerUserInfo: {
1112
1161
  /** @description All multi-factor authentication methods configured for this user */
1113
1162
  configured_mfa: components["schemas"]["ConfiguredMfa"][];
@@ -1160,6 +1209,22 @@ export interface components {
1160
1209
  */
1161
1210
  mnemonic_id: string;
1162
1211
  };
1212
+ Eip191Or712SignResponse: {
1213
+ /**
1214
+ * @description Hex-encoded signature comprising 65 bytes in the format required
1215
+ * by ecrecover: 32-byte r, 32-byte s, and one-byte recovery-id v
1216
+ * which is either 27 or 28.
1217
+ * @example 0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c
1218
+ */
1219
+ signature: string;
1220
+ };
1221
+ Eip191SignRequest: {
1222
+ /**
1223
+ * @description EIP-191 data to sign as hex-encoded bytes.
1224
+ * @example 0xdeadbeef13c0ffee
1225
+ */
1226
+ data: string;
1227
+ };
1163
1228
  /**
1164
1229
  * @example {
1165
1230
  * "chain_id": 1337,
@@ -1255,17 +1320,8 @@ export interface components {
1255
1320
  /** @description EIP-712 typed data. Refer to the JSON schema defined in EIP-712. */
1256
1321
  typed_data: Record<string, never>;
1257
1322
  };
1258
- Eip712SignResponse: {
1259
- /**
1260
- * @description Hex-encoded signature comprising 65 bytes in the format required
1261
- * by ecrecover: 32-byte r, 32-byte s, and one-byte recovery-id v
1262
- * which is either 27 or 28.
1263
- * @example 0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c
1264
- */
1265
- signature: string;
1266
- };
1267
1323
  /** @default null */
1268
- Empty: Record<string, unknown> | null;
1324
+ Empty: unknown;
1269
1325
  EmptyImpl: {
1270
1326
  status: string;
1271
1327
  };
@@ -1367,10 +1423,11 @@ export interface components {
1367
1423
  challenge_id: string;
1368
1424
  credential: components["schemas"]["PublicKeyCredential"];
1369
1425
  };
1370
- FidoAssertChallenge: {
1426
+ FidoAssertChallenge: (components["schemas"]["ChallengePieces"] & {
1427
+ options: components["schemas"]["PublicKeyCredentialRequestOptions"];
1428
+ }) & {
1371
1429
  /** @description The id of the challenge. Must be supplied when answering the challenge. */
1372
1430
  challenge_id: string;
1373
- options: components["schemas"]["PublicKeyCredentialRequestOptions"];
1374
1431
  };
1375
1432
  /** @description Sent from the client to the server to answer a fido challenge */
1376
1433
  FidoCreateChallengeAnswer: {
@@ -1382,10 +1439,11 @@ export interface components {
1382
1439
  * @description Sent by the server to the client. Contains the challenge data that must be
1383
1440
  * used to generate a new credential
1384
1441
  */
1385
- FidoCreateChallengeResponse: {
1442
+ FidoCreateChallengeResponse: (components["schemas"]["ChallengePieces"] & {
1443
+ options: components["schemas"]["PublicKeyCredentialCreationOptions"];
1444
+ }) & {
1386
1445
  /** @description The id of the challenge. Must be supplied when answering the challenge. */
1387
1446
  challenge_id: string;
1388
- options: components["schemas"]["PublicKeyCredentialCreationOptions"];
1389
1447
  };
1390
1448
  /** @description Declares intent to register a new FIDO key */
1391
1449
  FidoCreateRequest: {
@@ -1460,6 +1518,8 @@ export interface components {
1460
1518
  * @description Number of requests currently being processed by cube3signer
1461
1519
  */
1462
1520
  current_num_requests_processing: number;
1521
+ /** @description Do not record metric data from this heartbeat */
1522
+ ignore?: boolean;
1463
1523
  /**
1464
1524
  * Format: int64
1465
1525
  * @description Number of new requests during this heartbeat period
@@ -1506,7 +1566,7 @@ export interface components {
1506
1566
  */
1507
1567
  HttpRequest: {
1508
1568
  /** @description HTTP request body */
1509
- body?: Record<string, unknown> | null;
1569
+ body?: unknown;
1510
1570
  /** @description HTTP method of the request */
1511
1571
  method: string;
1512
1572
  /** @description HTTP path of the request (including host or not?) */
@@ -1516,7 +1576,7 @@ export interface components {
1516
1576
  * @description Proof that an end-user provided CubeSigner with a valid auth token
1517
1577
  * (either an OIDC token or a CubeSigner session token)
1518
1578
  */
1519
- IdentityProof: ({
1579
+ IdentityProof: {
1520
1580
  /**
1521
1581
  * @description OIDC audience; set only if the proof was obtained by using OIDC token.
1522
1582
  *
@@ -1531,7 +1591,7 @@ export interface components {
1531
1591
  exp_epoch: components["schemas"]["EpochDateTime"];
1532
1592
  identity?: components["schemas"]["OIDCIdentity"] | null;
1533
1593
  user_info?: components["schemas"]["CubeSignerUserInfo"] | null;
1534
- }) & {
1594
+ } & {
1535
1595
  /** @description An opaque identifier for the proof */
1536
1596
  id: string;
1537
1597
  };
@@ -1564,7 +1624,7 @@ export interface components {
1564
1624
  */
1565
1625
  email: string;
1566
1626
  /** @description Optional login MFA policy */
1567
- mfa_policy?: Record<string, unknown> | null;
1627
+ mfa_policy?: unknown;
1568
1628
  /**
1569
1629
  * @description The user's full name
1570
1630
  * @example Alice Wonderland
@@ -1650,21 +1710,24 @@ export interface components {
1650
1710
  * );
1651
1711
  * ```
1652
1712
  */
1653
- JsonKeyPackage: ({
1654
- /** @enum {string} */
1655
- material_type: "raw_secret";
1656
- /** @description The value of the raw secret */
1657
- secret: string;
1658
- } | {
1659
- /** @description The derivation path */
1660
- derivation_path: string;
1661
- /** @enum {string} */
1662
- material_type: "english_mnemonic";
1663
- /** @description The mnemonic */
1664
- mnemonic: string;
1665
- /** @description The password (which may be empty) */
1666
- password: string;
1667
- }) & {
1713
+ JsonKeyPackage: (
1714
+ | {
1715
+ /** @enum {string} */
1716
+ material_type: "raw_secret";
1717
+ /** @description The value of the raw secret */
1718
+ secret: string;
1719
+ }
1720
+ | {
1721
+ /** @description The derivation path */
1722
+ derivation_path: string;
1723
+ /** @enum {string} */
1724
+ material_type: "english_mnemonic";
1725
+ /** @description The mnemonic */
1726
+ mnemonic: string;
1727
+ /** @description The password (which may be empty) */
1728
+ password: string;
1729
+ }
1730
+ ) & {
1668
1731
  /** @description The type of key this package represents */
1669
1732
  key_type: string;
1670
1733
  };
@@ -1729,6 +1792,12 @@ export interface components {
1729
1792
  * @example 0x8e3484687e66cdd26cf04c3647633ab4f3570148
1730
1793
  */
1731
1794
  material_id: string;
1795
+ /**
1796
+ * @description User-defined metadata. When rendering (e.g., in the browser) you should treat
1797
+ * it as untrusted user data (and avoid injecting metadata into HTML directly) if
1798
+ * untrusted users can create/update keys (or their metadata).
1799
+ */
1800
+ metadata?: string;
1732
1801
  /**
1733
1802
  * @description Owner of the key
1734
1803
  * @example User#c3b9379c-4e8c-4216-bd0a-65ace53cf98f
@@ -1765,7 +1834,21 @@ export interface components {
1765
1834
  keys: components["schemas"]["KeyInfo"][];
1766
1835
  };
1767
1836
  /** @enum {string} */
1768
- KeyType: "SecpEthAddr" | "SecpBtc" | "SecpBtcTest" | "SecpAvaAddr" | "SecpAvaTestAddr" | "BlsPub" | "BlsInactive" | "Ed25519SolanaAddr" | "Ed25519SuiAddr" | "Ed25519AptosAddr" | "Ed25519CardanoAddrVk" | "Ed25519StellarAddr" | "Mnemonic" | "Stark";
1837
+ KeyType:
1838
+ | "SecpEthAddr"
1839
+ | "SecpBtc"
1840
+ | "SecpBtcTest"
1841
+ | "SecpAvaAddr"
1842
+ | "SecpAvaTestAddr"
1843
+ | "BlsPub"
1844
+ | "BlsInactive"
1845
+ | "Ed25519SolanaAddr"
1846
+ | "Ed25519SuiAddr"
1847
+ | "Ed25519AptosAddr"
1848
+ | "Ed25519CardanoAddrVk"
1849
+ | "Ed25519StellarAddr"
1850
+ | "Mnemonic"
1851
+ | "Stark";
1769
1852
  /**
1770
1853
  * @description Wrapper around encrypted [UnencryptedLastEvalKey] bytes.
1771
1854
  *
@@ -1794,8 +1877,23 @@ export interface components {
1794
1877
  request: components["schemas"]["HttpRequest"];
1795
1878
  status: components["schemas"]["Status"];
1796
1879
  };
1797
- /** @enum {string} */
1798
- MfaType: "CubeSigner" | "Totp" | "Fido";
1880
+ MfaType: OneOf<
1881
+ [
1882
+ "CubeSigner",
1883
+ "Totp",
1884
+ "Fido",
1885
+ {
1886
+ /** @description Answer a FIDO challenge with a specific FIDO key */
1887
+ FidoKey: {
1888
+ /**
1889
+ * @description The ID of the FIDO key that must be use to approve the request
1890
+ * @example FidoKey#EtDd...ZZc8=
1891
+ */
1892
+ key_id: string;
1893
+ };
1894
+ },
1895
+ ]
1896
+ >;
1799
1897
  /**
1800
1898
  * @description Network name ('mainnet', 'prater', 'goerli')
1801
1899
  * @example goerli
@@ -1951,14 +2049,14 @@ export interface components {
1951
2049
  */
1952
2050
  PaginatedListKeysResponse: {
1953
2051
  keys: components["schemas"]["KeyInfo"][];
1954
- } & ({
2052
+ } & {
1955
2053
  /**
1956
2054
  * @description If set, the content of `response` does not contain the entire result set.
1957
2055
  * To fetch the next page of the result set, call the same endpoint
1958
2056
  * but specify this value as the 'page.start' query parameter.
1959
2057
  */
1960
2058
  last_evaluated_key?: string | null;
1961
- });
2059
+ };
1962
2060
  /**
1963
2061
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1964
2062
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -1966,14 +2064,14 @@ export interface components {
1966
2064
  PaginatedListRoleKeysResponse: {
1967
2065
  /** @description All keys in a role */
1968
2066
  keys: components["schemas"]["KeyInRoleInfo"][];
1969
- } & ({
2067
+ } & {
1970
2068
  /**
1971
2069
  * @description If set, the content of `response` does not contain the entire result set.
1972
2070
  * To fetch the next page of the result set, call the same endpoint
1973
2071
  * but specify this value as the 'page.start' query parameter.
1974
2072
  */
1975
2073
  last_evaluated_key?: string | null;
1976
- });
2074
+ };
1977
2075
  /**
1978
2076
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1979
2077
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -1981,14 +2079,14 @@ export interface components {
1981
2079
  PaginatedListRoleUsersResponse: {
1982
2080
  /** @description All users in a role */
1983
2081
  users: components["schemas"]["UserInRoleInfo"][];
1984
- } & ({
2082
+ } & {
1985
2083
  /**
1986
2084
  * @description If set, the content of `response` does not contain the entire result set.
1987
2085
  * To fetch the next page of the result set, call the same endpoint
1988
2086
  * but specify this value as the 'page.start' query parameter.
1989
2087
  */
1990
2088
  last_evaluated_key?: string | null;
1991
- });
2089
+ };
1992
2090
  /**
1993
2091
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1994
2092
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -1996,14 +2094,14 @@ export interface components {
1996
2094
  PaginatedListRolesResponse: {
1997
2095
  /** @description All roles in an organization. */
1998
2096
  roles: components["schemas"]["RoleInfo"][];
1999
- } & ({
2097
+ } & {
2000
2098
  /**
2001
2099
  * @description If set, the content of `response` does not contain the entire result set.
2002
2100
  * To fetch the next page of the result set, call the same endpoint
2003
2101
  * but specify this value as the 'page.start' query parameter.
2004
2102
  */
2005
2103
  last_evaluated_key?: string | null;
2006
- });
2104
+ };
2007
2105
  /**
2008
2106
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
2009
2107
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -2011,28 +2109,28 @@ export interface components {
2011
2109
  PaginatedSessionsResponse: {
2012
2110
  /** @description The list of sessions */
2013
2111
  sessions: components["schemas"]["SessionInfo"][];
2014
- } & ({
2112
+ } & {
2015
2113
  /**
2016
2114
  * @description If set, the content of `response` does not contain the entire result set.
2017
2115
  * To fetch the next page of the result set, call the same endpoint
2018
2116
  * but specify this value as the 'page.start' query parameter.
2019
2117
  */
2020
2118
  last_evaluated_key?: string | null;
2021
- });
2119
+ };
2022
2120
  /**
2023
2121
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
2024
2122
  * value (which can the user pass back to use as a url query parameter to continue pagination).
2025
2123
  */
2026
2124
  PaginatedUserExportListResponse: {
2027
2125
  export_requests: components["schemas"]["UserExportInitResponse"][];
2028
- } & ({
2126
+ } & {
2029
2127
  /**
2030
2128
  * @description If set, the content of `response` does not contain the entire result set.
2031
2129
  * To fetch the next page of the result set, call the same endpoint
2032
2130
  * but specify this value as the 'page.start' query parameter.
2033
2131
  */
2034
2132
  last_evaluated_key?: string | null;
2035
- });
2133
+ };
2036
2134
  /**
2037
2135
  * @description This type represents a wire-encodable form of the PublicKeyCredential interface
2038
2136
  * Clients may need to manually encode into this format to communicate with the server
@@ -2057,7 +2155,7 @@ export interface components {
2057
2155
  * This operation returns the value of [[clientExtensionsResults]], which is a map containing extension identifier → client extension output entries produced by the extension’s client extension processing.
2058
2156
  * https://www.w3.org/TR/webauthn-2/#ref-for-dom-publickeycredential-getclientextensionresults
2059
2157
  */
2060
- clientExtensionResults?: Record<string, unknown> | null;
2158
+ clientExtensionResults?: unknown;
2061
2159
  /**
2062
2160
  * @description This internal slot contains the credential ID, chosen by the
2063
2161
  * authenticator. The credential ID is used to look up credentials for use,
@@ -2068,7 +2166,9 @@ export interface components {
2068
2166
  */
2069
2167
  id: string;
2070
2168
  /** @description Authenticators respond to Relying Party requests by returning an object derived from the AuthenticatorResponse interface */
2071
- response: components["schemas"]["AuthenticatorAttestationResponse"] | components["schemas"]["AuthenticatorAssertionResponse"];
2169
+ response:
2170
+ | components["schemas"]["AuthenticatorAttestationResponse"]
2171
+ | components["schemas"]["AuthenticatorAssertionResponse"];
2072
2172
  };
2073
2173
  /**
2074
2174
  * @description Defines the parameters for the creation of a new public key credential
@@ -2108,7 +2208,7 @@ export interface components {
2108
2208
  *
2109
2209
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialcreationoptions-extensions
2110
2210
  */
2111
- extensions?: Record<string, unknown> | null;
2211
+ extensions?: unknown;
2112
2212
  /**
2113
2213
  * @description This member contains information about the desired properties of the
2114
2214
  * credential to be created. The sequence is ordered from most preferred to
@@ -2202,7 +2302,7 @@ export interface components {
2202
2302
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrequestoptions-challenge
2203
2303
  */
2204
2304
  challenge: string;
2205
- extensions?: Record<string, unknown> | null;
2305
+ extensions?: unknown;
2206
2306
  /**
2207
2307
  * @description This OPTIONAL member specifies the relying party identifier claimed by
2208
2308
  * the caller. If omitted, its value will be the CredentialsContainer
@@ -2349,13 +2449,13 @@ export interface components {
2349
2449
  name: string;
2350
2450
  };
2351
2451
  RatchetConfig: {
2352
- /** @default 300 */
2452
+ /** @default default_auth_lifetime */
2353
2453
  auth_lifetime?: components["schemas"]["Seconds"];
2354
2454
  /** @default default_grace_lifetime */
2355
2455
  grace_lifetime?: components["schemas"]["Seconds"];
2356
- /** @default 86400 */
2456
+ /** @default default_refresh_lifetime */
2357
2457
  refresh_lifetime?: components["schemas"]["Seconds"];
2358
- /** @default 31536000 */
2458
+ /** @default default_session_lifetime */
2359
2459
  session_lifetime?: components["schemas"]["Seconds"];
2360
2460
  };
2361
2461
  /** @description Receipt that an MFA request was approved. */
@@ -2369,6 +2469,15 @@ export interface components {
2369
2469
  final_approver: string;
2370
2470
  timestamp: components["schemas"]["EpochDateTime"];
2371
2471
  };
2472
+ /**
2473
+ * @description An extended form of `PublicKeyCredentialRequestOptions` that allows clients to derive the WebAuthn challenge
2474
+ * from a structured preimage.
2475
+ *
2476
+ * This ensures that the webuathn signature can only be used for a specific purpose
2477
+ */
2478
+ RequestOptionsWithHash: components["schemas"]["ChallengePieces"] & {
2479
+ options: components["schemas"]["PublicKeyCredentialRequestOptions"];
2480
+ };
2372
2481
  /**
2373
2482
  * @description This enumeration’s values describe the Relying Party's requirements for
2374
2483
  * client-side discoverable credentials (formerly known as resident credentials
@@ -2618,6 +2727,11 @@ export interface components {
2618
2727
  * Once disabled, a key cannot be used for signing.
2619
2728
  */
2620
2729
  enabled?: boolean | null;
2730
+ /**
2731
+ * @description If set, update this key's metadata. Validation regex: ^[A-Za-z0-9_=+/ \-\.\,]{0,1024}$
2732
+ * @example Contract admin key
2733
+ */
2734
+ metadata?: string | null;
2621
2735
  /**
2622
2736
  * @description If set, updates key's owner to this value.
2623
2737
  * The new owner must be an existing user who is a member of the same org.
@@ -2865,7 +2979,7 @@ export interface components {
2865
2979
  /** @description All multi-factor authentication methods configured for this user */
2866
2980
  mfa: components["schemas"]["ConfiguredMfa"][];
2867
2981
  /** @description MFA policy, applies before logging in and other sensitive operations */
2868
- mfa_policy?: Record<string, unknown> | null;
2982
+ mfa_policy?: unknown;
2869
2983
  /**
2870
2984
  * @description All organizations the user belongs to
2871
2985
  * @example [
@@ -2978,7 +3092,7 @@ export interface components {
2978
3092
  };
2979
3093
  };
2980
3094
  };
2981
- Eip712SignResponse: {
3095
+ Eip191Or712SignResponse: {
2982
3096
  content: {
2983
3097
  "application/json": {
2984
3098
  /**
@@ -3022,10 +3136,11 @@ export interface components {
3022
3136
  };
3023
3137
  FidoAssertChallenge: {
3024
3138
  content: {
3025
- "application/json": {
3139
+ "application/json": (components["schemas"]["ChallengePieces"] & {
3140
+ options: components["schemas"]["PublicKeyCredentialRequestOptions"];
3141
+ }) & {
3026
3142
  /** @description The id of the challenge. Must be supplied when answering the challenge. */
3027
3143
  challenge_id: string;
3028
- options: components["schemas"]["PublicKeyCredentialRequestOptions"];
3029
3144
  };
3030
3145
  };
3031
3146
  };
@@ -3035,10 +3150,11 @@ export interface components {
3035
3150
  */
3036
3151
  FidoCreateChallengeResponse: {
3037
3152
  content: {
3038
- "application/json": {
3153
+ "application/json": (components["schemas"]["ChallengePieces"] & {
3154
+ options: components["schemas"]["PublicKeyCredentialCreationOptions"];
3155
+ }) & {
3039
3156
  /** @description The id of the challenge. Must be supplied when answering the challenge. */
3040
3157
  challenge_id: string;
3041
- options: components["schemas"]["PublicKeyCredentialCreationOptions"];
3042
3158
  };
3043
3159
  };
3044
3160
  };
@@ -3056,7 +3172,7 @@ export interface components {
3056
3172
  */
3057
3173
  IdentityProof: {
3058
3174
  content: {
3059
- "application/json": ({
3175
+ "application/json": {
3060
3176
  /**
3061
3177
  * @description OIDC audience; set only if the proof was obtained by using OIDC token.
3062
3178
  *
@@ -3071,7 +3187,7 @@ export interface components {
3071
3187
  exp_epoch: components["schemas"]["EpochDateTime"];
3072
3188
  identity?: components["schemas"]["OIDCIdentity"] | null;
3073
3189
  user_info?: components["schemas"]["CubeSignerUserInfo"] | null;
3074
- }) & {
3190
+ } & {
3075
3191
  /** @description An opaque identifier for the proof */
3076
3192
  id: string;
3077
3193
  };
@@ -3127,6 +3243,12 @@ export interface components {
3127
3243
  * @example 0x8e3484687e66cdd26cf04c3647633ab4f3570148
3128
3244
  */
3129
3245
  material_id: string;
3246
+ /**
3247
+ * @description User-defined metadata. When rendering (e.g., in the browser) you should treat
3248
+ * it as untrusted user data (and avoid injecting metadata into HTML directly) if
3249
+ * untrusted users can create/update keys (or their metadata).
3250
+ */
3251
+ metadata?: string;
3130
3252
  /**
3131
3253
  * @description Owner of the key
3132
3254
  * @example User#c3b9379c-4e8c-4216-bd0a-65ace53cf98f
@@ -3287,14 +3409,14 @@ export interface components {
3287
3409
  content: {
3288
3410
  "application/json": {
3289
3411
  keys: components["schemas"]["KeyInfo"][];
3290
- } & ({
3412
+ } & {
3291
3413
  /**
3292
3414
  * @description If set, the content of `response` does not contain the entire result set.
3293
3415
  * To fetch the next page of the result set, call the same endpoint
3294
3416
  * but specify this value as the 'page.start' query parameter.
3295
3417
  */
3296
3418
  last_evaluated_key?: string | null;
3297
- });
3419
+ };
3298
3420
  };
3299
3421
  };
3300
3422
  PaginatedListRoleKeysResponse: {
@@ -3302,14 +3424,14 @@ export interface components {
3302
3424
  "application/json": {
3303
3425
  /** @description All keys in a role */
3304
3426
  keys: components["schemas"]["KeyInRoleInfo"][];
3305
- } & ({
3427
+ } & {
3306
3428
  /**
3307
3429
  * @description If set, the content of `response` does not contain the entire result set.
3308
3430
  * To fetch the next page of the result set, call the same endpoint
3309
3431
  * but specify this value as the 'page.start' query parameter.
3310
3432
  */
3311
3433
  last_evaluated_key?: string | null;
3312
- });
3434
+ };
3313
3435
  };
3314
3436
  };
3315
3437
  PaginatedListRoleUsersResponse: {
@@ -3317,14 +3439,14 @@ export interface components {
3317
3439
  "application/json": {
3318
3440
  /** @description All users in a role */
3319
3441
  users: components["schemas"]["UserInRoleInfo"][];
3320
- } & ({
3442
+ } & {
3321
3443
  /**
3322
3444
  * @description If set, the content of `response` does not contain the entire result set.
3323
3445
  * To fetch the next page of the result set, call the same endpoint
3324
3446
  * but specify this value as the 'page.start' query parameter.
3325
3447
  */
3326
3448
  last_evaluated_key?: string | null;
3327
- });
3449
+ };
3328
3450
  };
3329
3451
  };
3330
3452
  PaginatedListRolesResponse: {
@@ -3332,14 +3454,14 @@ export interface components {
3332
3454
  "application/json": {
3333
3455
  /** @description All roles in an organization. */
3334
3456
  roles: components["schemas"]["RoleInfo"][];
3335
- } & ({
3457
+ } & {
3336
3458
  /**
3337
3459
  * @description If set, the content of `response` does not contain the entire result set.
3338
3460
  * To fetch the next page of the result set, call the same endpoint
3339
3461
  * but specify this value as the 'page.start' query parameter.
3340
3462
  */
3341
3463
  last_evaluated_key?: string | null;
3342
- });
3464
+ };
3343
3465
  };
3344
3466
  };
3345
3467
  PaginatedSessionsResponse: {
@@ -3347,28 +3469,28 @@ export interface components {
3347
3469
  "application/json": {
3348
3470
  /** @description The list of sessions */
3349
3471
  sessions: components["schemas"]["SessionInfo"][];
3350
- } & ({
3472
+ } & {
3351
3473
  /**
3352
3474
  * @description If set, the content of `response` does not contain the entire result set.
3353
3475
  * To fetch the next page of the result set, call the same endpoint
3354
3476
  * but specify this value as the 'page.start' query parameter.
3355
3477
  */
3356
3478
  last_evaluated_key?: string | null;
3357
- });
3479
+ };
3358
3480
  };
3359
3481
  };
3360
3482
  PaginatedUserExportListResponse: {
3361
3483
  content: {
3362
3484
  "application/json": {
3363
3485
  export_requests: components["schemas"]["UserExportInitResponse"][];
3364
- } & ({
3486
+ } & {
3365
3487
  /**
3366
3488
  * @description If set, the content of `response` does not contain the entire result set.
3367
3489
  * To fetch the next page of the result set, call the same endpoint
3368
3490
  * but specify this value as the 'page.start' query parameter.
3369
3491
  */
3370
3492
  last_evaluated_key?: string | null;
3371
- });
3493
+ };
3372
3494
  };
3373
3495
  };
3374
3496
  RevokeTokenResponse: {
@@ -3605,7 +3727,7 @@ export interface components {
3605
3727
  /** @description All multi-factor authentication methods configured for this user */
3606
3728
  mfa: components["schemas"]["ConfiguredMfa"][];
3607
3729
  /** @description MFA policy, applies before logging in and other sensitive operations */
3608
- mfa_policy?: Record<string, unknown> | null;
3730
+ mfa_policy?: unknown;
3609
3731
  /**
3610
3732
  * @description All organizations the user belongs to
3611
3733
  * @example [
@@ -3633,7 +3755,6 @@ export type $defs = Record<string, never>;
3633
3755
  export type external = Record<string, never>;
3634
3756
 
3635
3757
  export interface operations {
3636
-
3637
3758
  /**
3638
3759
  * User Info
3639
3760
  * @description User Info
@@ -3818,6 +3939,46 @@ export interface operations {
3818
3939
  };
3819
3940
  };
3820
3941
  };
3942
+ /**
3943
+ * Sign EIP-191 Data
3944
+ * @description Sign EIP-191 Data
3945
+ *
3946
+ * Signs a message using EIP-191 personal_sign with a given Secp256k1 key.
3947
+ */
3948
+ eip191Sign: {
3949
+ parameters: {
3950
+ path: {
3951
+ /**
3952
+ * @description Name or ID of the desired Org
3953
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
3954
+ */
3955
+ org_id: string;
3956
+ /**
3957
+ * @description Hex-encoded EVM address of the Secp256k1 key
3958
+ * @example 0x49011adbCC3bC9c0307BB07F37Dda1a1a9c69d2E
3959
+ */
3960
+ pubkey: string;
3961
+ };
3962
+ };
3963
+ requestBody: {
3964
+ content: {
3965
+ "application/json": components["schemas"]["Eip191SignRequest"];
3966
+ };
3967
+ };
3968
+ responses: {
3969
+ 200: components["responses"]["Eip191Or712SignResponse"];
3970
+ 202: {
3971
+ content: {
3972
+ "application/json": components["schemas"]["AcceptedResponse"];
3973
+ };
3974
+ };
3975
+ default: {
3976
+ content: {
3977
+ "application/json": components["schemas"]["ErrorResponse"];
3978
+ };
3979
+ };
3980
+ };
3981
+ };
3821
3982
  /**
3822
3983
  * Sign EIP-712 Typed Data
3823
3984
  * @description Sign EIP-712 Typed Data
@@ -3833,7 +3994,7 @@ export interface operations {
3833
3994
  */
3834
3995
  org_id: string;
3835
3996
  /**
3836
- * @description Hex-encoded ethereum address of the secp key
3997
+ * @description Hex-encoded EVM address of the Secp256k1 key
3837
3998
  * @example 0x49011adbCC3bC9c0307BB07F37Dda1a1a9c69d2E
3838
3999
  */
3839
4000
  pubkey: string;
@@ -3845,7 +4006,7 @@ export interface operations {
3845
4006
  };
3846
4007
  };
3847
4008
  responses: {
3848
- 200: components["responses"]["Eip712SignResponse"];
4009
+ 200: components["responses"]["Eip191Or712SignResponse"];
3849
4010
  202: {
3850
4011
  content: {
3851
4012
  "application/json": components["schemas"]["AcceptedResponse"];
@@ -3943,8 +4104,7 @@ export interface operations {
3943
4104
  "application/json": components["schemas"]["IdentityProof"];
3944
4105
  };
3945
4106
  };
3946
- responses: {
3947
- };
4107
+ responses: {};
3948
4108
  };
3949
4109
  /**
3950
4110
  * Create Key-Import Key
@@ -4541,7 +4701,7 @@ export interface operations {
4541
4701
  * @description Delete Role
4542
4702
  *
4543
4703
  * Deletes a role in an organization.
4544
- * Only organization owners can perform this action.
4704
+ * Only users in the role can perform this action.
4545
4705
  */
4546
4706
  deleteRole: {
4547
4707
  parameters: {
@@ -4571,7 +4731,8 @@ export interface operations {
4571
4731
  * Update Role
4572
4732
  * @description Update Role
4573
4733
  *
4574
- * Enables or disables a role.
4734
+ * Enables or disables a role (this requires the `manage:role:update:enable` scope).
4735
+ * Updates the role's policies (this requires the `manage:role:update:policy` scope).
4575
4736
  * The user must be in the role or an owner of the organization.
4576
4737
  */
4577
4738
  updateRole: {
@@ -4629,8 +4790,7 @@ export interface operations {
4629
4790
  "application/json": components["schemas"]["AddKeysToRoleRequest"];
4630
4791
  };
4631
4792
  };
4632
- responses: {
4633
- };
4793
+ responses: {};
4634
4794
  };
4635
4795
  /**
4636
4796
  * Add User
@@ -4659,8 +4819,7 @@ export interface operations {
4659
4819
  user_id: string;
4660
4820
  };
4661
4821
  };
4662
- responses: {
4663
- };
4822
+ responses: {};
4664
4823
  };
4665
4824
  /**
4666
4825
  * List Role Keys
@@ -4733,8 +4892,7 @@ export interface operations {
4733
4892
  key_id: string;
4734
4893
  };
4735
4894
  };
4736
- responses: {
4737
- };
4895
+ responses: {};
4738
4896
  };
4739
4897
  /**
4740
4898
  * List a single page of Tokens (Deprecated)
@@ -4973,7 +5131,8 @@ export interface operations {
4973
5131
  * Create new user session (management and/or signing)
4974
5132
  * @description Create new user session (management and/or signing)
4975
5133
  *
4976
- * Create a new user session
5134
+ * Creates a new user session, silently truncating requested session and auth lifetimes
5135
+ * to be at most requestor's session and auth lifetime, respectively.
4977
5136
  */
4978
5137
  createSession: {
4979
5138
  parameters: {
@@ -5875,9 +6034,9 @@ export interface operations {
5875
6034
  org_id: string;
5876
6035
  };
5877
6036
  };
5878
- requestBody: {
6037
+ requestBody?: {
5879
6038
  content: {
5880
- "application/json": components["schemas"]["HeartbeatRequest"];
6039
+ "application/json": components["schemas"]["HeartbeatRequest"] | null;
5881
6040
  };
5882
6041
  };
5883
6042
  responses: {