Skip to main content

oci_rust_sdk/auth/
provider.rs

1use std::sync::Arc;
2
3/// Authentication provider trait for OCI SDK
4///
5/// Implementations of this trait provide the necessary credentials
6/// to sign HTTP requests to OCI services.
7pub trait AuthProvider: Send + Sync {
8    /// Get the key ID (e.g., "ocid1.tenancy.oc1..xxxxx/ocid1.user.oc1..xxxxx/fingerprint")
9    fn get_key_id(&self) -> String;
10
11    /// Get the private key in PEM format
12    fn get_private_key(&self) -> &str;
13
14    /// Get the passphrase for the private key (if any)
15    fn get_passphrase(&self) -> Option<&str>;
16}
17
18/// Type alias for Arc-wrapped AuthProvider
19pub type AuthProviderRef = Arc<dyn AuthProvider>;