Repository navigation
feat(rest): support DLF openapi-v4 signing algorithm - #469
Merged
Merged
Conversation
Add DlfOpenApiV4Signer to sign requests to DlfNext OpenAPI endpoints with ACS4-HMAC-SHA256, aligned with Java DLFOpenApiV4Signer. It is opt-in: only dlf.signing-algorithm=openapi-v4 selects it, and a dlfnext endpoint without a configured algorithm still selects openapi. - Port Java DLFOpenApiActions as DlfOpenApiActions, which maps the method and path of a request to its POP action. The V4 signer signs that action in x-acs-action and sends it with the request; a request that matches no registered operation is signed without one. - Pass the sign headers to DlfRequestSigner::Authorization by pointer so a signer can add headers to them. The default and openapi signers only read them. - Spell the Host and Content-Type headers as RestApi and the openapi signer do, so merging them replaces a header of the same name instead of sending a second copy that differs only in case. The signature lowercases every header name, so it still matches Java. - Share the signing key derivation between the default and V4 signers.
lucasfang
pushed a commit
to lucasfang/paimon-cpp
that referenced
this pull request
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: close #468
Paimon C++ only implemented the
defaultandopenapiDLF signers, so a REST catalogconfigured with
dlf.signing-algorithm=openapi-v4failed at creation. Java Paimon signsrequests to DlfNext endpoints with this opt-in algorithm (apache/paimon#9918,
apache/paimon#9937).
Add
DlfOpenApiV4Signerto sign requests to DlfNext OpenAPI endpoints withACS4-HMAC-SHA256, aligned with JavaDLFOpenApiV4Signer. It is opt-in: onlydlf.signing-algorithm=openapi-v4selects it, and adlfnextendpoint without aconfigured algorithm still selects
openapi.DLFOpenApiActionsasDlfOpenApiActions, which maps the method and path ofa request to its POP action. The V4 signer signs that action in
x-acs-actionandsends it with the request; a request that matches no registered operation is signed
without one.
DlfRequestSigner::Authorizationby pointer so a signer canadd headers to them. The default and openapi signers only read them.
HostandContent-Typeheaders asRestApiand the openapi signer do, somerging them replaces a header of the same name instead of sending a second copy that
differs only in case. The signature lowercases every header name, so it still matches
Java.
Tests
Unit tests in
src/paimon/rest/dlf_auth_test.cpp:DlfOpenApiV4SignerTest:MatchesJavaGoldenSignatureForEncodedQueryValuesandMatchesJavaGoldenSignatureWithAction: match the signatures pinned by JavaDLFOpenApiV4SignerTest, covering query value encoding, header sorting and thesigned action.
SignsHeadersWithBodyandOmitsBodyAndSecurityTokenHeadersWhenAbsent: the headerssigned with and without a body.
SignsUtcDateInNonUtcTimezone: the date inx-acs-dateand in the credential scopestays UTC when the local timezone is ahead of UTC by a day.
SignatureDependsOnRegion,SignsHeaderNamesInLowerCaseAndValuesTrimmed,SignsUnregisteredPathWithoutActionandRequiresSigningDate.DlfAuthProviderTest.SignsWithOpenApiV4OnlyWhenConfigured: onlydlf.signing-algorithm=openapi-v4signs with ACS4 and sendsx-acs-action, includingthe STS token, and the merged request carries one
Hostand oneContent-Typeheader.DlfOpenApiActionsTest, ported from JavaDLFOpenApiActionsTest: every operationresolves to its own unique action, every request
RestApisends resolves to itsaction, names match whole segments and methods ignore case, and unregistered requests
have no action.
API and Format
No public API or storage format changes.
include/paimon/catalog_options.honly updatesthe documentation of
DLF_SIGNING_ALGORITHM. The internalDlfRequestSigner::Authorizationin
src/paimon/rest/dlf_auth.hnow takes the sign headers by pointer.On the wire, a request signed with
openapi-v4carries anACS4-HMAC-SHA256authorization and, when it matches a registered operation, an
x-acs-actionheader, asthe Java client sends. Requests signed with
defaultoropenapiare unchanged.Documentation
Yes.
docs/source/user_guide/catalog.rstdocumentsopenapi-v4fordlf.signing-algorithmand shows it in the DLF configuration example.Generative AI tooling
Generated-by: Claude Code 2.1.310 (Claude Opus 5.5)
🤖 Generated with Claude Code