Ë
    uPêji  ã                   óV   — d Z ddlmZ ddlmZ ddlmZ  G d„ dej                  «      Zy)a  
Custom AWS Security Credentials Supplier for Vertex AI WIF.

Wraps boto3/botocore credentials so that google-auth can use them
for the AWS-to-GCP Workload Identity Federation token exchange
without hitting the EC2 instance metadata service.

Requires google-auth >= 2.29.0.
é    )ÚCallable)ÚFinal)Úawsc                   ó,   — e Zd ZdZdedefd„Zd„ Zd„ Zy)ÚAwsCredentialsSupplieraÊ  
    Supplies AWS credentials to google-auth's aws.Credentials for WIF
    token exchange.

    This bypasses the default metadata-based credential retrieval,
    allowing WIF to work in environments where EC2 metadata is blocked.

    Accepts a credentials_provider callable that is invoked on every
    get_aws_security_credentials() call, so that refreshed/rotated
    credentials are picked up automatically (important for temporary
    STS tokens).
    Úcredentials_providerÚ
aws_regionc                 ó    — || _         || _        y)a  
        Args:
            credentials_provider: A zero-arg callable that returns a
                botocore.credentials.Credentials object (with access_key,
                secret_key, and token attributes).
            aws_region: The AWS region string (e.g. "us-east-1").
        N)Ú_credentials_providerÚ_region)Úselfr   r	   s      út/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai/aws_credentials_supplier.pyÚ__init__zAwsCredentialsSupplier.__init__   s   € ð &:ˆÔ"Ø!ˆ�ó    c                 óŽ   — | j                  «       }t        j                  |j                  |j                  |j
                  ¬«      S )z:Return current AWS credentials for the GCP token exchange.)Úaccess_key_idÚsecret_access_keyÚsession_token)r   r   ÚAwsSecurityCredentialsÚ
access_keyÚ
secret_keyÚtoken)r   ÚcontextÚrequestÚcurrents       r   Úget_aws_security_credentialsz3AwsCredentialsSupplier.get_aws_security_credentials*   s<   € à×3Ñ3Ó5ˆÜ×)Ñ)Ø!×,Ñ,Ø%×0Ñ0Ø!Ÿ-™-ô
ð 	
r   c                 ó   — | j                   S )z2Return the AWS region for credential verification.)r   )r   r   r   s      r   Úget_aws_regionz%AwsCredentialsSupplier.get_aws_region3   s   € à�|‰|Ðr   N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ústrr   r   r   © r   r   r   r      s$   „ ñð	"¨Xð 	"À3ó 	"ò
ór   r   N)	r"   Úcollections.abcr   Útypingr   Úgoogle.authr   ÚAwsSecurityCredentialsSupplierr   r$   r   r   ú<module>r)      s'   ðñõ %Ý å ô$˜S×?Ñ?õ $r   