mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
aws fix base
This commit is contained in:
parent
f3c4fed98e
commit
225f411abc
1 changed files with 7 additions and 4 deletions
|
|
@ -14,15 +14,16 @@ from datetime import datetime, timedelta, timezone
|
|||
from typing import Any, Dict
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from botocore.awsrequest import AWSPreparedRequest, AWSRequest
|
||||
from botocore.credentials import Credentials
|
||||
from botocore.awsrequest import AWSRequest, AWSPreparedRequest
|
||||
|
||||
import litellm
|
||||
from litellm.caching.caching import DualCache
|
||||
from litellm.llms.bedrock.base_aws_llm import (
|
||||
AwsAuthError,
|
||||
BaseAWSLLM,
|
||||
Boto3CredentialsInfo,
|
||||
)
|
||||
from litellm.caching.caching import DualCache
|
||||
|
||||
# Global variable for the base_aws_llm.py file path
|
||||
|
||||
|
|
@ -582,7 +583,7 @@ def test_eks_irsa_ambient_credentials_used():
|
|||
)
|
||||
|
||||
# Should create STS client without explicit credentials (using ambient credentials)
|
||||
mock_boto3_client.assert_called_once_with("sts")
|
||||
mock_boto3_client.assert_called_once_with("sts", verify=True)
|
||||
|
||||
# Should call assume_role
|
||||
mock_sts_client.assume_role.assert_called_once_with(
|
||||
|
|
@ -642,6 +643,7 @@ def test_explicit_credentials_used_when_provided():
|
|||
aws_access_key_id="explicit-access-key",
|
||||
aws_secret_access_key="explicit-secret-key",
|
||||
aws_session_token="assumed-session-token",
|
||||
verify=True,
|
||||
)
|
||||
|
||||
# Should call assume_role
|
||||
|
|
@ -701,6 +703,7 @@ def test_partial_credentials_still_use_ambient():
|
|||
aws_access_key_id="AKIAEXAMPLE",
|
||||
aws_secret_access_key=None,
|
||||
aws_session_token=None,
|
||||
verify=True,
|
||||
)
|
||||
|
||||
# Should still call assume_role
|
||||
|
|
@ -748,7 +751,7 @@ def test_cross_account_role_assumption():
|
|||
)
|
||||
|
||||
# Should use ambient credentials
|
||||
mock_boto3_client.assert_called_once_with("sts")
|
||||
mock_boto3_client.assert_called_once_with("sts", verify=True)
|
||||
|
||||
# Should call assume_role with cross-account role
|
||||
mock_sts_client.assume_role.assert_called_once_with(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue