Repository navigation
Phase 2: Globe provisioning endpoint + cloud setup mode - #300
Merged
Merged
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
Implements the globe side of the provisioning flow for Phase 2. The hub calls
/api/provisionvia HMAC to create a new org and setup token for a new cloud user. The user then visits/setup?token=xxxto activate their account.What Changed
New Files
prisma/migrations/20260702121851_add_setup_token/— Prisma migration for SetupToken modelsrc/lib/setup-token.ts— Library:generateSetupToken,validateSetupToken,consumeSetupTokensrc/lib/setup-token.test.ts— 11 unit tests covering token generation, validation, consumption, and expirysrc/app/api/provision/route.ts— HMAC-protected POST endpoint for hub provisioningtests/setup-flow.spec.ts— 6 Playwright E2E tests for setup page and provision endpointModified Files
prisma/schema.prisma— Added SetupToken model with relation to BetterAuthUsersrc/app/setup/actions.ts— AddedvalidateProvisionTokenandactivateProvisionedAccountserver actionssrc/app/setup/page.tsx— Dual-mode setup page (local admin creation + cloud token activation)src/proxy.ts— Added/api/provisionto PUBLIC_API_PREFIXESpackage.json— Bumped 2.55.0 → 2.56.0Key Design Decisions
updateManywith WHERE guardTest Results