@cubist-labs/cubesigner-sdk 0.1.77 → 0.2.15

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 (55) hide show
  1. package/dist/package.json +68 -0
  2. package/dist/src/api.d.ts +493 -0
  3. package/dist/src/api.js +1166 -0
  4. package/dist/src/client.d.ts +534 -10
  5. package/dist/src/client.js +355 -19
  6. package/dist/src/ethers/index.d.ts +34 -9
  7. package/dist/src/ethers/index.js +63 -19
  8. package/dist/src/index.d.ts +51 -70
  9. package/dist/src/index.js +83 -237
  10. package/dist/src/key.d.ts +35 -64
  11. package/dist/src/key.js +32 -96
  12. package/dist/src/mfa.d.ts +85 -14
  13. package/dist/src/mfa.js +146 -40
  14. package/dist/src/org.d.ts +42 -194
  15. package/dist/src/org.js +52 -336
  16. package/dist/src/paginator.js +1 -1
  17. package/dist/src/response.d.ts +101 -0
  18. package/dist/src/response.js +164 -0
  19. package/dist/src/role.d.ts +87 -83
  20. package/dist/src/role.js +79 -136
  21. package/dist/src/schema.d.ts +936 -28
  22. package/dist/src/schema.js +1 -1
  23. package/dist/src/schema_types.d.ts +109 -0
  24. package/dist/src/schema_types.js +3 -0
  25. package/dist/src/session/cognito_manager.d.ts +15 -3
  26. package/dist/src/session/cognito_manager.js +23 -5
  27. package/dist/src/session/session_manager.d.ts +1 -1
  28. package/dist/src/session/session_manager.js +3 -11
  29. package/dist/src/session/session_storage.js +1 -1
  30. package/dist/src/session/signer_session_manager.d.ts +10 -29
  31. package/dist/src/session/signer_session_manager.js +21 -80
  32. package/dist/src/signer_session.d.ts +15 -252
  33. package/dist/src/signer_session.js +25 -424
  34. package/dist/src/user_export.d.ts +52 -0
  35. package/dist/src/user_export.js +129 -0
  36. package/dist/src/util.d.ts +15 -0
  37. package/dist/src/util.js +33 -11
  38. package/package.json +13 -11
  39. package/src/api.ts +1395 -0
  40. package/src/client.ts +413 -12
  41. package/src/ethers/index.ts +74 -28
  42. package/src/index.ts +96 -273
  43. package/src/key.ts +36 -131
  44. package/src/{fido.ts → mfa.ts} +62 -38
  45. package/src/org.ts +54 -405
  46. package/src/response.ts +196 -0
  47. package/src/role.ts +113 -184
  48. package/src/schema.ts +936 -28
  49. package/src/schema_types.ts +110 -0
  50. package/src/session/cognito_manager.ts +33 -6
  51. package/src/session/session_manager.ts +2 -8
  52. package/src/session/signer_session_manager.ts +29 -110
  53. package/src/signer_session.ts +22 -597
  54. package/src/user_export.ts +116 -0
  55. package/src/util.ts +29 -10
package/src/schema.ts CHANGED
@@ -8,7 +8,6 @@ export interface paths {
8
8
  "/v0/about_me": {
9
9
  /**
10
10
  * User Info
11
- * @deprecated
12
11
  * @description User Info
13
12
  *
14
13
  * Retrieves information about the current user.
@@ -386,6 +385,13 @@ export interface paths {
386
385
  * If no query parameters are provided, information for the current session is returned
387
386
  */
388
387
  get: operations["listSessions"];
388
+ /**
389
+ * Create new user session (management and/or signing)
390
+ * @description Create new user session (management and/or signing)
391
+ *
392
+ * Create a new user session
393
+ */
394
+ post: operations["createSession"];
389
395
  /**
390
396
  * Revoke existing session(s)
391
397
  * @description Revoke existing session(s)
@@ -395,6 +401,15 @@ export interface paths {
395
401
  */
396
402
  delete: operations["revokeSessions"];
397
403
  };
404
+ "/v0/org/{org_id}/session/self": {
405
+ /**
406
+ * Revoke current session
407
+ * @description Revoke current session
408
+ *
409
+ * Immediately revokes the current session, preventing it from being used or refreshed
410
+ */
411
+ delete: operations["revokeCurrentSession"];
412
+ };
398
413
  "/v0/org/{org_id}/session/{session_id}": {
399
414
  /**
400
415
  * Get session information
@@ -437,6 +452,42 @@ export interface paths {
437
452
  */
438
453
  get: operations["aboutMe"];
439
454
  };
455
+ "/v0/org/{org_id}/user/me/export": {
456
+ /**
457
+ * List outstanding user-export requests
458
+ * @description List outstanding user-export requests
459
+ */
460
+ get: operations["userExportList"];
461
+ /**
462
+ * Initiate a user-export request
463
+ * @description Initiate a user-export request
464
+ *
465
+ * This starts a delay (whose length is determined by Org-wide settings)
466
+ * before export can be completed, and returns a ticket that can be used
467
+ * to complete the export once the timer has expired.
468
+ *
469
+ * Only one user-export request can be active for a given key. If there
470
+ * is already an active export, this endpoint will return an error. To
471
+ * create a new request, first delete the existing one.
472
+ */
473
+ post: operations["userExportInit"];
474
+ /**
475
+ * Delete an existing user-export request
476
+ * @description Delete an existing user-export request
477
+ */
478
+ delete: operations["userExportDelete"];
479
+ /**
480
+ * Complete a user-export request
481
+ * @description Complete a user-export request
482
+ *
483
+ * This endpoint can be called only after initiating a user-export request via
484
+ * the `user_export_init` API, and only within the subsequent export window
485
+ * (i.e., after the export delay has passed and before the request has expired).
486
+ *
487
+ * To check on the status of an export request, see the `user_export_list` API.
488
+ */
489
+ patch: operations["userExportComplete"];
490
+ };
440
491
  "/v0/org/{org_id}/user/me/fido": {
441
492
  /**
442
493
  * Initiate registration of a FIDO key
@@ -711,6 +762,10 @@ export interface components {
711
762
  mfa_policy?: Record<string, unknown> | null;
712
763
  role: components["schemas"]["MemberRole"];
713
764
  };
765
+ AddThirdPartyUserResponse: {
766
+ /** @example User#c3b9379c-4e8c-4216-bd0a-65ace53cf98f */
767
+ user_id: string;
768
+ };
714
769
  ApprovalInfo: {
715
770
  timestamp: components["schemas"]["EpochDateTime"];
716
771
  };
@@ -860,6 +915,10 @@ export interface components {
860
915
  */
861
916
  tx: Record<string, never>;
862
917
  };
918
+ AvaSignResponse: {
919
+ /** @description The hex-encoded signature. */
920
+ signature: string;
921
+ };
863
922
  /** @description Wrapper around a zeroizing 32-byte fixed-size array */
864
923
  B32: string;
865
924
  /**
@@ -876,6 +935,10 @@ export interface components {
876
935
  */
877
936
  message_base64: string;
878
937
  };
938
+ BlobSignResponse: {
939
+ /** @description The hex-encoded signature. */
940
+ signature: string;
941
+ };
879
942
  /** @enum {string} */
880
943
  BtcSighashType: "All" | "None" | "Single" | "AllPlusAnyoneCanPay" | "NonePlusAnyoneCanPay" | "SinglePlusAnyoneCanPay";
