fix(rayverify): refuse identity capture clearly when storage is unset - #197
Merged
Conversation
Found by exercising the flow against prod with the test fixture account: enrolment returns a bare 500. DOCUMENTS_S3_BUCKET is not set there, and constructing the storage client without a bucket throws, so the failure lands at the exact moment somebody has just photographed their own face. The status endpoint reported configured: false, but that only covers the matching provider. An agency can have Rekognition selected with no bucket, or a bucket with no provider, so storage is now reported separately as storageConfigured, and enrol/verify return 503 STORAGE_NOT_CONFIGURED instead of throwing. The app uses that to skip the camera entirely and say setup is not finished, which is the honest order: do not invite somebody to hand over a photo of their face before there is anywhere to keep it. An already-enrolled caregiver still sees their setup, because a transient config gap should not imply their photo is gone, and an older API that omits the field behaves exactly as before.
|
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.
Found by exercising the flow against prod with the test fixture account rather than assuming it worked.
Enrolment returns a bare 500.
DOCUMENTS_S3_BUCKETis not set in prod, and constructingS3StorageServicewithout a bucket throws, so the failure lands at the exact moment somebody has just photographed their own face. I had told the user consent and enrolment would succeed before the teammate's config landed; that was wrong.The status endpoint reported
configured: false, but that only covers the matching provider. An agency can have Rekognition selected with no bucket, or a bucket with no provider, so those are now reported separately:storageConfiguredadded toGET /identity/statusPOST /identity/enrolland/verifyreturn 503STORAGE_NOT_CONFIGUREDinstead of throwingThe app uses that to skip the camera entirely and say setup is not finished. That is the honest order: do not invite somebody to hand over a photo of their face before there is anywhere to keep it.
Two deliberate edge cases:
false, so an older API that omits it behaves exactly as before.Tests: 8 new (3 server, 5 client). The existing identity tests never set
DOCUMENTS_S3_BUCKETbecause they mocked the storage class, so they needed the env var adding now that the route gates on it directly. All four suites, typecheck, lint,sql:scan,security:scanpass.