Skip to content

[feat] PIP-468: V5 Authentication adapter bridges authData()#25685

Merged
merlimat merged 1 commit intoapache:masterfrom
merlimat:st-v5-auth-data-fix
May 6, 2026
Merged

[feat] PIP-468: V5 Authentication adapter bridges authData()#25685
merlimat merged 1 commit intoapache:masterfrom
merlimat:st-v5-auth-data-fix

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

@merlimat merlimat commented May 5, 2026

Summary

Replace the TODO stub on V5AuthWrapper.authData() that returned null with a proper bridge to v4's AuthenticationDataProvider. The two interfaces (V5 AuthenticationData / v4 AuthenticationDataProvider) are aligned method-for-method, so the new V5AuthDataWrapper is a 1:1 delegation across HTTP headers, TLS certificates / private keys, and binary-protocol command data.

Without this fix, any V5 caller that asks the wrapped Authentication for credentials silently gets null and either crashes or — worse — sends an unauthenticated request.

Also wires the authData(brokerHostName) overload, which was previously inheriting the default that delegates to authData() and would have leaked the same null.

Test plan

  • AuthenticationAdapterTest (3 unit tests) — token credential round-trips through authData(); per-host overload delegates; method name passes through.
  • pulsar-client-v5 checkstyle clean.

Replace the TODO stub on V5AuthWrapper.authData() that returned null with
a proper bridge to v4's AuthenticationDataProvider. The two interfaces
(V5 AuthenticationData / v4 AuthenticationDataProvider) are aligned
method-for-method, so the new V5AuthDataWrapper is a 1:1 delegation
across HTTP headers, TLS certificates / private keys, and binary-protocol
command data.

Without this fix, any V5 caller that asks the wrapped Authentication for
credentials (e.g. integrations that bridge V5 auth into another transport,
or future V5 client-side code that exercises the SPI directly) silently
gets null and either crashes or — worse — sends an unauthenticated request.

Also wires the authData(brokerHostName) overload, which was previously
inheriting the default that delegates to authData() and would have leaked
the same null.

AuthenticationAdapterTest verifies the round trip via AuthenticationFactory
.token(...): the wrapped v4 token shows up on the V5 side via
hasDataFromCommand() / getCommandData(), and the per-host overload
delegates correctly.
@merlimat merlimat changed the title PIP-468: V5 Authentication adapter bridges authData() [feat] PIP-468: V5 Authentication adapter bridges authData() May 6, 2026
@merlimat merlimat merged commit 7f84560 into apache:master May 6, 2026
117 of 123 checks passed
@merlimat merlimat deleted the st-v5-auth-data-fix branch May 6, 2026 01:34
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