Skip to content

fix(rayverify): refuse identity capture clearly when storage is unset - #197

Merged
SishirP17 merged 1 commit into
mainfrom
fix/identity-storage-gate
Aug 5, 2026
Merged

fix(rayverify): refuse identity capture clearly when storage is unset#197
SishirP17 merged 1 commit into
mainfrom
fix/identity-storage-gate

Conversation

@SishirP17

Copy link
Copy Markdown
Collaborator

Found by exercising the flow against prod with the test fixture account rather than assuming it worked.

Enrolment returns a bare 500. DOCUMENTS_S3_BUCKET is not set in prod, and constructing S3StorageService without 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:

  • storageConfigured added to GET /identity/status
  • POST /identity/enroll and /verify return 503 STORAGE_NOT_CONFIGURED instead of throwing

The 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:

  • An already-enrolled caregiver still sees their setup, because a transient config gap should not imply their photo is gone.
  • The field is treated as missing only when the server explicitly sends 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_BUCKET because 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:scan pass.

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.
@SishirP17
SishirP17 requested a review from durga710 as a code owner August 5, 2026 01:01
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rayhealth-evv-platform-app Ready Ready Preview Aug 5, 2026 1:03am

@SishirP17
SishirP17 merged commit cc1083d into main Aug 5, 2026
13 checks passed
@SishirP17
SishirP17 deleted the fix/identity-storage-gate branch August 5, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant