Skip to content

[Server] Keep an explicitly keyed id authoritative in KeyMapper - #1939

Merged
yili-db merged 1 commit into
unitycatalog:mainfrom
yili-db:stack/keymapper_location
Nov 3, 2026
Merged

yili-db merged 1 commit into
unitycatalog:mainfrom
yili-db:stack/keymapper_location

Conversation

@yili-db

@yili-db yili-db commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR

Use this link to review incremental changes.


Follow-up to the comment on Iceberg REST authorization work: a keyed resource id must win over one derived from a caller-supplied location path.

  • KeyMapper merges the ids resolved from an EXTERNAL_LOCATION path with putIfAbsent instead of putAll:
    • the caller controls the body's location, so its owning-entity ids may add a key the request did not resolve, but never replace an explicitly keyed CATALOG/SCHEMA/TABLE, which names the resource the request acts on.
  • Defense in depth, not the sole guard: the create policies still reject a mismatched location via #no_overlap_with_data_securable (external) and the staging-ownership check (managed).

Signed-off-by: Yi Li [email protected]

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

Follow-up to the Iceberg REST authorization work: a keyed resource id must win over one derived from a caller-supplied location path.

- `KeyMapper` merges the ids resolved from an `EXTERNAL_LOCATION` path with `putIfAbsent` instead of `putAll`:
  - the caller controls the body's location, so its owning-entity ids may add a key the request did not resolve, but never replace an explicitly keyed `CATALOG`/`SCHEMA`/`TABLE`, which names the resource the request acts on.
- Defense in depth, not the sole guard: the create policies still reject a mismatched location via `#no_overlap_with_data_securable` (external) and the staging-ownership check (managed).

Signed-off-by: Yi Li <[email protected]>
@timothyw553

Copy link
Copy Markdown
Collaborator

may you provide a link to the original PR this is a follow up to?

@yili-db

yili-db commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

may you provide a link to the original PR this is a follow up to?

Added a link.

@timothyw553 timothyw553 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@yili-db
yili-db merged commit 544fb36 into unitycatalog:main Nov 3, 2026
16 checks passed
shba24 added a commit to shba24/unitycatalog that referenced this pull request Nov 4, 2026
KeyMapperTest (added on main in unitycatalog#1939) opened its own in-memory H2 database and
relied on Hibernate creating the tables. The server no longer lets Hibernate
change the schema, so the test found no tables. It now uses the shared test
database, which the schema steps build, like the other tests that write
entities directly.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Shubham Bansal <[email protected]>
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.

2 participants