881
944
  BtcSignRequest: {
@@ -883,6 +946,13 @@ export interface components {
883
946
  /** @description The bitcoin transaction to sign */
884
947
  tx: Record<string, never>;
885
948
  };
949
+ BtcSignResponse: {
950
+ /**
951
+ * @description The hex-encoded signature in compact format.
952
+ * @example 0x454aef27c21df7dd8f537dc869f4cd65286ce239a52d36470f4d85be85a891b02789e5ffd8560b32a98110e5d0096802e4c14145cf6c44f10a768c87755eaa4800
953
+ */
954
+ signature: string;
955
+ };
886
956
  BtcSignatureKind: {
887
957
  /** @description Segregated Witness */
888
958
  Segwit: {
@@ -936,6 +1006,18 @@ export interface components {
936
1006
  /** @enum {string} */
937
1007
  type: "fido";
938
1008
  };
1009
+ CreateKeyImportKeyResponse: components["schemas"]["KeyImportKey"] & {
1010
+ /**
1011
+ * @description An attestation document from a secure enclave, including an
1012
+ * RSA signing key used to sign the contents of this message.
1013
+ */
1014
+ enclave_attestation: string;
1015
+ /**
1016
+ * @description An RSA-PSS-SHA256 signature on the public key and encrypted
1017
+ * secrets attesting to their generation inside a secure enclave.
1018
+ */
1019
+ enclave_signature: string;
1020
+ };
939
1021
  CreateKeyRequest: {
940
1022
  /**
941
1023
  * Format: int64
@@ -956,6 +1038,10 @@ export interface components {
956
1038
  */
957
1039
  owner?: string | null;
958
1040
  };
1041
+ CreateKeyResponse: {
1042
+ /** @description The info about the created keys */
1043
+ keys: components["schemas"]["KeyInfo"][];
1044
+ };
959
1045
  /** @description Optional create role request body */
960
1046
  CreateRoleRequest: {
961
1047
  /**
@@ -964,6 +1050,33 @@ export interface components {
964
1050
  */
965
1051
  name: string;
966
1052
  };
1053
+ /** @description The newly created role information */
1054
+ CreateRoleResponse: {
1055
+ /**
1056
+ * @description A human-readable name for the role.
1057
+ * @example my_role
1058
+ */
1059
+ name?: string | null;
1060
+ /**
1061
+ * @description The id of the newly created role
1062
+ * @example Role#bfe3eccb-731e-430d-b1e5-ac1363e6b06b
1063
+ */
1064
+ role_id: string;
1065
+ };
1066
+ CreateSessionRequest: components["schemas"]["RatchetConfig"] & {
1067
+ /**
1068
+ * @description A human readable description of the session's purpose
1069
+ * @example Manage keys on server foo.bar
1070
+ */
1071
+ purpose: string;
1072
+ /**
1073
+ * @description Controls what capabilities this session will have.
1074
+ * @example [
1075
+ * "manage:key:*"
1076
+ * ]
1077
+ */
1078
+ scopes: string[];
1079
+ };
967
1080
  CreateTokenRequest: components["schemas"]["RatchetConfig"] & ({
968
1081
  /**
969
1082
  * @description A human readable description of the purpose of the key
@@ -1126,8 +1239,20 @@ export interface components {
1126
1239
  /** @description EIP-712 typed data. Refer to the JSON schema defined in EIP-712. */
1127
1240
  typed_data: Record<string, never>;
1128
1241
  };
1242
+ Eip712SignResponse: {
1243
+ /**
1244
+ * @description Hex-encoded signature comprising 65 bytes in the format required
1245
+ * by ecrecover: 32-byte r, 32-byte s, and one-byte recovery-id v
1246
+ * which is either 27 or 28.
1247
+ * @example 0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c
1248
+ */
1249
+ signature: string;
1250
+ };
1129
1251
  /** @default null */
1130
1252
  Empty: Record<string, unknown> | null;
1253
+ EmptyImpl: {
1254
+ status: string;
1255
+ };
1131
1256
  /**
1132
1257
  * @description Epoch is a quoted `uint64`.
1133
1258
  * @example 256
@@ -1177,6 +1302,13 @@ export interface components {
1177
1302
  */
1178
1303
  tx: Record<string, never>;
1179
1304
  };
1305
+ Eth1SignResponse: {
1306
+ /**
1307
+ * @description Hex-encoded RLP encoding of the transaction and its signature
1308
+ * @example 0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001201d58656b0e22aaa68fdc692db41979098c3886ed33015d7467de9211609cdac000000000000000000000000000000000000000000000000000000000000000308b0c2900324d3ff9adfba7fdfe5af3f9b2cdbeef7b280437bbf1b1c59a093d615afe3e5dfed9622b540cdd9b49b3c5ad00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002001000000000000000000000049011adbcc3bc9c0307bb07f37dda1a1a9c69d2e0000000000000000000000000000000000000000000000000000000000000060903db8525674b8e7904f9b7d7d9ec55a0a42d33cf58be25469b0c21bbb6d06172bc5bb5fd1aed8e4f35936968958116b0619553c2cb1c52e7323074c6f8eb3d5a7074fc6580148df907837fa3b164ad7fbc2288dad1e8a5b021095b57c8a36d4
1309
+ */
1310
+ rlp_signed_tx: string;
1311
+ };
1180
1312
  /**
1181
1313
  * @example {
1182
1314
  * "eth2_sign_request": {
@@ -1206,18 +1338,39 @@ export interface components {
1206
1338
  eth2_sign_request: Record<string, never>;
1207
1339
  network: components["schemas"]["Network"];
1208
1340
  };
1341
+ Eth2SignResponse: {
1342
+ /**
1343
+ * @description Hex encoded signature prefixed with 0x e.g. "0x0000..."
1344
+ * @example 0xb4f2ef9d12a54e1f569596c07c97d6d730535b6ffc0d287761dc78103a86326782471a04c75ce7a6faea08ca9a4a0830031cdcb893da8711d54aa22619f1a7e71b8185ddf4c6bfd9babbd735960e35e56bd6eeb89625b04850e7a9ef8846e549
1345
+ */
1346
+ signature: string;
1347
+ };
1209
1348
  /** @description Sent from the client to the server to answer a fido challenge */
1210
1349
  FidoAssertAnswer: {
1211
1350
  /** @description The ID of the challenge that was returned from the POST endpoint */
1212
1351
  challenge_id: string;
1213
1352
  credential: components["schemas"]["PublicKeyCredential"];
1214
1353
  };
1354
+ FidoAssertChallenge: {
1355
+ /** @description The id of the challenge. Must be supplied when answering the challenge. */
1356
+ challenge_id: string;
1357
+ options: components["schemas"]["PublicKeyCredentialRequestOptions"];
1358
+ };
1215
1359
  /** @description Sent from the client to the server to answer a fido challenge */
1216
1360
  FidoCreateChallengeAnswer: {
1217
1361
  /** @description The ID of the challenge that was returned from the POST endpoint */
1218
1362
  challenge_id: string;
1219
1363
  credential: components["schemas"]["PublicKeyCredential"];
1220
1364
  };
1365
+ /**
1366
+ * @description Sent by the server to the client. Contains the challenge data that must be
1367
+ * used to generate a new credential
1368
+ */
1369
+ FidoCreateChallengeResponse: {
1370
+ /** @description The id of the challenge. Must be supplied when answering the challenge. */
1371
+ challenge_id: string;
1372
+ options: components["schemas"]["PublicKeyCredentialCreationOptions"];
1373
+ };
1221
1374
  /** @description Declares intent to register a new FIDO key */
1222
1375
  FidoCreateRequest: {
1223
1376
  /**
@@ -1275,6 +1428,10 @@ export interface components {
1275
1428
  GetKeysInOrgRequest: {
1276
1429
  key_type?: components["schemas"]["KeyType"] | null;
1277
1430
  };
1431
+ GetUsersInOrgResponse: {
1432
+ /** @description The list of users in the org */
1433
+ users: components["schemas"]["UserIdInfo"][];
1434
+ };
1278
1435
  /** @description Stats pertaining the the sender `cube3signer` instance */
1279
1436
  HeartbeatRequest: {
1280
1437
  /**
@@ -1407,6 +1564,101 @@ export interface components {
1407
1564
  */
1408
1565
  skip_email: boolean;
1409
1566
  };
1567
+ /**
1568
+ * @description Key material contained inside a [`JsonKeyPackage`], which can be either
1569
+ * a raw secret or a mnemonic, password, and derivation path.
1570
+ */
1571
+ JsonKeyMaterial: {
1572
+ /** @enum {string} */
1573
+ material_type: "raw_secret";
1574
+ /** @description The value of the raw secret */
1575
+ secret: string;
1576
+ } | {
1577
+ /** @description The derivation path */
1578
+ derivation_path: string;
1579
+ /** @enum {string} */
1580
+ material_type: "english_mnemonic";
1581
+ /** @description The mnemonic */
1582
+ mnemonic: string;
1583
+ /** @description The password (which may be empty) */
1584
+ password: string;
1585
+ };
1586
+ /**
1587
+ * @description A [`KeyPackage`] serialized into a format that gives a tidier JSON
1588
+ * representation suitable for encryption in the user-export flow.
1589
+ *
1590
+ * We construct values of this type rather than constructing `serde_json::Value`s
1591
+ * directly with `json!()` because this allows us to zeroize values on drop, which
1592
+ * doesn't work with `serde_json::Value`.
1593
+ *
1594
+ * Examples of serialized material:
1595
+ *
1596
+ * - `JsonKeyMaterial::EnglishMnemonic`:
1597
+ *
1598
+ * ```
1599
+ * use cubist_signer_utils::{
1600
+ * DerivationPath, KeyPackage, Mnemonic, MnemonicPackage, Secp256k1Pkg,
1601
+ * };
1602
+ * use serde_json::json;
1603
+ *
1604
+ * const MNEMONIC: &str = "deposit fiscal brain swarm surround cousin horn glare fix love render believe guide shuffle stem cram broccoli resemble beach artefact language gift jar permit";
1605
+ * const DER_PATH: &str = "m/44'/60'/0'/0/0";
1606
+ * const KEY_TYPE: &str = "ecdsa:secp256k1";
1607
+ *
1608
+ * let mne = Mnemonic::try_from(MNEMONIC).expect("good mnemonic");
1609
+ * let derp = DerivationPath::try_from(DER_PATH).expect("good der path");
1610
+ * let mne_pkg = MnemonicPackage::new(mne, "", derp);
1611
+ * let key_pkg = KeyPackage::<Secp256k1Pkg>::EnglishMnemonic(mne_pkg);
1612
+ * let json_pkg = key_pkg.into_json(KEY_TYPE);
1613
+ *
1614
+ * let json_expect = json!({
1615
+ * "key_type": KEY_TYPE,
1616
+ * "material_type": "english_mnemonic",
1617
+ * "mnemonic": MNEMONIC,
1618
+ * "password": "",
1619
+ * "derivation_path": DER_PATH,
1620
+ * });
1621
+ *
1622
+ * assert_eq!(
1623
+ * serde_json::to_value(&json_pkg).expect("json serialization"),
1624
+ * json_expect,
1625
+ * );
1626
+ * ```
1627
+ *
1628
+ * - `JsonKeyMaterial::RawSecret`:
1629
+ *
1630
+ * ```
1631
+ * use cubist_signer_utils::{
1632
+ * get_random_byte_array, hex_encode, KeyPackage, RngCore, Secp256k1Pkg,
1633
+ * };
1634
+ * use serde_json::json;
1635
+ *
1636
+ * const KEY_TYPE: &str = "ecdsa:secp256k1";
1637
+ *
1638
+ * // random 32-byte secret
1639
+ * let sk: [u8; 32] = *get_random_byte_array();
1640
+ *
1641
+ * let key_pkg = KeyPackage::<Secp256k1Pkg>::Secret(sk);
1642
+ * let json_pkg = key_pkg.into_json(KEY_TYPE);
1643
+ *
1644
+ * let json_expect = json!({
1645
+ * "key_type": KEY_TYPE,
1646
+ * "material_type": "raw_secret",
1647
+ * "secret": hex_encode(&sk),
1648
+ * });
1649
+ *
1650
+ * assert_eq!(
1651
+ * serde_json::to_value(&json_pkg).expect("json serialization"),
1652
+ * json_expect,
1653
+ * );
1654
+ * ```
1655
+ */
1656
+ JsonKeyPackage: {
1657
+ material_type: "JsonKeyPackage";
1658
+ } & Omit<components["schemas"]["JsonKeyMaterial"], "material_type"> & {
1659
+ /** @description The type of key this package represents */
1660
+ key_type: string;
1661
+ };
1410
1662
  /** @description Derivation-related metadata for keys derived from a long-lived mnemonic */
1411
1663
  KeyDerivationInfo: {
1412
1664
  /** @description The derivation path used to derive this key */
@@ -1500,6 +1752,9 @@ export interface components {
1500
1752
  */
1501
1753
  purpose: string;
1502
1754
  };
1755
+ KeyInfos: {
1756
+ keys: components["schemas"]["KeyInfo"][];
1757
+ };
1503
1758
  /** @enum {string} */
1504
1759
  KeyType: "SecpEthAddr" | "SecpBtc" | "SecpBtcTest" | "SecpAvaAddr" | "SecpAvaTestAddr" | "BlsPub" | "BlsInactive" | "Ed25519SolanaAddr" | "Ed25519SuiAddr" | "Ed25519AptosAddr" | "Ed25519CardanoAddrVk" | "Ed25519StellarAddr" | "Mnemonic" | "Stark";
1505
1760
  /**
@@ -1509,6 +1764,13 @@ export interface components {
1509
1764
  * so that they can pass this back to us as a url query parameter.
1510
1765
  */
1511
1766
  LastEvalKey: string;
1767
+ ListMfaResponse: {
1768
+ /** @description All pending MFA requests */
1769
+ mfa_requests: components["schemas"]["MfaRequestInfo"][];
1770
+ };
1771
+ ListTokensResponse: {
1772
+ tokens: components["schemas"]["TokenInfo"][];
1773
+ };
1512
1774
  /**
1513
1775
  * @description Describes whether a user in an org is an Owner or just a regular member
1514
1776
  * @enum {string}
@@ -1550,11 +1812,6 @@ export interface components {
1550
1812
  * a single OIDC user to multiple `User`s in CubeSigner
1551
1813
  */
1552
1814
  OIDCIdentity: {
1553
- /**
1554
- * @description Free-form additional user info.
1555
- * @example null
1556
- */
1557
- disambiguator?: string | null;
1558
1815
  /**
1559
1816
  * @description The root-level issuer who administrates this user. Frome the OIDC spec:
1560
1817
  * Issuer Identifier for the Issuer of the response. The iss
@@ -1577,6 +1834,8 @@ export interface components {
1577
1834
  sub: string;
1578
1835
  };
1579
1836
  OidcLoginRequest: {
1837
+ /** @description A human readable description of the purpose of the session */
1838
+ purpose?: string | null;
1580
1839
  /**
1581
1840
  * @description Controls what capabilities this session will have.
1582
1841
  * @example [
@@ -1626,6 +1885,22 @@ export interface components {
1626
1885
  * ]
1627
1886
  */
1628
1887
  policy?: Record<string, never>[];
1888
+ /**
1889
+ * Format: int64
1890
+ * @description The organization's currently configured user-export delay, i.e., the minimum
1891
+ * amount of time (in seconds) between when a user-export is initiated and when
1892
+ * it may be completed. (This value is meaningless for organizations that use
1893
+ * org-wide export.)
1894
+ */
1895
+ user_export_delay: number;
1896
+ /**
1897
+ * Format: int64
1898
+ * @description The organization's currently configured user-export window, i.e., the amount
1899
+ * of time (in seconds) between when the user-export delay is completed and when
1900
+ * the user export request has expired and can no longer be completed. (This value
1901
+ * is meaningless for organizations that use org-wide export.)
1902
+ */
1903
+ user_export_window: number;
1629
1904
  };
1630
1905
  /**
1631
1906
  * @description The rocket query parameter representing the page from which to start a paginated query.
@@ -1648,6 +1923,94 @@ export interface components {
1648
1923
  */
1649
1924
  "page.start"?: string | null;
1650
1925
  };
1926
+ /**
1927
+ * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1928
+ * value (which can the user pass back to use as a url query parameter to continue pagination).
1929
+ */
1930
+ PaginatedListKeysResponse: {
1931
+ keys: components["schemas"]["KeyInfo"][];
1932
+ } & ({
1933
+ /**
1934
+ * @description If set, the content of `response` does not contain the entire result set.
1935
+ * To fetch the next page of the result set, call the same endpoint
1936
+ * but specify this value as the 'page.start' query parameter.
1937
+ */
1938
+ last_evaluated_key?: string | null;
1939
+ });
1940
+ /**
1941
+ * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1942
+ * value (which can the user pass back to use as a url query parameter to continue pagination).
1943
+ */
1944
+ PaginatedListRoleKeysResponse: {
1945
+ /** @description All keys in a role */
1946
+ keys: components["schemas"]["KeyInRoleInfo"][];
1947
+ } & ({
1948
+ /**
1949
+ * @description If set, the content of `response` does not contain the entire result set.
1950
+ * To fetch the next page of the result set, call the same endpoint
1951
+ * but specify this value as the 'page.start' query parameter.
1952
+ */
1953
+ last_evaluated_key?: string | null;
1954
+ });
1955
+ /**
1956
+ * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1957
+ * value (which can the user pass back to use as a url query parameter to continue pagination).
1958
+ */
1959
+ PaginatedListRoleUsersResponse: {
1960
+ /** @description All users in a role */
1961
+ users: components["schemas"]["UserInRoleInfo"][];
1962
+ } & ({
1963
+ /**
1964
+ * @description If set, the content of `response` does not contain the entire result set.
1965
+ * To fetch the next page of the result set, call the same endpoint
1966
+ * but specify this value as the 'page.start' query parameter.
1967
+ */
1968
+ last_evaluated_key?: string | null;
1969
+ });
1970
+ /**
1971
+ * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1972
+ * value (which can the user pass back to use as a url query parameter to continue pagination).
1973
+ */
1974
+ PaginatedListRolesResponse: {
1975
+ /** @description All roles in an organization. */
1976
+ roles: components["schemas"]["RoleInfo"][];
1977
+ } & ({
1978
+ /**
1979
+ * @description If set, the content of `response` does not contain the entire result set.
1980
+ * To fetch the next page of the result set, call the same endpoint
1981
+ * but specify this value as the 'page.start' query parameter.
1982
+ */
1983
+ last_evaluated_key?: string | null;
1984
+ });
1985
+ /**
1986
+ * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
1987
+ * value (which can the user pass back to use as a url query parameter to continue pagination).
1988
+ */
1989
+ PaginatedSessionsResponse: {
1990
+ /** @description The list of sessions */
1991
+ sessions: components["schemas"]["SessionInfo"][];
1992
+ } & ({
1993
+ /**
1994
+ * @description If set, the content of `response` does not contain the entire result set.
1995
+ * To fetch the next page of the result set, call the same endpoint
1996
+ * but specify this value as the 'page.start' query parameter.
1997
+ */
1998
+ last_evaluated_key?: string | null;
1999
+ });
2000
+ /**
2001
+ * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
2002
+ * value (which can the user pass back to use as a url query parameter to continue pagination).
2003
+ */
2004
+ PaginatedUserExportListResponse: {
2005
+ export_requests: components["schemas"]["UserExportInitResponse"][];
2006
+ } & ({
2007
+ /**
2008
+ * @description If set, the content of `response` does not contain the entire result set.
2009
+ * To fetch the next page of the result set, call the same endpoint
2010
+ * but specify this value as the 'page.start' query parameter.
2011
+ */
2012
+ last_evaluated_key?: string | null;
2013
+ });
1651
2014
  /**
1652
2015
  * @description This type represents a wire-encodable form of the PublicKeyCredential interface
1653
2016
  * Clients may need to manually encode into this format to communicate with the server
@@ -1692,7 +2055,7 @@ export interface components {
1692
2055
  */
1693
2056
  PublicKeyCredentialCreationOptions: {
1694
2057
  attestation?: components["schemas"]["AttestationConveyancePreference"];
1695
- authenticator_selection?: components["schemas"]["AuthenticatorSelectionCriteria"] | null;
2058
+ authenticatorSelection?: components["schemas"]["AuthenticatorSelectionCriteria"] | null;
1696
2059
  /**
1697
2060
  * @description This member contains a challenge intended to be used for generating the
1698
2061
  * newly created credential’s attestation object. See the § 13.4.3
@@ -1710,7 +2073,7 @@ export interface components {
1710
2073
  *
1711
2074
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialcreationoptions-excludecredentials
1712
2075
  */
1713
- exclude_credentials?: components["schemas"]["PublicKeyCredentialDescriptor"][];
2076
+ excludeCredentials?: components["schemas"]["PublicKeyCredentialDescriptor"][];
1714
2077
  /**
1715
2078
  * @description This member contains additional parameters requesting additional
1716
2079
  * processing by the client and authenticator. For example, the caller may
@@ -1732,7 +2095,7 @@ export interface components {
1732
2095
  *
1733
2096
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialcreationoptions-pubkeycredparams
1734
2097
  */
1735
- pub_key_cred_params: components["schemas"]["PublicKeyCredentialParameters"][];
2098
+ pubKeyCredParams: components["schemas"]["PublicKeyCredentialParameters"][];
1736
2099
  rp: components["schemas"]["PublicKeyCredentialRpEntity"];
1737
2100
  /**
1738
2101
  * Format: int32
@@ -1743,7 +2106,7 @@ export interface components {
1743
2106
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialcreationoptions-timeout
1744
2107
  */
1745
2108
  timeout?: number | null;
1746
- user?: components["schemas"]["PublicKeyCredentialUserEntity"] | null;
2109
+ user: components["schemas"]["PublicKeyCredentialUserEntity"];
1747
2110
  };
1748
2111
  /**
1749
2112
  * @description This dictionary contains the attributes that are specified by a caller when
@@ -1808,7 +2171,7 @@ export interface components {
1808
2171
  *
1809
2172
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrequestoptions-allowcredentials
1810
2173
  */
1811
- allow_credentials?: components["schemas"]["PublicKeyCredentialDescriptor"][];
2174
+ allowCredentials?: components["schemas"]["PublicKeyCredentialDescriptor"][];
1812
2175
  /**
1813
2176
  * @description This member represents a challenge that the selected authenticator
1814
2177
  * signs, along with other data, when producing an authentication
@@ -1825,7 +2188,7 @@ export interface components {
1825
2188
  *
1826
2189
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrequestoptions-rpid
1827
2190
  */
1828
- rp_id?: string | null;
2191
+ rpId?: string | null;
1829
2192
  /**
1830
2193
  * Format: int32
1831
2194
  * @description This OPTIONAL member specifies a time, in milliseconds, that the caller
@@ -1835,7 +2198,7 @@ export interface components {
1835
2198
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrequestoptions-timeout
1836
2199
  */
1837
2200
  timeout?: number | null;
1838
- user_verification?: components["schemas"]["UserVerificationRequirement"];
2201
+ userVerification?: components["schemas"]["UserVerificationRequirement"];
1839
2202
  };
1840
2203
  /**
1841
2204
  * @description The PublicKeyCredentialRpEntity dictionary is used to supply additional
@@ -1849,7 +2212,7 @@ export interface components {
1849
2212
  *
1850
2213
  * https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrpentity-id
1851
2214
  */
1852
- id: string;
2215
+ id?: string | null;
1853
2216
  /**
1854
2217
  * @description A human-palatable name for the entity. Its function depends on what the
1855
2218
  * PublicKeyCredentialEntity represents: When inherited by
@@ -1993,6 +2356,13 @@ export interface components {
1993
2356
  * @enum {string}
1994
2357
  */
1995
2358
  ResidentKeyRequirement: "discouraged" | "preferred" | "required";
2359
+ RevokeTokenResponse: {
2360
+ token?: components["schemas"]["TokenInfo"] | null;
2361
+ };
2362
+ RevokeTokensResponse: {
2363
+ /** @description Tokens that were revoked. */
2364
+ revoked: components["schemas"]["TokenInfo"][];
2365
+ };
1996
2366
  RoleInfo: {
1997
2367
  /**
1998
2368
  * @description Whether the role is enabled
@@ -2006,6 +2376,22 @@ export interface components {
2006
2376
  * @example my_role
2007
2377
  */
2008
2378
  name?: string | null;
2379
+ /**
2380
+ * @description Policy that is checked whenever a key is accessed for signing via this role.
2381
+ * @example [
2382
+ * {
2383
+ * "SourceIpAllowlist": [
2384
+ * "123.456.78.9/16"
2385
+ * ]
2386
+ * },
2387
+ * {
2388
+ * "RequireMfa": {
2389
+ * "count": 1
2390
+ * }
2391
+ * }
2392
+ * ]
2393
+ */
2394
+ policy?: Record<string, never>[];
2009
2395
  /**
2010
2396
  * @description The ID of the role
2011
2397
  * @example Role#bfe3eccb-731e-430d-b1e5-ac1363e6b06b
@@ -2032,10 +2418,24 @@ export interface components {
2032
2418
  */
2033
2419
  session_id: string;
2034
2420
  };
2035
- SignRequest: {
2036
- message: Record<string, never>;
2421
+ /** @description The response from any operation operating on multiple sessions */
2422
+ SessionsResponse: {
2423
+ /** @description The list of sessions */
2424
+ sessions: components["schemas"]["SessionInfo"][];
2425
+ };
2426
+ /**
2427
+ * @example {
2428
+ * "message_base64": "AQABA8OKVzLEjststN4xXr39kLKHT8d58eQY1QEs6MeXwEFBrxTAlULX1troLbWxuAXQqgbQofGi6z8fJi7KAAIf7YMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJK0tn39k28s+X86W47EvbRRKnYBVQ8Q/l2m1EbfT7+vAQICAAEMAgAAAGQAAAAAAAAA"
2429
+ * }
2430
+ */
2431
+ SolanaSignRequest: {
2432
+ /** @description Solana base64-encoded serialized Message */
2433
+ message_base64: string;
2434
+ };
2435
+ SolanaSignResponse: {
2436
+ /** @description The hex-encoded signature. */
2437
+ signature: string;
2037
2438
  };
2038
- SolanaSignRequest: components["schemas"]["SignRequest"] & Record<string, never>;
2039
2439
  StakeRequest: {
2040
2440
  /**
2041
2441
  * Format: int64
@@ -2064,6 +2464,14 @@ export interface components {
2064
2464
  */
2065
2465
  withdrawal_addr: string;
2066
2466
  };
2467
+ StakeResponse: {
2468
+ /**
2469
+ * @description The validator key id ("Key#...")
2470
+ * @example Key#db1731f8-3659-45c0-885b-e11e1f5b7be2
2471
+ */
2472
+ created_validator_key_id: string;
2473
+ deposit_tx: components["schemas"]["DepositTxn"];
2474
+ };
2067
2475
  Status: {
2068
2476
  /** @description Users who are allowed to approve. Must be non-empty. */
2069
2477
  allowed_approvers: string[];
@@ -2103,6 +2511,23 @@ export interface components {
2103
2511
  /** @description The ID of the challenge that was returned from the POST endpoint */
2104
2512
  totp_id: string;
2105
2513
  };
2514
+ TotpInfo: {
2515
+ /**
2516
+ * @description The ID of the TOTP challenge.
2517
+ * @example TotpChallenge#7892ebba-563e-485b-bb7d-e26267363286
2518
+ */
2519
+ totp_id: string;
2520
+ /**
2521
+ * @description Standard TOTP url which includes everything needed to initialize TOTP.
2522
+ * @example otpauth://totp/Cubist:alice-%40example.com?secret=DAHF7KCOTQWSOMK4XFEMNHXO4J433OD7&issuer=Cubist
2523
+ */
2524
+ totp_url: string;
2525
+ };
2526
+ /** @description Request to reset TOTP. */
2527
+ TotpResetRequest: {
2528
+ /** @description The name of the issuer; defaults to "Cubist". */
2529
+ issuer?: string | null;
2530
+ };
2106
2531
  /** @description Options that should be set only for local devnet testing. */
2107
2532
  UnsafeConf: {
2108
2533
  /**
@@ -2149,6 +2574,22 @@ export interface components {
2149
2574
  */
2150
2575
  validator_index: string;
2151
2576
  };
2577
+ /**
2578
+ * @description Unstake responses are signed voluntary exit messages.
2579
+ * The schema for this message is defined
2580
+ * [here](https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#signedvoluntaryexit).
2581
+ * This message can be directly POSTed to the Beacon node's
2582
+ * `/eth/v1/beacon/pool/voluntary_exits` end-point (see expected schema
2583
+ * [here](https://ethereum.github.io/beacon-APIs/#/Beacon/submitPoolVoluntaryExit)).
2584
+ */
2585
+ UnstakeResponse: {
2586
+ message: components["schemas"]["VoluntaryExit"];
2587
+ /**
2588
+ * @description BLS signature.
2589
+ * @example 0x910c7cd537ed91cc8c4a82f3cbd832e9be8c24a22e9c86df479f7ce42025ea6a09619b418b666a060e260d2aae31b8e50e9d05ca3442c7eed3b507e5207e14674275f68c2ba84c4bf6b8dd364a304acac8cfab3681e2514b4400f9242bc61164
2590
+ */
2591
+ signature: string;
2592
+ };
2152
2593
  UpdateKeyRequest: {
2153
2594
  /**
2154
2595
  * @description If set, updates the keys's `enabled` property to this value.
@@ -2201,14 +2642,174 @@ export interface components {
2201
2642
  * }
2202
2643
  * ]
2203
2644
  */
2204
- policy?: Record<string, never>[] | null;
2645
+ policy?: Record<string, never>[] | null;
2646
+ /**
2647
+ * Format: int64
2648
+ * @description If set, update this org's user-export delay, i.e., the amount of time
2649
+ * (in seconds) between a user's initiating an export and the time when
2650
+ * export is allowed. For security, this delay cannot be set to less than
2651
+ * 172800, i.e., 2 days.
2652
+ */
2653
+ user_export_delay?: number | null;
2654
+ /**
2655
+ * Format: int64
2656
+ * @description If set, update this org's user-export window, i.e., the amount of time
2657
+ * (in seconds) that export is allowed after the user-export delay. After
2658
+ * this amount of time, the export is canceled and must be re-initiated.
2659
+ * For security, this window cannot be set to greater than 259200, i.e.,
2660
+ * 3 days.
2661
+ */
2662
+ user_export_window?: number | null;
2663
+ };
2664
+ UpdateOrgResponse: {
2665
+ /** @description The new value of the 'enabled' property */
2666
+ enabled?: boolean | null;
2667
+ /**
2668
+ * @description The new human-readable name for the org (must be alphanumeric)
2669
+ * @example my_org_name
2670
+ */
2671
+ name?: string | null;
2672
+ /**
2673
+ * @description The ID of the organization
2674
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
2675
+ */
2676
+ org_id: string;
2677
+ /**
2678
+ * @description The new value of org-wide policies
2679
+ * @example [
2680
+ * {
2681
+ * "MaxDailyUnstake": 5
2682
+ * },
2683
+ * {
2684
+ * "OriginAllowlist": [
2685
+ * "https://example.com"
2686
+ * ]
2687
+ * }
2688
+ * ]
2689
+ */
2690
+ policy?: Record<string, never>[] | null;
2691
+ /**
2692
+ * Format: int64
2693
+ * @description The new value of user-export delay
2694
+ */
2695
+ user_export_delay?: number | null;
2696
+ /**
2697
+ * Format: int64
2698
+ * @description The new value of user-export window
2699
+ */
2700
+ user_export_window?: number | null;
2701
+ };
2702
+ UpdateRoleRequest: {
2703
+ /**
2704
+ * @description If set, updates the role's `enabled` property to this value.
2705
+ * Once disabled, a role cannot be used; and it's tokens cannot be used for signing.
2706
+ */
2707
+ enabled?: boolean | null;
2708
+ /**
2709
+ * @description If set, update this role's key policies (old policies will be overwritten!).
2710
+ * Only "deny" style policies may be set.
2711
+ * @example [
2712
+ * {
2713
+ * "SourceIpAllowlist": [
2714
+ * "123.456.78.9/16"
2715
+ * ]
2716
+ * }
2717
+ * ]
2718
+ */
2719
+ policy?: Record<string, never>[] | null;
2720
+ };
2721
+ /** @description A request to complete a user export */
2722
+ UserExportCompleteRequest: {
2723
+ /**
2724
+ * @description The id of the key to be exported. The key-id must correspond to the one in
2725
+ * the specified export request, and the caller must own this key.
2726
+ * @example Key#0x3c4d90Cc5Af1644C3A3B013Baa5488997381D7C8
2727
+ */
2728
+ key_id: string;
2729
+ /**
2730
+ * @description The NIST P-256 public key (base64-encoded SEC1 with or without compression)
2731
+ * to which the export will be encrypted. If a public key was provided when
2732
+ * `user_export_init` was called, this key must match that one.
2733
+ * @example AkpLT/3dXApJzXSduaPQ7apyT0ADBwqkt1es/aT0iWWf
2734
+ */
2735
+ public_key: string;
2736
+ };
2737
+ /** @description An encrypted user-export */
2738
+ UserExportCompleteResponse: {
2739
+ /**
2740
+ * @description The exported key material, encrypted with AES-256-GCM under a key
2741
+ * derived from the public key supplied in the request via HPKE (RFC9180)
2742
+ * with DHKEM(P-256, HKDF-SHA256) and base64 encoded.
2743
+ */
2744
+ encrypted_key_material: string;
2745
+ /**
2746
+ * @description The ephemeral public key used for HPKE key derivation as base64-encoded
2747
+ * uncompressed SEC1 serialization.
2748
+ */
2749
+ ephemeral_public_key: string;
2750
+ /** @description The user-id to which this key belongs. */
2751
+ user_id: string;
2205
2752
  };
2206
- UpdateRoleRequest: {
2753
+ /** @description A request to initiate a user export */
2754
+ UserExportInitRequest: {
2207
2755
  /**
2208
- * @description If set, updates the role's `enabled` property to this value.
2209
- * Once disabled, a role cannot be used; and it's tokens cannot be used for signing.
2756
+ * @description The id of the key to be exported. This key must be owned by the caller.
2757
+ * @example Key#0x3c4d90Cc5Af1644C3A3B013Baa5488997381D7C8
2210
2758
  */
2211
- enabled?: boolean | null;
2759
+ key_id: string;
2760
+ /**
2761
+ * @description An optional NIST P-256 public key (base64-encoded SEC1 with or without
2762
+ * compression) to which the export will be encrypted. If provided, this
2763
+ * public key MUST be the one used to encrypt the export once the delay has
2764
+ * expired. Otherwise, the user can provide any public key when completing
2765
+ * the export request post delay.
2766
+ *
2767
+ * This option may provide extra security when the user has a secure hardware
2768
+ * device (e.g., a phone's secure element or a YubiKey) in which a NIST P-256
2769
+ * secret key can be generated. Providing the corresponding public key here
2770
+ * ensures that only that specific device will be capable of decrypting
2771
+ * the export ciphertext.
2772
+ *
2773
+ * If no secure hardware device is available to store the secret key, this
2774
+ * option SHOULD NOT be used because of the risk of secret key theft during
2775
+ * the export delay period.
2776
+ * @example AkpLT/3dXApJzXSduaPQ7apyT0ADBwqkt1es/aT0iWWf
2777
+ */
2778
+ public_key?: string | null;
2779
+ };
2780
+ /** @description The response to a successful user-export init request */
2781
+ UserExportInitResponse: components["schemas"]["UserExportRequest"] & {
2782
+ /**
2783
+ * @description The key-id being requested.
2784
+ * @example Key#0x3c4d90Cc5Af1644C3A3B013Baa5488997381D7C8
2785
+ */
2786
+ key_id: string;
2787
+ };
2788
+ /** @description Pending user-export request as stored in the database. */
2789
+ UserExportRequest: {
2790
+ exp_epoch: components["schemas"]["EpochDateTime"];
2791
+ /**
2792
+ * @description The org-id in which the key is housed.
2793
+ * @example Org#f361ed6b-5d19-4ccf-a4d5-eba935dc0b90
2794
+ */
2795
+ org_id: string;
2796
+ /**
2797
+ * @description The SHA-256 hash of the public key provided at export initiation,
2798
+ * if any. If a key was provided, only that key can be used to complete
2799
+ * the export procedure. Otherwise, any key can be used.
2800
+ *
2801
+ * IMPORTANT: if a public key is supplied at export initiation, it is
2802
+ * STRONGLY RECOMMENDED that the corresponding secret key be stored in
2803
+ * a secure hardware device, e.g., a YubiKey or a phone's secure element.
2804
+ * If no such hardware is available, supplying a public key at export
2805
+ * initiation is STRONGLY DISCOURAGED because of the risk of theft during
2806
+ * the export delay period.
2807
+ *
2808
+ * (See also the comment in the `public_key` field of `UserInitRequest`.)
2809
+ * @example df457a98d5538540f54d1316b597a0f39b8d96f488f10a2e31a955c146fdf1d3
2810
+ */
2811
+ public_key_hash?: string | null;
2812
+ valid_epoch: components["schemas"]["EpochDateTime"];
2212
2813
  };
2213
2814
  UserIdInfo: {
2214
2815
  /**
@@ -2617,6 +3218,22 @@ export interface components {
2617
3218
  * ]
2618
3219
  */
2619
3220
  policy?: Record<string, never>[];
3221
+ /**
3222
+ * Format: int64
3223
+ * @description The organization's currently configured user-export delay, i.e., the minimum
3224
+ * amount of time (in seconds) between when a user-export is initiated and when
3225
+ * it may be completed. (This value is meaningless for organizations that use
3226
+ * org-wide export.)
3227
+ */
3228
+ user_export_delay: number;
3229
+ /**
3230
+ * Format: int64
3231
+ * @description The organization's currently configured user-export window, i.e., the amount
3232
+ * of time (in seconds) between when the user-export delay is completed and when
3233
+ * the user export request has expired and can no longer be completed. (This value
3234
+ * is meaningless for organizations that use org-wide export.)
3235
+ */
3236
+ user_export_window: number;
2620
3237
  };
2621
3238
  };
2622
3239
  };
@@ -2694,6 +3311,20 @@ export interface components {
2694
3311
  });
2695
3312
  };
