fix(phase6): harden createAuthTicket exception handling and stage diagnostics - #54
Merged
Merged
Conversation
|
Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
This PR hardens the production
createAuthTicketcallable function and aligns auth broker test assertions.Key Changes
functions/src/index.js):createAuthTicketexecution in structured try/catch tracking discrete stages (origin_validation,auth_validation,input_validation,tenant_lookup,membership_lookup,ticket_creation,ticket_storage,response_build).HttpsErrorthrows directly so legitimate client rejections retain exact reason codes.stage,reason,correlationId,event: 'auth_broker_create_failed') safely without logging tickets, tokens, credentials, or emails.HttpsError('internal', 'Δεν ήταν δυνατή η ασφαλής μεταφορά σύνδεσης.', { reason: 'internal-create-failure' }).scripts/test-auth-broker-emulator.mjs):ticket-origin-mismatch).Invariants Maintained
VITE_ENABLE_AUTH_BROKER=trueandVITE_ENABLE_TENANT_GATE=falsepreserved.package-lock.jsonclean and untouched.qa:tenant-authorization,qa:saas-foundation,qa:auth-broker,qa:registration-tokens,qa:tenant-provisioning,qa:phase5-portal,qa:auth-broker-negative,qa:multi-tenant,qa:central-portal-isolation,qa:product-terminology,qa:vercel-spa-routing,test:auth-broker:emulator).