Skip to content

refactor: modernize session management and token validation#1390

Open
solracsf wants to merge 1 commit intomainfrom
refactorUserBackend
Open

refactor: modernize session management and token validation#1390
solracsf wants to merge 1 commit intomainfrom
refactorUserBackend

Conversation

@solracsf
Copy link
Member

This PR is a comprehensive audit and refactor, resolving bugsand performance problems identified through iterative code review. Refactor user session management and token validation logic for improved clarity and functionality. Introduce constants for session data and enhance error handling.

  • Catch exceptions when instantiating bearer token validators, so a missing or broken DI entry no longer crashes the authentication chain.
  • Catch exceptions during provisioning strategy resolution and execution, and log the failure instead of aborting login.
  • Tighten bearer token parsing and basic UID validation before using the resolved user ID.
  • Treat duplicate validations for the same (provider, userId) as valid, while still rejecting genuinely ambiguous matches across different providers or user IDs.
  • Pre-instantiate validators outside provider loop

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf solracsf force-pushed the refactorUserBackend branch from 44990c5 to e1b4226 Compare March 27, 2026 06:15
@solracsf solracsf marked this pull request as ready for review March 27, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant