You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: isolate Passport strategies per authentication request - #658
Passing a shared strategy instance to passport.authenticate lets overlapping requests overwrite Passport's request-specific callbacks on the singleton. Clone the strategy with Object.create(strategy) for each bearer authentication attempt, covering both httpBearer and usageToken.
Keep the original strategy reference for the existing httpBearerStrategy identity check and activity recording. The change is limited to one line in backend/controller/authentication.ts.
Validation:
Docker Compose images built for common, backend, LDAP and Inbucket.
Common TypeScript build passed.
Backend npm test passed: tsoa generation, TypeScript compilation and all 440 existing tests, including the User API scenario containing personal API key activity persistence and throttling.
Biome 2.6.4 CI check passed for the changed file with --error-on-warnings.
No new regression tests added, as requested.
Summary by CodeRabbit
Bug Fixes
Authentication now uses an isolated copy of the selected sign-in configuration. Existing session handling, callbacks, and sign-in options remain unchanged, so the authentication flow should behave as before while avoiding unintended changes to the original configuration. No new sign-in steps or user-facing options have been added.
No actionable comments were generated in the recent review.
Walkthrough
bearerAuthentication now passes a shallow copy of the selected Passport strategy to passport.authenticate. The session option and callback are unchanged.
david-loe/abrechnung#634: Adds activity recording to successful httpBearerStrategy authentication in the same bearerAuthentication flow.
Merge Risk: Minimal · up to c7bc0
The change isolates the bearer strategy for each authentication request. No actionable merge-blocking risk remains.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: isolating Passport strategies for each authentication request.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 61a27fe and c7bc011.
Files selected for processing: 1
backend/controller/authentication.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passing a shared strategy instance to
passport.authenticatelets overlapping requests overwrite Passport's request-specific callbacks on the singleton. Clone the strategy withObject.create(strategy)for each bearer authentication attempt, covering bothhttpBearerandusageToken.Keep the original
strategyreference for the existinghttpBearerStrategyidentity check and activity recording. The change is limited to one line inbackend/controller/authentication.ts.Validation:
npm testpassed: tsoa generation, TypeScript compilation and all 440 existing tests, including the User API scenario containing personal API key activity persistence and throttling.--error-on-warnings.Summary by CodeRabbit