diff --git a/litellm/llms/sap/credentials.py b/litellm/llms/sap/credentials.py index fc2a456c2ff..989d8fac1c0 100644 --- a/litellm/llms/sap/credentials.py +++ b/litellm/llms/sap/credentials.py @@ -167,13 +167,10 @@ def init_conf(profile: Optional[str] = None) -> Dict[str, Any]: def _env_name(name: str) -> str: return f"AICORE_{name.upper()}" -def extract_credentials(source: Source, exclude: Optional[List[str]] = None) -> Dict[str, str]: +def extract_credentials(source: Source) -> Dict[str, str]: """Extract all credentials from a source.""" - exclude = exclude or [] credentials = {} for cv in CREDENTIAL_VALUES: - if cv.name in exclude: - continue value = source.get(cv) if value is not None: credentials[cv.name] = cv.transform_fn(value) if cv.transform_fn else value diff --git a/tests/test_litellm/llms/sap/test_sap_fetch_creds.py b/tests/test_litellm/llms/sap/test_sap_fetch_creds.py index 572eecdb5d8..4d22ca98485 100644 --- a/tests/test_litellm/llms/sap/test_sap_fetch_creds.py +++ b/tests/test_litellm/llms/sap/test_sap_fetch_creds.py @@ -32,10 +32,11 @@ mock_sap_vcap_service_key_dict = { }] } def _prep_env(monkeypatch): - for var in ("AICORE_CLIENT_ID", "AICORE_CLIENT_SECRET", "AICORE_AUTH_URL", + for var in ("AICORE_CLIENT_ID", "AICORE_CLIENT_SECRET", "AICORE_AUTH_URL", "AICORE_RESOURCE_GROUP", "AICORE_BASE_URL", "AICORE_CERT_URL", "AICORE_SERVICE_KEY", "VCAP_SERVICES"): monkeypatch.delenv(var, raising=False) monkeypatch.setenv("AICORE_HOME", 'notexist') + monkeypatch.setattr('litellm.sap_service_key', None) def test_sap_fetch_creds_from_env_service_key(monkeypatch): _prep_env(monkeypatch)