Skip to content

[core] Reject disabling query auth with dynamic options - #10903

Merged
JingsongLi merged 1 commit into
apache:masterfrom
plusplusjiajia:fix/core-reject-disabling-query-auth
Nov 1, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
plusplusjiajia:fix/core-reject-disabling-query-auth

Conversation

@plusplusjiajia

Copy link
Copy Markdown
Member

Purpose

query-auth.enabled is not an immutable option. A dynamic option could therefore turn it off: table.copy({"query-auth.enabled": "false"}) returned a table without the row filters and column masks of the REST catalog, and it also disabled the search rejection. This was reachable from SQL, for example:

  • Spark SET spark.paimon.query-auth.enabled=false, or the same option given as a read option;
  • a Flink /*+ OPTIONS('query-auth.enabled'='false') */ hint, or the same option set as a paimon.* session option.

Only the Flink vector and full-text search procedures refused the option.

copy and copyWithoutTimeTravel now reject a dynamic value of query-auth.enabled that is not true when the table enables query auth. Enabling it dynamically, or passing true, is still allowed.

IndexBootstrap reads the primary keys without query auth on purpose. It now uses a new internal FileStoreTable.copyWithoutQueryAuth, which the tables that wrap others (FallbackReadFileStoreTable, ChainGroupReadTable, ChainTableFileStoreTable and Flink's LookupFileStoreTable) implement like their copy, so their branches are kept.

Tests

  • RESTCatalogTest#testQueryAuthCannotBeDisabledDynamically: copy and copyWithoutTimeTravel reject false, null and invalid values on a table with a row filter and a mask, and copies with true still apply the rules.
  • RESTCatalogTest#testQueryAuthCanBeEnabledDynamically: query auth can still be enabled dynamically on a table without it.
  • IndexBootstrapTest: the bootstrap ignores query auth on tables that enable it, and reads the keys of both branches of a table with scan.fallback-branch.
  • ChainTableFileStoreTableTest and LookupTableTest: copyWithoutQueryAuth keeps the chain branches and the lookup scan mode.
  • The new RESTCatalogTest and fallback bootstrap tests fail on master. The related tests pass locally: IndexBootstrapTest, FallbackReadFileStoreTableTest, ChainTableFileStoreTableTest, MockRESTCatalogTest and LookupTableTest, 359 tests.

@plusplusjiajia
plusplusjiajia marked this pull request as ready for review October 31, 2026 03:17
query-auth.enabled is not an immutable option, so a dynamic option
could turn it off: table.copy with query-auth.enabled=false returned a
table without row filters and column masks. This was reachable from SQL,
for example with Spark's SET spark.paimon.query-auth.enabled=false or a
Flink OPTIONS hint, and also disabled the search rejection. Only the
Flink search procedures refused the option.

copy and copyWithoutTimeTravel now reject a dynamic value that is not
true when the table enables query auth. Enabling it dynamically, or
passing true, is still allowed.

IndexBootstrap reads the primary keys without query auth on purpose. It
now uses a new internal FileStoreTable.copyWithoutQueryAuth, which every
table that wraps others (fallback, chain and lookup tables) implements
like its copy, so their branches are kept.
@plusplusjiajia
plusplusjiajia force-pushed the fix/core-reject-disabling-query-auth branch from 5e8d142 to 675de23 Compare October 31, 2026 03:28
@JingsongLi
JingsongLi merged commit 953b05c into apache:master Nov 1, 2026
18 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