Skip to content

[rest] Propagate dependency read context in headers#8823

Open
leaves12138 wants to merge 1 commit into
apache:masterfrom
leaves12138:codex/dependency-read-via-header
Open

[rest] Propagate dependency read context in headers#8823
leaves12138 wants to merge 1 commit into
apache:masterfrom
leaves12138:codex/dependency-read-via-header

Conversation

@leaves12138

Copy link
Copy Markdown
Contributor

Purpose

This replaces the broad grant-based approach from #8634 with a minimal,
backward-compatible mechanism for REST servers to receive the table that
initiated a runtime dependency read.

The dependency target is already identified by the existing table or data-token
endpoint path. This change adds an optional X-Paimon-Read-Via request header
containing the URL-encoded JSON Identifier of the outermost source table.

Changes

  • Keep the existing Catalog, RESTCatalog, and RESTApi method signatures,
    endpoints, request/response DTOs, and OpenAPI specification unchanged.
  • Derive a dependency-scoped CatalogContext only when a REST-backed table reads
    another table.
  • Propagate that context through Blob View resolution and
    blob-descriptor.source-table.
  • Preserve the outermost source table across nested dependency reads.
  • Reuse the existing header.* support so both target getTable and data-token
    requests carry the context.

Old clients send no header, and old servers can ignore the optional header.

Security

X-Paimon-Read-Via is client-provided context, not authorization proof. The
server remains responsible for authenticating the caller and deciding whether
and how to use the source/target relationship.

Validation

  • mvn -pl paimon-core -am -Pfast-build -DfailIfNoTests=false -DwildcardSuites=none -Dtest=CatalogEnvironmentTest,BlobDescriptorReaderFactoryTest,MockRESTCatalogTest test
    (132 tests passed)
  • mvn -pl paimon-core -am -Pfast-build -DfailIfNoTests=false -DwildcardSuites=none '-Dtest=BlobTableTest#testBlobViewE2E+testForwardBlobViewReference' test
    (2 tests passed)
  • mvn -pl paimon-core -am -DskipTests compile
  • git diff --check

@leaves12138
leaves12138 marked this pull request as ready for review July 23, 2026 08:37
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.

1 participant