Skip to content

feat(import): preserve supabase user ids behind --source-preserve-ids - #47

Merged
LeadcodeDev merged 4 commits into
mainfrom
feature/supabase-preserve-user-ids
Sep 24, 2026
Merged

LeadcodeDev merged 4 commits into
mainfrom
feature/supabase-preserve-user-ids

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Contributor

Closes #46.

--source-preserve-ids creates each user with the id it already has in Supabase, so the sub a relying party stores keeps resolving after the migration. Off by default, Supabase-only, and refused on the other sources the same way --source-passwords is.

The id stays a String end to end rather than becoming a Uuid. 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_exists is 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 --workspace is 163 passing, cargo clippy --workspace --all-targets --all-features -- -D warnings clean.

@LeadcodeDev LeadcodeDev added the enhancement New feature or request label Sep 24, 2026
@LeadcodeDev LeadcodeDev self-assigned this Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a33e6fd2-0891-4930-b668-f803e253285d


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LeadcodeDev
LeadcodeDev merged commit 50061ad into main Sep 24, 2026
4 checks passed
@LeadcodeDev
LeadcodeDev deleted the feature/supabase-preserve-user-ids branch September 24, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat(import): preserve supabase user ids so the sub survives the migration

1 participant