fireblocks_sdk/models/
create_api_user.rs

1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10    crate::models,
11    serde::{Deserialize, Serialize},
12};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CreateApiUser {
16    #[serde(rename = "role")]
17    pub role: models::ApiUserRole,
18    /// User Name
19    #[serde(rename = "name")]
20    pub name: String,
21    /// API requests are authenticated by providing in each request:   a. API Key in the `X-API-Key` header   b. Auth header - `Authorization: Bearer <JWT>` while the JWT is signed with an RSA 4096 private key.  When creating a new API Key, you need to generate an RSA 4096 private key and a CSR file.  The CSR file is uploaded to Fireblocks upon the user creation and used later on for signature validation (Auth JWT signature validation).  For more info read the following [article](https://developers.fireblocks.com/docs/manage-api-keys)
22    #[serde(rename = "csrPem")]
23    pub csr_pem: String,
24    /// Required for Signer/Admin API users that planned to be paired with an API Co-Signer Machine.  - SGX_MACHINE: For SGX enabled servers - FIREBLOCKS_CCMT: Fireblocks Communal Co-Signer (for Testnet workspaces only) - NITRO_MACHINE: For AWS Nitro Enclave enabled servers  For more information about Fireblocks Co-Signer setup please read the following [article](https://support.fireblocks.io/hc/en-us/articles/12006018592156-API-Co-Signer-Overview).
25    #[serde(rename = "coSignerSetupType", skip_serializing_if = "Option::is_none")]
26    pub co_signer_setup_type: Option<CoSignerSetupType>,
27    /// Pass as `true`` if this is the first user on the your Co-Signer machine
28    #[serde(
29        rename = "coSignerSetupIsFirstUser",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub co_signer_setup_is_first_user: Option<bool>,
33}
34
35impl CreateApiUser {
36    pub fn new(role: models::ApiUserRole, name: String, csr_pem: String) -> CreateApiUser {
37        CreateApiUser {
38            role,
39            name,
40            csr_pem,
41            co_signer_setup_type: None,
42            co_signer_setup_is_first_user: None,
43        }
44    }
45}
46/// Required for Signer/Admin API users that planned to be paired with an API Co-Signer Machine.  - SGX_MACHINE: For SGX enabled servers - FIREBLOCKS_CCMT: Fireblocks Communal Co-Signer (for Testnet workspaces only) - NITRO_MACHINE: For AWS Nitro Enclave enabled servers  For more information about Fireblocks Co-Signer setup please read the following [article](https://support.fireblocks.io/hc/en-us/articles/12006018592156-API-Co-Signer-Overview).
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum CoSignerSetupType {
49    #[serde(rename = "SGX_MACHINE")]
50    SgxMachine,
51    #[serde(rename = "FIREBLOCKS_CCMT")]
52    FireblocksCcmt,
53    #[serde(rename = "NITRO_MACHINE")]
54    NitroMachine,
55}
56
57impl Default for CoSignerSetupType {
58    fn default() -> CoSignerSetupType {
59        Self::SgxMachine
60    }
61}