feat: gate mobile endpoints behind face enrollment, fix jsonb round-trip - #78
Merged
Merged
Conversation
- Add require_onboarded_mobile_user dependency: every mobile endpoint except /auth/* and /enroll now returns 403 until the user completes face enrollment (users.face_embedding is set). - Add is_onboarded to GET /user/auth/me and the avatar upload response so clients can branch on a single field instead of parsing 403s. - Fix asyncpg/SQLAlchemy jsonb handling: register a jsonb type codec on connect so dict params bind correctly and jsonb columns decode back to dict (was crashing audit_events writes, and silently mismatched on notifications/staff_notifications reads). - Add a dev-env fixed OTP (DEV_OTP_BYPASS_CODE) for registration so local/mobile testing doesn't require a real inbox or NATS email flow.
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
require_onboarded_mobile_userdependency: every mobile endpoint except/auth/*and/enrollnow returns403until the user has completed face enrollment (users.face_embeddingis set).is_onboardedtoGET /user/auth/meand the avatar upload response so clients can branch on a single field instead of parsing 403 error strings.audit_eventswrites outright, and silently mismatched typing onnotifications/staff_notificationsreads.DEV_OTP_BYPASS_CODE, default000000) for registration so local/mobile testing doesn't require a real inbox or the NATS email flow.Test plan
403on/photos,/notifications,/event/join,/event/me/auth/*and/enrollremain reachable pre-onboardingGET /user/auth/mereturnsis_onboarded: false/truecorrectlyDataError