Skip to content

[core][test] Add REST management query authorization support - #9416

Merged
JingsongLi merged 5 commits into
apache:masterfrom
JingsongLi:codex/rest-management-query-auth
Aug 26, 2026
Merged

[core][test] Add REST management query authorization support#9416
JingsongLi merged 5 commits into
apache:masterfrom
JingsongLi:codex/rest-management-query-auth

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

Purpose

Extract the non-Spark prerequisite from #9410 so the REST management runtime and test service can be reviewed independently.

Changes

  • fail closed when managed row filters or column masks are invalid
  • preserve nested projections while loading only selected mask dependencies
  • add a REST management test service for permissions and policies
  • keep assignments and policies consistent across resource and schema lifecycle changes
  • use stable opaque pagination and serialize permission mutations with lifecycle operations
  • document the fail-closed column allowlist evolution rule

Verification

  • Core targeted tests: 13 passed
  • REST OpenAPI validator: 56 catalog operations and 6 management operations
  • Split mirror Spark procedure tests: 11 passed
  • Every file changed by the original branch matches the recomposed split mirror
  • git diff --check

This is a prerequisite for #9410 and contains no Spark connector changes.

@JingsongLi
JingsongLi marked this pull request as ready for review August 26, 2026 10:57

private MockResponse rollbackSchemaHandle(Identifier identifier, String data) throws Exception {
RollbackSchemaRequest requestBody = RESTApi.fromJson(data, RollbackSchemaRequest.class);
RollbackSchemaRequest requestBody = parseRequest(data, RollbackSchemaRequest.class);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Schema rollback bypasses the lifecycle validation added for policies and column permissions. This handler calls SchemaManager.rollbackTo directly, without validating the target schema, evolving assignments, refreshing tableMetadataStore, or serializing with the table/policy lifecycle locks. For example: create a query-auth table, add secret, create a column-mask policy on secret, then roll back to the schema before secret existed. The rollback currently succeeds, leaving the stored policy (and REST metadata) inconsistent with the actual schema. I reproduced this with a focused MockRESTCatalogTest; the expected rejection was not raised. Please apply the same target-schema validation/state update as alter/replace (or reject an incompatible rollback) and add a regression test.

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The remaining concern is limited to the test REST server and is non-blocking. The production query-authorization and projection changes look good to me.

@JingsongLi
JingsongLi merged commit 8397c3e into apache:master Aug 26, 2026
14 checks passed
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