Repository navigation
Migration API for importing spaces into a self-hosted install - #73
Merged
Merged
Conversation
…install - functions: read-only /api/migration/** (spaces, space, tokens, webhooks, schemas; translations, assets, contents paged by 500), bearer migration token, 404 while no token is configured - functions: admin-only migrationtoken-generate / -revoke callables; only the token's sha256 is stored (configs/migration) - firestore.rules: configs/migration is read by admins only and written only by the callables - admin UI: Settings → Migration tab to generate (shown once), regenerate and revoke the token - hosting: /api/migration/** rewrite; README: moving to a self-hosted install
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
Adds what a self-hosted Localess install needs to import spaces from this Firebase environment (Admin → Spaces → Import from Firebase on the self-hosted side).
functions/src/migration.ts, functionmigrationapi, Hosting rewrite/api/migration/**): read-only, bearer migration token.GET /api/migration/spaces,/spaces/{id},/spaces/{id}/tokens|webhooks|schemas/spaces/{id}/translations|assets|contents?cursor=paged by 500 ({ items, cursor },cursor= last id,nullat the end)404everywhere while no token is configured,401for a missing or wrong one./api/v1/spaces/{id}/assets/{assetId}/original.functions/src/migration-token.ts): admin-only callablesmigrationtoken-generate(returns the token once) andmigrationtoken-revoke. Only the sha256 is stored, inconfigs/migration; the check usestimingSafeEqual.configs/migrationis readable by admins only and not writable by clients, so nobody can set a token of their choosing.The self-hosted side lives on
refactor/monorepo-structure(design:docs/roadmap/firebase-space-import.mdthere).Testing
npm test→ 40 files / 641 tests (new: token hashing/check, API auth/shape/paging, callables admin-only and hash-only storage);npm run build,npm run lint(0 errors)ng test→ 175 files / 1595 tests (new: Migration tab incl. error states);ng build,ng lintdevelop).🤖 Generated with Claude Code