Persist provider and auth identity with model catalog caches (#43897)

## What changed

Add a SHA-256 identity derived from provider routing, headers, and authentication scope. Return it with each model catalog response and persist it in `ModelsCacheEntry`. ChatGPT credentials with stable account and user metadata retain the same identity across token refreshes; opaque API credentials contribute to the digest.

## Testing

Add identity tests covering account, user, email, plan, auth mode, provider routing, headers, and API credential changes, plus stability across ChatGPT token refreshes. Update cache tests to include the persisted identity.

GitOrigin-RevId: 3f51c6cabcb01bc03505150a768a61dfe5d6569f
This commit is contained in:
Ahmed Ibrahim authored and copyberry committed 2026-09-08 19:48:37 +00:00
1 parent 94e4b3d0bd
commit f31bd3adff
11 files changed
+278 -18

No files matched your search

+1
View File
@@ -2,6 +2,7 @@ mod amazon_bedrock;
mod auth;
mod bearer_auth_provider;
mod models_endpoint;
mod models_identity;
mod provider;
mod shared_state;