mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
fix(credentials): include decryption helper required by Copilot backport
Backport the helper rename and endpoint import from #47341, 6c4c134f23. Keep the release line decryption and WIF behavior. This is a partial prerequisite, not the OIDC reference feature.
This commit is contained in:
parent
d39d29734c
commit
f17220bb08
2 changed files with 4 additions and 3 deletions
|
|
@ -68,7 +68,7 @@ def decrypted_or_stored(key: str, value: str) -> str:
|
|||
return value if decrypted is None else decrypted
|
||||
|
||||
|
||||
def _decrypted(db_credential: CredentialItem) -> CredentialItem:
|
||||
def decrypted_credential(db_credential: CredentialItem) -> CredentialItem:
|
||||
"""The stored credential with every value decrypted, leaving already-plaintext values alone."""
|
||||
decrypted_values: Final = MappingProxyType(
|
||||
{
|
||||
|
|
@ -99,7 +99,7 @@ async def hydrate_named_credential_authoritative(
|
|||
db_credential: Final = await CredentialsRepository(prisma_client).find_by_name(credential_name)
|
||||
if db_credential is None:
|
||||
return await hydrate_named_credential(credential_name, prisma_client)
|
||||
return _decrypted(db_credential)
|
||||
return decrypted_credential(db_credential)
|
||||
|
||||
|
||||
async def hydrate_named_credential(
|
||||
|
|
@ -114,7 +114,7 @@ async def hydrate_named_credential(
|
|||
db_credential: Final = await CredentialsRepository(prisma_client).find_by_name(credential_name)
|
||||
if db_credential is None:
|
||||
return None
|
||||
return _decrypted(db_credential)
|
||||
return decrypted_credential(db_credential)
|
||||
|
||||
|
||||
async def named_credential_wif_fields(
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ from litellm.proxy._types import (
|
|||
)
|
||||
from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
|
||||
from litellm.proxy.common_utils.credential_hydration import (
|
||||
decrypted_credential,
|
||||
hydrate_named_credential_authoritative,
|
||||
named_credential_wif_fields,
|
||||
stored_credential_provider,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue