@cubist-labs/cubesigner-sdk 0.2.2 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +68 -0
- package/dist/src/api.d.ts +493 -0
- package/dist/src/api.js +1166 -0
- package/dist/src/client.d.ts +432 -335
- package/dist/src/client.js +195 -863
- package/dist/src/ethers/index.d.ts +33 -6
- package/dist/src/ethers/index.js +59 -12
- package/dist/src/index.d.ts +31 -26
- package/dist/src/index.js +51 -32
- package/dist/src/key.d.ts +28 -21
- package/dist/src/key.js +17 -10
- package/dist/src/mfa.d.ts +7 -7
- package/dist/src/mfa.js +20 -32
- package/dist/src/org.d.ts +37 -279
- package/dist/src/org.js +48 -194
- package/dist/src/paginator.js +1 -1
- package/dist/src/response.d.ts +101 -0
- package/dist/src/response.js +164 -0
- package/dist/src/role.d.ts +11 -9
- package/dist/src/role.js +1 -1
- package/dist/src/schema.d.ts +586 -10
- package/dist/src/schema.js +1 -1
- package/dist/src/schema_types.d.ts +6 -0
- package/dist/src/schema_types.js +1 -1
- package/dist/src/session/cognito_manager.d.ts +15 -3
- package/dist/src/session/cognito_manager.js +23 -5
- package/dist/src/session/session_manager.d.ts +1 -1
- package/dist/src/session/session_manager.js +3 -11
- package/dist/src/session/session_storage.js +1 -1
- package/dist/src/session/signer_session_manager.d.ts +3 -7
- package/dist/src/session/signer_session_manager.js +2 -8
- package/dist/src/signer_session.d.ts +8 -266
- package/dist/src/signer_session.js +15 -221
- package/dist/src/user_export.d.ts +52 -0
- package/dist/src/user_export.js +129 -0
- package/dist/src/util.d.ts +15 -0
- package/dist/src/util.js +33 -11
- package/package.json +12 -10
- package/src/api.ts +1395 -0
- package/src/client.ts +216 -1025
- package/src/ethers/index.ts +70 -12
- package/src/index.ts +59 -43
- package/src/key.ts +19 -12
- package/src/mfa.ts +16 -28
- package/src/org.ts +49 -204
- package/src/response.ts +196 -0
- package/src/role.ts +5 -3
- package/src/schema.ts +586 -10
- package/src/schema_types.ts +7 -0
- package/src/session/cognito_manager.ts +33 -6
- package/src/session/session_manager.ts +2 -8
- package/src/session/signer_session_manager.ts +3 -10
- package/src/signer_session.ts +13 -261
- package/src/user_export.ts +116 -0
- package/src/util.ts +29 -10
package/src/schema.ts
CHANGED
|
@@ -385,6 +385,13 @@ export interface paths {
|
|
|
385
385
|
* If no query parameters are provided, information for the current session is returned
|
|
386
386
|
*/
|
|
387
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"];
|
|
388
395
|
/**
|
|
389
396
|
* Revoke existing session(s)
|
|
390
397
|
* @description Revoke existing session(s)
|
|
@@ -445,6 +452,42 @@ export interface paths {
|
|
|
445
452
|
*/
|
|
446
453
|
get: operations["aboutMe"];
|
|
447
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
|
+
};
|
|
448
491
|
"/v0/org/{org_id}/user/me/fido": {
|
|
449
492
|
/**
|
|
450
493
|
* Initiate registration of a FIDO key
|
|
@@ -1020,6 +1063,20 @@ export interface components {
|
|
|
1020
1063
|
*/
|
|
1021
1064
|
role_id: string;
|
|
1022
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
|
+
};
|
|
1023
1080
|
CreateTokenRequest: components["schemas"]["RatchetConfig"] & ({
|
|
1024
1081
|
/**
|
|
1025
1082
|
* @description A human readable description of the purpose of the key
|
|
@@ -1507,6 +1564,101 @@ export interface components {
|
|
|
1507
1564
|
*/
|
|
1508
1565
|
skip_email: boolean;
|
|
1509
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
|
+
};
|
|
1510
1662
|
/** @description Derivation-related metadata for keys derived from a long-lived mnemonic */
|
|
1511
1663
|
KeyDerivationInfo: {
|
|
1512
1664
|
/** @description The derivation path used to derive this key */
|
|
@@ -1682,6 +1834,8 @@ export interface components {
|
|
|
1682
1834
|
sub: string;
|
|
1683
1835
|
};
|
|
1684
1836
|
OidcLoginRequest: {
|
|
1837
|
+
/** @description A human readable description of the purpose of the session */
|
|
1838
|
+
purpose?: string | null;
|
|
1685
1839
|
/**
|
|
1686
1840
|
* @description Controls what capabilities this session will have.
|
|
1687
1841
|
* @example [
|
|
@@ -1731,6 +1885,22 @@ export interface components {
|
|
|
1731
1885
|
* ]
|
|
1732
1886
|
*/
|
|
1733
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;
|
|
1734
1904
|
};
|
|
1735
1905
|
/**
|
|
1736
1906
|
* @description The rocket query parameter representing the page from which to start a paginated query.
|
|
@@ -1827,6 +1997,20 @@ export interface components {
|
|
|
1827
1997
|
*/
|
|
1828
1998
|
last_evaluated_key?: string | null;
|
|
1829
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
|
+
});
|
|
1830
2014
|
/**
|
|
1831
2015
|
* @description This type represents a wire-encodable form of the PublicKeyCredential interface
|
|
1832
2016
|
* Clients may need to manually encode into this format to communicate with the server
|
|
@@ -1871,7 +2055,7 @@ export interface components {
|
|
|
1871
2055
|
*/
|
|
1872
2056
|
PublicKeyCredentialCreationOptions: {
|
|
1873
2057
|
attestation?: components["schemas"]["AttestationConveyancePreference"];
|
|
1874
|
-
|
|
2058
|
+
authenticatorSelection?: components["schemas"]["AuthenticatorSelectionCriteria"] | null;
|
|
1875
2059
|
/**
|
|
1876
2060
|
* @description This member contains a challenge intended to be used for generating the
|
|
1877
2061
|
* newly created credential’s attestation object. See the § 13.4.3
|
|
@@ -1889,7 +2073,7 @@ export interface components {
|
|
|
1889
2073
|
*
|
|
1890
2074
|
* https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialcreationoptions-excludecredentials
|
|
1891
2075
|
*/
|
|
1892
|
-
|
|
2076
|
+
excludeCredentials?: components["schemas"]["PublicKeyCredentialDescriptor"][];
|
|
1893
2077
|
/**
|
|
1894
2078
|
* @description This member contains additional parameters requesting additional
|
|
1895
2079
|
* processing by the client and authenticator. For example, the caller may
|
|
@@ -1911,7 +2095,7 @@ export interface components {
|
|
|
1911
2095
|
*
|
|
1912
2096
|
* https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialcreationoptions-pubkeycredparams
|
|
1913
2097
|
*/
|
|
1914
|
-
|
|
2098
|
+
pubKeyCredParams: components["schemas"]["PublicKeyCredentialParameters"][];
|
|
1915
2099
|
rp: components["schemas"]["PublicKeyCredentialRpEntity"];
|
|
1916
2100
|
/**
|
|
1917
2101
|
* Format: int32
|
|
@@ -1987,7 +2171,7 @@ export interface components {
|
|
|
1987
2171
|
*
|
|
1988
2172
|
* https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrequestoptions-allowcredentials
|
|
1989
2173
|
*/
|
|
1990
|
-
|
|
2174
|
+
allowCredentials?: components["schemas"]["PublicKeyCredentialDescriptor"][];
|
|
1991
2175
|
/**
|
|
1992
2176
|
* @description This member represents a challenge that the selected authenticator
|
|
1993
2177
|
* signs, along with other data, when producing an authentication
|
|
@@ -2004,7 +2188,7 @@ export interface components {
|
|
|
2004
2188
|
*
|
|
2005
2189
|
* https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrequestoptions-rpid
|
|
2006
2190
|
*/
|
|
2007
|
-
|
|
2191
|
+
rpId?: string | null;
|
|
2008
2192
|
/**
|
|
2009
2193
|
* Format: int32
|
|
2010
2194
|
* @description This OPTIONAL member specifies a time, in milliseconds, that the caller
|
|
@@ -2014,7 +2198,7 @@ export interface components {
|
|
|
2014
2198
|
* https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrequestoptions-timeout
|
|
2015
2199
|
*/
|
|
2016
2200
|
timeout?: number | null;
|
|
2017
|
-
|
|
2201
|
+
userVerification?: components["schemas"]["UserVerificationRequirement"];
|
|
2018
2202
|
};
|
|
2019
2203
|
/**
|
|
2020
2204
|
* @description The PublicKeyCredentialRpEntity dictionary is used to supply additional
|
|
@@ -2339,6 +2523,11 @@ export interface components {
|
|
|
2339
2523
|
*/
|
|
2340
2524
|
totp_url: string;
|
|
2341
2525
|
};
|
|
2526
|
+
/** @description Request to reset TOTP. */
|
|
2527
|
+
TotpResetRequest: {
|
|
2528
|
+
/** @description The name of the issuer; defaults to "Cubist". */
|
|
2529
|
+
issuer?: string | null;
|
|
2530
|
+
};
|
|
2342
2531
|
/** @description Options that should be set only for local devnet testing. */
|
|
2343
2532
|
UnsafeConf: {
|
|
2344
2533
|
/**
|
|
@@ -2454,6 +2643,23 @@ export interface components {
|
|
|
2454
2643
|
* ]
|
|
2455
2644
|
*/
|
|
2456
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;
|
|
2457
2663
|
};
|
|
2458
2664
|
UpdateOrgResponse: {
|
|
2459
2665
|
/** @description The new value of the 'enabled' property */
|
|
@@ -2482,6 +2688,16 @@ export interface components {
|
|
|
2482
2688
|
* ]
|
|
2483
2689
|
*/
|
|
2484
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;
|
|
2485
2701
|
};
|
|
2486
2702
|
UpdateRoleRequest: {
|
|
2487
2703
|
/**
|
|
@@ -2502,6 +2718,99 @@ export interface components {
|
|
|
2502
2718
|
*/
|
|
2503
2719
|
policy?: Record<string, never>[] | null;
|
|
2504
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;
|
|
2752
|
+
};
|
|
2753
|
+
/** @description A request to initiate a user export */
|
|
2754
|
+
UserExportInitRequest: {
|
|
2755
|
+
/**
|
|
2756
|
+
* @description The id of the key to be exported. This key must be owned by the caller.
|
|
2757
|
+
* @example Key#0x3c4d90Cc5Af1644C3A3B013Baa5488997381D7C8
|
|
2758
|
+
*/
|
|
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"];
|
|
2813
|
+
};
|
|
2505
2814
|
UserIdInfo: {
|
|
2506
2815
|
/**
|
|
2507
2816
|
* @description The user's email
|
|
@@ -2909,6 +3218,22 @@ export interface components {
|
|
|
2909
3218
|
* ]
|
|
2910
3219
|
*/
|
|
2911
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;
|
|
2912
3237
|
};
|
|
2913
3238
|
};
|
|
2914
3239
|
};
|
|
@@ -2986,6 +3311,20 @@ export interface components {
|
|
|
2986
3311
|
});
|
|
2987
3312
|
};
|
|
2988
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
|
+
};
|
|
2989
3328
|
RevokeTokenResponse: {
|
|
2990
3329
|
content: {
|
|
2991
3330
|
"application/json": {
|
|
@@ -3162,6 +3501,48 @@ export interface components {
|
|
|
3162
3501
|
* ]
|
|
3163
3502
|
*/
|
|
3164
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;
|
|
3165
3546
|
};
|
|
3166
3547
|
};
|
|
3167
3548
|
};
|
|
@@ -4537,6 +4918,36 @@ export interface operations {
|
|
|
4537
4918
|
};
|
|
4538
4919
|
};
|
|
4539
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
|
+
};
|
|
4540
4951
|
/**
|
|
4541
4952
|
* Revoke existing session(s)
|
|
4542
4953
|
* @description Revoke existing session(s)
|
|
@@ -4744,6 +5155,171 @@ export interface operations {
|
|
|
4744
5155
|
};
|
|
4745
5156
|
};
|
|
4746
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
|
+
};
|
|
4747
5323
|
/**
|
|
4748
5324
|
* Initiate registration of a FIDO key
|
|
4749
5325
|
* @description Initiate registration of a FIDO key
|
|
@@ -4831,9 +5407,9 @@ export interface operations {
|
|
|
4831
5407
|
org_id: string;
|
|
4832
5408
|
};
|
|
4833
5409
|
};
|
|
4834
|
-
requestBody
|
|
5410
|
+
requestBody?: {
|
|
4835
5411
|
content: {
|
|
4836
|
-
"application/json": components["schemas"]["
|
|
5412
|
+
"application/json": components["schemas"]["TotpResetRequest"] | null;
|
|
4837
5413
|
};
|
|
4838
5414
|
};
|
|
4839
5415
|
responses: {
|
|
@@ -5054,9 +5630,9 @@ export interface operations {
|
|
|
5054
5630
|
* otherwise, MFA is required.
|
|
5055
5631
|
*/
|
|
5056
5632
|
resetTotpInitLegacy: {
|
|
5057
|
-
requestBody
|
|
5633
|
+
requestBody?: {
|
|
5058
5634
|
content: {
|
|
5059
|
-
"application/json": components["schemas"]["
|
|
5635
|
+
"application/json": components["schemas"]["TotpResetRequest"] | null;
|
|
5060
5636
|
};
|
|
5061
5637
|
};
|
|
5062
5638
|
responses: {
|