Skip to content

[codex] fix(auth): preserve local identity mode - #913

Draft
Galaxy-Husky wants to merge 1 commit into
iOfficeAI:mainfrom
Galaxy-Husky:codex/preserve-local-auth-identity-mode
Draft

[codex] fix(auth): preserve local identity mode#913
Galaxy-Husky wants to merge 1 commit into
iOfficeAI:mainfrom
Galaxy-Husky:codex/preserve-local-auth-identity-mode

Conversation

@Galaxy-Husky

Copy link
Copy Markdown

Summary

  • preserve the configured identity mode when building auth middleware state
  • add a route-level regression test for anonymous GET /api/auth/user requests in local mode

Why

auth_routes rebuilt the middleware identity mode from aionpro_mode and mapped every non-AionPro configuration to AuthIdentityMode::UserSession. As a result, an explicitly configured local-mode router required a JWT or session cookie and returned 401 Unauthorized instead of using the existing system_default_user identity.

Passing AuthRouterState.identity_mode through unchanged keeps the router and middleware configuration consistent. Anonymous requests in UserSession mode remain unauthorized; only explicitly configured Local mode uses the fixed local identity.

Fixes #912

Validation

  • cargo test -p aionui-auth (217 passed)
  • cargo fmt --all -- --check
  • cargo clippy -p aionui-auth -- -D warnings
  • just push -u fork codex/preserve-local-auth-identity-mode
    • migration immutability check passed
    • workspace Clippy and formatting gates passed
    • nextest: 8,915 passed, 50 skipped by repository configuration

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.

Local identity mode is discarded by auth_routes

1 participant