auth provider follow-ups: sessionless register, login audit, test isolation#284
Open
Polliog wants to merge 9 commits into
Open
auth provider follow-ups: sessionless register, login audit, test isolation#284Polliog wants to merge 9 commits into
Polliog wants to merge 9 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Follow-up fixes for the auth provider interface merge (#266), addressing the remaining review items and issues found while verifying the merged code:
sessionwhen post-registration auto-login fails transiently. The frontend now redirects to/loginwith a "please sign in" toast instead of throwing a TypeError.RegisterResponse(optionalsession) makes TypeScript enforce the guard for any future caller.auth.login_failedaudit events with areasonin the metadata (invalid_credentials/account_disabled/sso_required), previously only wrong-password failures were audited. The reason never appears in the HTTP response, so anti-enumeration behavior is unchanged. The lookup is guarded withObject.hasOwnso inheritedObject.prototypekeys cannot be misclassified as auth failures.catch {}around post-registration auto-login now logs throughhub.captureLog, a persistent failure there silently degraded every signup with zero diagnostics.auth_providersrow including the migration-seededlocalprovider. Since Feat/auth provider interface #266 routes login through the provider registry, every login-based test file running after them could fail with 500s, masked intermittently by the registry's 5-minute cache (tracked migrations never re-run, so the row stayed gone). The files now preserve the seeded row and the shared test setup re-seeds it defensively. Before the fix, running the users+auth+audit-log modules together failed 8 tests; now the full suite is green.createTestUsersupportsdisabledandpassword: null(SSO-only users) instead of tests hand-rolling inserts.Deferred (tracked internally): consolidating
usersService.loginonto the provider path, and replacing the error-message string matching with a typedAuthErrorCodepropagated end to end. The integration tests pin the three current strings, so a drift fails CI in the meantime.Tenant safety
LogTide is multi-tenant. Confirm the following for any new/changed query, endpoint,
or background job (see
docs/security/tenant-isolation-audit.md):organization_id(andproject_idwhere relevant). (No new tenant-table queries; audit rows for login events are platform-level withorganizationId: null, matching the existingauth.*pattern.)npm run check:tenant-scopingpasses (run frompackages/backend).Testing
auth.login_failedintegration tests fail against the pre-fix login handler; removing the frontend guard produces the expected svelte-check type error at the exact call site.tsc --noEmitclean on backend; svelte-check at the pre-existing 9-error baseline; frontend unit tests 86/86.check:tenant-scoping: all 307 access sites scoped or allowlisted.