Skip to content

fix: don't double the prefix when importing prefixed relationships (#460)#704

Open
ivanauth wants to merge 1 commit into
authzed:mainfrom
ivanauth:fix/issue-460-double-prefix-import
Open

fix: don't double the prefix when importing prefixed relationships (#460)#704
ivanauth wants to merge 1 commit into
authzed:mainfrom
ivanauth:fix/issue-460-double-prefix-import

Conversation

@ivanauth

Copy link
Copy Markdown
Contributor

#461 fixed the panic, but #460 got reopened because zed import --schema=false then doubled the prefix: it auto-detects the schema prefix from the server and prepended it to every relationship, even ones already prefixed. So studio/permissions became studio/studio/permissions and failed with FailedPrecondition.

Now it only prefixes names that aren't already prefixed. Verified against a real SpiceDB, plus unit + integration tests.

Fixes #460

…uthzed#460)

zed import --schema=false auto-detects the schema prefix and prepended it
unconditionally, so already-prefixed relationships became studio/studio/x
and failed. Only prefix names that aren't already prefixed.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

validation file referencing schema using schemaFile cannot be imported

2 participants