canton-api-client 3.6.0-0.1.0

Canton Ledger API rust client
Documentation
/*
 * JSON Ledger API HTTP endpoints
 *
 * This specification version fixes the API inconsistencies where certain fields marked as required in the spec are in fact optional. If you use code generation tool based on this file, you might need to adjust the existing application code to handle those fields as optional. If you do not want to change your client code, continue using the OpenAPI specification for the latest Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.6.0
 *
 * The version of the OpenAPI document: 3.6.0-SNAPSHOT
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IdentityProviderConfig {
    /// The identity provider identifier Must be a valid LedgerString (as describe in ``value.proto``).  Required
    #[serde(rename = "identityProviderId")]
    pub identity_provider_id: String,
    /// When set, the callers using JWT tokens issued by this identity provider are denied all access to the Ledger API. Modifiable  Optional
    #[serde(rename = "isDeactivated", skip_serializing_if = "Option::is_none")]
    pub is_deactivated: Option<bool>,
    /// Specifies the issuer of the JWT token. The issuer value is a case sensitive URL using the https scheme that contains scheme, host, and optionally, port number and path components and no query or fragment components. Modifiable  Can be left empty when used in `UpdateIdentityProviderConfigRequest` if the issuer is not being updated.  Required
    #[serde(rename = "issuer")]
    pub issuer: String,
    /// The JWKS (JSON Web Key Set) URL. The Ledger API uses JWKs (JSON Web Keys) from the provided URL to verify that the JWT has been signed with the loaded JWK. Only RS256 (RSA Signature with SHA-256) signing algorithm is supported. Modifiable  Required
    #[serde(rename = "jwksUrl")]
    pub jwks_url: String,
    /// Specifies the audience of the JWT token. When set, the callers using JWT tokens issued by this identity provider are allowed to get an access only if the \"aud\" claim includes the string specified here Modifiable  Optional
    #[serde(rename = "audience", skip_serializing_if = "Option::is_none")]
    pub audience: Option<String>,
}

impl IdentityProviderConfig {
    pub fn new(identity_provider_id: String, issuer: String, jwks_url: String) -> IdentityProviderConfig {
        IdentityProviderConfig {
            identity_provider_id,
            is_deactivated: None,
            issuer,
            jwks_url,
            audience: None,
        }
    }
}