fix(anthropic/wif): treat empty identity-source fields as unset

This commit is contained in:
Cursor Agent 2026-09-05 05:33:15 +00:00
parent 216da96882
commit 2cd0c2ce9f
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -160,7 +160,7 @@ def _resolve_identity_source(
legacy_ref: Final = _resolve_assertion_ref(litellm_params)
return (legacy_ref, None) if legacy_ref is not None else None
params: Final[Mapping[str, object]] = MappingProxyType(
{key: value for key, value in (litellm_params or _EMPTY_PARAMS).items() if value is not None}
{key: value for key, value in (litellm_params or _EMPTY_PARAMS).items() if value not in (None, "")}
)
match source_kind:
case AnthropicIdentitySourceKind.internal_issuer.value:

View file

@ -38,7 +38,7 @@ def _claims(config: InternalIssuerSource, issued_at: int) -> Mapping[str, object
("exp", issued_at + config.ttl_seconds),
("jti", str(uuid.uuid4())),
)
if value is not None
if value not in (None, "")
}
)