feat(import): preserve supabase user ids behind --source-preserve-ids - #47
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Closes #46.
--source-preserve-idscreates each user with the id it already has in Supabase, so thesuba relying party stores keeps resolving after the migration. Off by default, Supabase-only, and refused on the other sources the same way--source-passwordsis.The id stays a
Stringend to end rather than becoming aUuid. Nothing in the CLI parses one today, the server validates the format, and the only comparison needed is against the id it echoes back — done case-insensitively, since neither side promises a case.A server built before ferriskey/ferriskey#1495 ignores the field and mints its own id. The import compares what came back against what it asked for and returns an error on the first mismatch instead of warning and carrying on: a half-migrated directory where some accounts kept their subject and others did not is worse than one that stopped. A 409 carrying
user_id_already_existsis told apart from a plain duplicate username for the same reason, since the existing path would have logged it as "already exists, reusing it" and skipped an account that was never written.Not exercised against a live Supabase project or a live FerrisKey server. The unit tests cover the mapping, the request body and the two failure paths; the end-to-end proof that a supplied id becomes the token subject lives in ferriskey's own
supplied_user_id_test.cargo test --workspaceis 163 passing,cargo clippy --workspace --all-targets --all-features -- -D warningsclean.