[internal copy of #28269] Codex cli jwt team alias - #28621
Conversation
Greptile SummaryThis PR adds an optional
Confidence Score: 5/5Safe to merge — adds read-only metadata to the CLI JWT without touching auth checks or token expiry. The change is additive and optional: No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/proxy/auth/auth_checks.py | Adds optional team_alias parameter to get_cli_jwt_auth_token() and threads it into the UserAPIKeyAuth payload; no logic changes to auth or expiry. |
| litellm/proxy/management_endpoints/ui_sso.py | Derives team_alias from cached team_details by matching team_id, then passes it to JWT generation; gracefully falls back to None when details are absent. |
| tests/test_litellm/proxy/auth/test_auth_checks.py | New unit test confirms team_alias is serialized into the encrypted JWT payload correctly. |
| tests/test_litellm/proxy/management_endpoints/test_ui_sso.py | Extends TestCLIKeyRegenerationFlow fixture with team_details and asserts team_alias is passed through to the JWT generation call; test coverage is adequate. |
Reviews (2): Last reviewed commit: "Include team alias in CLI JWT token" | Re-trigger Greptile
cb19add to
f78fe4f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Automated copy of #28269 into
litellm_internal_stagingfor pr-babysitter.Original head:
boarder7395/litellm:codex-cli-jwt-team-alias@cb19add560faNote
Low Risk
Low risk: adds an optional
team_aliasfield to the CLI JWT payload and threads it through the SSO polling flow without changing authorization checks or token expiration logic.Overview
Adds support for embedding the selected team’s human-readable alias in CLI SSO JWTs.
ExperimentalUIJWTToken.get_cli_jwt_auth_token()now acceptsteam_aliasand includes it in the serializedUserAPIKeyAuthpayload, while the CLI SSO poll endpoint derives the alias fromsession_data["team_details"]and passes it through when minting the JWT. Tests are updated to assertteam_aliaspropagation end-to-end.Reviewed by Cursor Bugbot for commit f78fe4f. Bugbot is set up for automated code reviews on this repo. Configure here.