2696
3313
  };
3314
+ PaginatedUserExportListResponse: {
3315
+ content: {
3316
+ "application/json": {
3317
+ export_requests: components["schemas"]["UserExportInitResponse"][];
3318
+ } & ({
3319
+ /**
3320
+ * @description If set, the content of `response` does not contain the entire result set.
3321
+ * To fetch the next page of the result set, call the same endpoint
3322
+ * but specify this value as the 'page.start' query parameter.
3323
+ */
3324
+ last_evaluated_key?: string | null;
3325
+ });
3326
+ };
3327
+ };
2697
3328
  RevokeTokenResponse: {
2698
3329
  content: {
2699
3330
  "application/json": {
@@ -2724,6 +3355,22 @@ export interface components {
2724
3355
  * @example my_role
2725
3356
  */
2726
3357
  name?: string | null;
3358
+ /**
3359
+ * @description Policy that is checked whenever a key is accessed for signing via this role.
3360
+ * @example [
3361
+ * {
3362
+ * "SourceIpAllowlist": [
3363
+ * "123.456.78.9/16"
3364
+ * ]
3365
+ * },
3366
+ * {
3367
+ * "RequireMfa": {
3368
+ * "count": 1
3369
+ * }
3370
+ * }
3371
+ * ]
3372
+ */
3373
+ policy?: Record<string, never>[];
2727
3374
  /**
2728
3375
  * @description The ID of the role
2729
3376
  * @example Role#bfe3eccb-731e-430d-b1e5-ac1363e6b06b
@@ -2854,6 +3501,48 @@ export interface components {
2854
3501
  * ]
2855
3502
  */
2856
3503
  policy?: Record<string, never>[] | null;
3504
+ /**
3505
+ * Format: int64
3506
+ * @description The new value of user-export delay
3507
+ */
3508
+ user_export_delay?: number | null;
3509
+ /**
3510
+ * Format: int64
3511
+ * @description The new value of user-export window
3512
+ */
3513
+ user_export_window?: number | null;
3514
+ };
3515
+ };
3516
+ };
3517
+ /** @description An encrypted user-export */
3518
+ UserExportCompleteResponse: {
3519
+ content: {
3520
+ "application/json": {
3521
+ /**
3522
+ * @description The exported key material, encrypted with AES-256-GCM under a key
3523
+ * derived from the public key supplied in the request via HPKE (RFC9180)
3524
+ * with DHKEM(P-256, HKDF-SHA256) and base64 encoded.
3525
+ */
3526
+ encrypted_key_material: string;
3527
+ /**
3528
+ * @description The ephemeral public key used for HPKE key derivation as base64-encoded
3529
+ * uncompressed SEC1 serialization.
3530
+ */
3531
+ ephemeral_public_key: string;
3532
+ /** @description The user-id to which this key belongs. */
3533
+ user_id: string;
3534
+ };
3535
+ };
3536
+ };
3537
+ /** @description The response to a successful user-export init request */
3538
+ UserExportInitResponse: {
3539
+ content: {
3540
+ "application/json": components["schemas"]["UserExportRequest"] & {
3541
+ /**
3542
+ * @description The key-id being requested.
3543
+ * @example Key#0x3c4d90Cc5Af1644C3A3B013Baa5488997381D7C8
3544
+ */
3545
+ key_id: string;
2857
3546
  };
2858
3547
  };
2859
3548
  };
@@ -2896,7 +3585,6 @@ export interface operations {
2896
3585
 
2897
3586
  /**
2898
3587
  * User Info
2899
- * @deprecated
2900
3588
  * @description User Info
2901
3589
  *
2902
3590
  * Retrieves information about the current user.
@@ -3856,7 +4544,7 @@ export interface operations {
3856
4544
  };
3857
4545
  };
3858
4546
  responses: {
3859
- 200: components["responses"]["EmptyImpl"];
4547
+ 200: components["responses"]["RoleInfo"];
3860
4548
  default: {
3861
4549
  content: {
3862
4550
  "application/json": components["schemas"]["ErrorResponse"];
@@ -4230,6 +4918,36 @@ export interface operations {
4230
4918
  };
4231
4919
  };
4232
4920
  };
4921
+ /**
4922
+ * Create new user session (management and/or signing)
4923
+ * @description Create new user session (management and/or signing)
4924
+ *
4925
+ * Create a new user session
4926
+ */
4927
+ createSession: {
4928
+ parameters: {
4929
+ path: {
4930
+ /**
4931
+ * @description Name or ID of the desired Org
4932
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
4933
+ */
4934
+ org_id: string;
4935
+ };
4936
+ };
4937
+ requestBody: {
4938
+ content: {
4939
+ "application/json": components["schemas"]["CreateSessionRequest"];
4940
+ };
4941
+ };
4942
+ responses: {
4943
+ 200: components["responses"]["NewSessionResponse"];
4944
+ default: {
4945
+ content: {
4946
+ "application/json": components["schemas"]["ErrorResponse"];
4947
+ };
4948
+ };
4949
+ };
4950
+ };
4233
4951
  /**
4234
4952
  * Revoke existing session(s)
4235
4953
  * @description Revoke existing session(s)
@@ -4263,6 +4981,31 @@ export interface operations {
4263
4981
  };
4264
4982
  };
4265
4983
  };
4984
+ /**
4985
+ * Revoke current session
4986
+ * @description Revoke current session
4987
+ *
4988
+ * Immediately revokes the current session, preventing it from being used or refreshed
4989
+ */
4990
+ revokeCurrentSession: {
4991
+ parameters: {
4992
+ path: {
4993
+ /**
4994
+ * @description Name or ID of the desired Org
4995
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
4996
+ */
4997
+ org_id: string;
4998
+ };
4999
+ };
5000
+ responses: {
5001
+ 200: components["responses"]["EmptyImpl"];
5002
+ default: {
5003
+ content: {
5004
+ "application/json": components["schemas"]["ErrorResponse"];
5005
+ };
5006
+ };
5007
+ };
5008
+ };
4266
5009
  /**
4267
5010
  * Get session information
4268
5011
  * @description Get session information
@@ -4412,6 +5155,171 @@ export interface operations {
4412
5155
  };
4413
5156
  };
4414
5157
  };
5158
+ /**
5159
+ * List outstanding user-export requests
5160
+ * @description List outstanding user-export requests
5161
+ */
5162
+ userExportList: {
5163
+ parameters: {
5164
+ query?: {
5165
+ /**
5166
+ * @description Max number of items to return per page.
5167
+ *
5168
+ * If the actual number of returned items may be less that this, even if there exist more
5169
+ * data in the result set. To reliably determine if more data is left in the result set,
5170
+ * inspect the [UnencryptedLastEvalKey] value in the response object.
5171
+ */
5172
+ "page.size"?: number;
5173
+ /**
5174
+ * @description The start of the page. Omit to start from the beginning; otherwise, only specify a
5175
+ * the exact value previously returned as 'last_evaluated_key' from the same endpoint.
5176
+ */
5177
+ "page.start"?: components["schemas"]["LastEvalKey"] | null;
5178
+ /**
5179
+ * @description If provided, the user-id whose user-export requests to list. Defaults to the
5180
+ * current user. Only the org owner may list requests for another user.
5181
+ * @example User#806c9544-f1fa-4bad-8d4d-1097a1844726
5182
+ */
5183
+ user_id?: string | null;
5184
+ /**
5185
+ * @description If provided, the key-id for which to list an existing user-export request.
5186
+ * @example Key#0x3c4d90Cc5Af1644C3A3B013Baa5488997381D7C8
5187
+ */
5188
+ key_id?: string | null;
5189
+ };
5190
+ path: {
5191
+ /**
5192
+ * @description Name or ID of the desired Org
5193
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
5194
+ */
5195
+ org_id: string;
5196
+ };
5197
+ };
5198
+ responses: {
5199
+ 200: components["responses"]["PaginatedUserExportListResponse"];
5200
+ default: {
5201
+ content: {
5202
+ "application/json": components["schemas"]["ErrorResponse"];
5203
+ };
5204
+ };
5205
+ };
5206
+ };
5207
+ /**
5208
+ * Initiate a user-export request
5209
+ * @description Initiate a user-export request
5210
+ *
5211
+ * This starts a delay (whose length is determined by Org-wide settings)
5212
+ * before export can be completed, and returns a ticket that can be used
5213
+ * to complete the export once the timer has expired.
5214
+ *
5215
+ * Only one user-export request can be active for a given key. If there
5216
+ * is already an active export, this endpoint will return an error. To
5217
+ * create a new request, first delete the existing one.
5218
+ */
5219
+ userExportInit: {
5220
+ parameters: {
5221
+ path: {
5222
+ /**
5223
+ * @description Name or ID of the desired Org
5224
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
5225
+ */
5226
+ org_id: string;
5227
+ };
5228
+ };
5229
+ requestBody: {
5230
+ content: {
5231
+ "application/json": components["schemas"]["UserExportInitRequest"];
5232
+ };
5233
+ };
5234
+ responses: {
5235
+ 200: components["responses"]["UserExportInitResponse"];
5236
+ 202: {
5237
+ content: {
5238
+ "application/json": components["schemas"]["AcceptedResponse"];
5239
+ };
5240
+ };
5241
+ default: {
5242
+ content: {
5243
+ "application/json": components["schemas"]["ErrorResponse"];
5244
+ };
5245
+ };
5246
+ };
5247
+ };
5248
+ /**
5249
+ * Delete an existing user-export request
5250
+ * @description Delete an existing user-export request
5251
+ */
5252
+ userExportDelete: {
5253
+ parameters: {
5254
+ query: {
5255
+ /**
5256
+ * @description The key-id whose export request should be deleted
5257
+ * @example Key#0x3c4d90Cc5Af1644C3A3B013Baa5488997381D7C8
5258
+ */
5259
+ key_id: string;
5260
+ /**
5261
+ * @description The user-id who owns this request. If omitted, defaults to the current user.
5262
+ * Only the org owner may delete user-export requests for another user.
5263
+ * @example User#806c9544-f1fa-4bad-8d4d-1097a1844726
5264
+ */
5265
+ user_id?: string | null;
5266
+ };
5267
+ path: {
5268
+ /**
5269
+ * @description Name or ID of the desired Org
5270
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
5271
+ */
5272
+ org_id: string;
5273
+ };
5274
+ };
5275
+ responses: {
5276
+ 200: components["responses"]["EmptyImpl"];
5277
+ default: {
5278
+ content: {
5279
+ "application/json": components["schemas"]["ErrorResponse"];
5280
+ };
5281
+ };
5282
+ };
5283
+ };
5284
+ /**
5285
+ * Complete a user-export request
5286
+ * @description Complete a user-export request
5287
+ *
5288
+ * This endpoint can be called only after initiating a user-export request via
5289
+ * the `user_export_init` API, and only within the subsequent export window
5290
+ * (i.e., after the export delay has passed and before the request has expired).
5291
+ *
5292
+ * To check on the status of an export request, see the `user_export_list` API.
5293
+ */
5294
+ userExportComplete: {
5295
+ parameters: {
5296
+ path: {
5297
+ /**
5298
+ * @description Name or ID of the desired Org
5299
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
5300
+ */
5301
+ org_id: string;
5302
+ };
5303
+ };
5304
+ requestBody: {
5305
+ content: {
5306
+ "application/json": components["schemas"]["UserExportCompleteRequest"];
5307
+ };
5308
+ };
5309
+ responses: {
5310
+ 200: components["responses"]["UserExportCompleteResponse"];
5311
+ 202: {
5312
+ content: {
5313
+ "application/json": components["schemas"]["AcceptedResponse"];
5314
+ };
5315
+ };
5316
+ default: {
5317
+ content: {
5318
+ "application/json": components["schemas"]["ErrorResponse"];
5319
+ };
5320
+ };
5321
+ };
5322
+ };
4415
5323
  /**
4416
5324
  * Initiate registration of a FIDO key
4417
5325
  * @description Initiate registration of a FIDO key
@@ -4499,9 +5407,9 @@ export interface operations {
4499
5407
  org_id: string;
4500
5408
  };
4501
5409
  };
4502
- requestBody: {
5410
+ requestBody?: {
4503
5411
  content: {
4504
- "application/json": components["schemas"]["Empty"];
5412
+ "application/json": components["schemas"]["TotpResetRequest"] | null;
4505
5413
  };
4506
5414
  };
4507
5415
  responses: {
@@ -4722,9 +5630,9 @@ export interface operations {
4722
5630
  * otherwise, MFA is required.
4723
5631
  */
4724
5632
  resetTotpInitLegacy: {
4725
- requestBody: {
5633
+ requestBody?: {
4726
5634
  content: {
4727
- "application/json": components["schemas"]["Empty"];
5635
+ "application/json": components["schemas"]["TotpResetRequest"] | null;
4728
5636
  };
4729
5637
  };
4730
5638
  responses: {