pub enum AzureCredentials {
ServicePrincipal {
client_id: String,
client_secret: String,
},
AccessToken {
token: String,
},
ScopedAccessTokens {
tokens: HashMap<String, String>,
},
VmManagedIdentity {
client_id: String,
identity_endpoint: Option<String>,
},
WorkloadIdentity {
authority_host: String,
client_id: String,
federated_token_file: String,
tenant_id: String,
},
ManagedIdentity {
client_id: String,
identity_endpoint: String,
identity_header: String,
},
}Expand description
Represents Azure authentication credentials
JSON schema
{
"description": "Represents Azure authentication credentials",
"oneOf": [
{
"description": "Service principal with client secret",
"type": "object",
"required": [
"client_id",
"client_secret",
"type"
],
"properties": {
"client_id": {
"description": "The client ID (application ID)",
"type": "string"
},
"client_secret": {
"description": "The client secret",
"type": "string"
},
"type": {
"type": "string",
"enum": [
"servicePrincipal"
]
}
}
},
{
"description": "Direct access token",
"type": "object",
"required": [
"token",
"type"
],
"properties": {
"token": {
"description": "The bearer token to use for authentication",
"type": "string"
},
"type": {
"type": "string",
"enum": [
"accessToken"
]
}
}
},
{
"description": "Short-lived bearer tokens keyed by their exact Azure OAuth scope.\n\nThis is the only Azure credential form returned by the credential mint\nendpoint. It contains no refreshable source credential and must not be\nused for a scope that is absent from the map.",
"type": "object",
"required": [
"tokens",
"type"
],
"properties": {
"tokens": {
"description": "Exact scope-to-token map. Minted configs include only the Azure\nmanagement, storage, Key Vault, and Service Bus scopes used by\nAlien bindings.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"type": {
"type": "string",
"enum": [
"scopedAccessTokens"
]
}
}
},
{
"description": "Azure VM IMDS managed identity.",
"type": "object",
"required": [
"client_id",
"type"
],
"properties": {
"client_id": {
"description": "The client ID of the user-assigned managed identity",
"type": "string"
},
"identity_endpoint": {
"description": "Optional IMDS endpoint override",
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
"enum": [
"vmManagedIdentity"
]
}
}
},
{
"description": "Azure AD Workload Identity (federated identity)",
"type": "object",
"required": [
"authority_host",
"client_id",
"federated_token_file",
"tenant_id",
"type"
],
"properties": {
"authority_host": {
"description": "The authority host URL",
"type": "string"
},
"client_id": {
"description": "The client ID of the managed identity or application",
"type": "string"
},
"federated_token_file": {
"description": "Path to the federated token file",
"type": "string"
},
"tenant_id": {
"description": "The tenant ID for authentication",
"type": "string"
},
"type": {
"type": "string",
"enum": [
"workloadIdentity"
]
}
}
},
{
"description": "Azure Managed Identity (Container Apps / App Service)\nUses IDENTITY_ENDPOINT + IDENTITY_HEADER injected by the platform",
"type": "object",
"required": [
"client_id",
"identity_endpoint",
"identity_header",
"type"
],
"properties": {
"client_id": {
"description": "The client ID of the user-assigned managed identity",
"type": "string"
},
"identity_endpoint": {
"description": "The identity endpoint URL (from IDENTITY_ENDPOINT env var)",
"type": "string"
},
"identity_header": {
"description": "The identity header secret (from IDENTITY_HEADER env var)",
"type": "string"
},
"type": {
"type": "string",
"enum": [
"managedIdentity"
]
}
}
}
]
}Variants§
ServicePrincipal
Service principal with client secret
AccessToken
Direct access token
ScopedAccessTokens
Short-lived bearer tokens keyed by their exact Azure OAuth scope.
This is the only Azure credential form returned by the credential mint endpoint. It contains no refreshable source credential and must not be used for a scope that is absent from the map.
Fields
VmManagedIdentity
Azure VM IMDS managed identity.
Fields
WorkloadIdentity
Azure AD Workload Identity (federated identity)
Fields
The authority host URL
ManagedIdentity
Azure Managed Identity (Container Apps / App Service) Uses IDENTITY_ENDPOINT + IDENTITY_HEADER injected by the platform
Trait Implementations§
Source§impl Clone for AzureCredentials
impl Clone for AzureCredentials
Source§fn clone(&self) -> AzureCredentials
fn clone(&self) -> AzureCredentials
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AzureCredentials
impl Debug for AzureCredentials
Source§impl<'de> Deserialize<'de> for AzureCredentials
impl<'de> Deserialize<'de> for AzureCredentials
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&AzureCredentials> for AzureCredentials
impl From<&AzureCredentials> for AzureCredentials
Source§fn from(value: &AzureCredentials) -> Self
fn from(value: &AzureCredentials) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AzureCredentials
impl RefUnwindSafe for AzureCredentials
impl Send for AzureCredentials
impl Sync for AzureCredentials
impl Unpin for AzureCredentials
impl UnsafeUnpin for AzureCredentials
impl UnwindSafe for AzureCredentials
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more