Skip to content

Add return type hints to server/auth_routes.py - #383

Merged
antiv merged 1 commit into
antiv:mainfrom
ShivamJuyal24:fix/auth-routes-return-types
Nov 16, 2026
Merged

antiv merged 1 commit into
antiv:mainfrom
ShivamJuyal24:fix/auth-routes-return-types

Conversation

@ShivamJuyal24

Copy link
Copy Markdown
Contributor

Add return type hints to server/auth_routes.py

Part of #371, tracked in #376.

What changed

Added return type annotations to the 5 functions in server/auth_routes.py that had none:

Function Return type
login_page HTMLResponse
generate_auth_token Dict[str, Any]
revoke_auth_token Dict[str, Any]
revoke_auth_token_delete Dict[str, Any]
logout JSONResponse

The only other change is the import of Any, Dict and HTMLResponse that the annotations need.

No behaviour change

  • Routes that return a response are annotated with that response class (HTMLResponse, JSONResponse), so FastAPI does not validate or filter their output.
  • The Dict[str, Any] routes return plain dicts on every path, so no Union was needed.

Checks

  • The check script from Return type hints on the server's functions #371 prints nothing for server/auth_routes.py.
  • python -m unittest shared.test.test_client_contract passes.
  • Full suite: python -m unittest discover -s shared/test -t . -p "test_*.py" shows 17 problems (2 failures, 15 errors) in test_langgraph_mcp_remote, test_system_settings, test_image_generation_setup and test_provider_keys. They come from mcp 2.x and litellm image-model behaviour in my environment, and the same 17 occur with this change stashed, so they are not caused by this PR.

Notes

  • Not touched, as out of scope: the unused import os.
  • CHANGELOG: not added, since this is an annotation-only change. Happy to add an entry if the maintainers want one.

@ShivamJuyal24
ShivamJuyal24 requested a review from antiv as a code owner November 16, 2026 13:04
@antiv
antiv merged commit 4314fa6 into antiv:main Nov 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants