Skip to main content

ServiceAccount

Trait ServiceAccount 

Source
pub trait ServiceAccount: Binding {
    // Required methods
    fn get_info<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ServiceAccountInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn impersonate<'life0, 'async_trait>(
        &'life0 self,
        request: ImpersonationRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ClientConfig>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn as_any(&self) -> &dyn Any;
}
Expand description

A service account binding that provides identity and impersonation capabilities.

Required Methods§

Source

fn get_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ServiceAccountInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets information about the service account

Source

fn impersonate<'life0, 'async_trait>( &'life0 self, request: ImpersonationRequest, ) -> Pin<Box<dyn Future<Output = Result<ClientConfig>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Impersonates the service account and returns credentials as a ClientConfig.

This performs the cloud-specific impersonation:

  • AWS: STS AssumeRole to get temporary credentials
  • GCP: IAM Credentials API generateAccessToken
  • Azure: Uses the attached managed identity (no API call needed)
Source

fn as_any(&self) -> &dyn Any

Helper for downcasting trait object

Implementors§