GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [feat][misc] PIP-478: dedicated pulsar-tls-factory-api and pulsar-http-client-api SPI modules by lhotari · Pull Request #26222 · apache/pulsar

Conversation

@lhotari

@lhotari lhotari commented Jul 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PIP: #25890

Motivation

This is the first implementation PR for PIP-478. The implementation is split into a series of PRs submitted one at a time; this one lands only the foundation the rest of the PIP builds on: two small, dependency-light SPI modules. Nothing consumes them yet, so there is no behavioural change to any existing module.

  • pulsar-tls-factory-api — the purpose-driven PulsarTlsFactory TLS SPI that replaces PIP-337. A factory is asked only for a ready-built TLS object for a given TlsPurpose, with rotation confined to a reload callback (rebuild-not-mutate) and key material never crossing a Pulsar API — so KMS/HSM and workload-identity integrations become first-class instead of requiring a fork of the SSL layer. The flat TlsPolicy value type carries cert/key/trust material (PEM or keystore), ciphers/protocols, hostname verification, and three orthogonal provider axes: the TLS engine (JDK vs native OpenSSL), the JSSE (SSLContext) provider (jsseProvider), and the JCA crypto provider that parses key material (jcaProvider).
  • pulsar-http-client-api — the framework-managed PulsarHttpClient SPI, so authentication plugins share the client's HTTP runtime (event loops, timers, DNS caches, TLS-material refresh) instead of spinning up private AsyncHttpClient instances.

They live in their own modules — rather than inside a client artifact — so the sibling broker-side PIP can depend on them without importing a client jar.

Modifications

  • New module pulsar-tls-factory-api: PulsarTlsFactory, TlsPolicy, TlsPurpose, TlsFactoryInitContext, TlsHandle, TlsEndpoint.
  • New module pulsar-http-client-api (depends on the former): PulsarHttpClient, PulsarHttpClientFactory, PulsarHttpClientConfig, HttpRequest, HttpResponse.
  • Build wiring: settings.gradle.kts, pulsar-bom, the pulsar-common test dependency on the SPI types, and the binary-license check.
  • Unit tests for TlsPolicy validation and TlsPurpose.

Both modules compile standalone against master; no existing code references them.

Verifying this change

This change added tests and can be verified as follows:

  • TlsPolicyValidationTest — TlsPolicy builder validation (PEM vs keystore, required fields).
  • TlsPurposeTest — TlsPurpose identity, role, and equality.
  • The two modules build and pass check standalone (./gradlew :pulsar-tls-factory-api:build :pulsar-http-client-api:build), and ./gradlew quickCheck (license headers + checkstyle) passes over the tree.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency) — adds two new modules to settings.gradle.kts and pulsar-bom; no third-party dependencies added.
  • The public API — introduces the org.apache.pulsar.tls and org.apache.pulsar.http SPI packages as new public API. They are additive and unreferenced by existing code in this PR.
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc-required
  • doc-not-needed — SPI modules with no user-facing surface yet; the PIP-478 design document ([feat][pip] PIP-478: Asynchronous v5 client auth plugin interfaces and TLS material provider plugin interface #25890) covers the design.
  • doc
  • doc-complete

Matching PR in forked repository

PR in forked repository: lhotari/pulsar (Personal CI)

This PR was prepared with the assistance of Claude Code (Opus 4.8); the change was reviewed and is submitted by a human contributor who takes responsibility for it, per the ASF Generative Tooling guidance.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lhotari
[feat][misc] PIP-478: dedicated pulsar-tls-factory-api and pulsar-htt…
4a900b5
…p-client-api SPI modules

### Motivation

This is the first implementation PR for
[PIP-478](apache#25890) (design doc). It introduces
the two small, dependency-light SPI modules the rest of the PIP builds on, with no
behavioural change to any existing module — nothing consumes them yet.

- `pulsar-tls-factory-api` — the purpose-driven `PulsarTlsFactory` TLS SPI that
  replaces PIP-337: a factory is asked only for a ready-built TLS object for a given
  `TlsPurpose`, with rotation confined to a reload callback (rebuild-not-mutate) and
  key material never crossing a Pulsar API. The flat `TlsPolicy` value type carries
  cert/key/trust material, ciphers/protocols, hostname verification, and three
  orthogonal provider axes — the TLS engine, the JSSE (`SSLContext`) provider
  (`jsseProvider`), and the JCA crypto provider that parses key material
  (`jcaProvider`).
- `pulsar-http-client-api` — the framework-managed `PulsarHttpClient` SPI so auth
  plugins share the client's HTTP runtime (event loops, timers, DNS, TLS refresh)
  instead of spinning up private `AsyncHttpClient` instances.

They live in their own modules so the sibling broker-side PIP can depend on them
without importing a client artifact.

### Modifications

- New module `pulsar-tls-factory-api`: `PulsarTlsFactory`, `TlsPolicy`, `TlsPurpose`,
  `TlsFactoryInitContext`, `TlsHandle`, `TlsEndpoint`.
- New module `pulsar-http-client-api` (depends on the former): `PulsarHttpClient`,
  `PulsarHttpClientFactory`, `PulsarHttpClientConfig`, `HttpRequest`, `HttpResponse`.
- Build wiring: `settings.gradle.kts`, `pulsar-bom`, the `pulsar-common` test
  dependency on the SPI types, and the binary-license check.
- Unit tests for `TlsPolicy` validation and `TlsPurpose`.

Assisted-by: Claude Opus 4.8 (Claude Code)
@void-ptr974

void-ptr974 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

I noticed that pulsar-common declares api(project(":pulsar-tls-factory-api")), while this PR does not add any main-source usage of the TLS SPI in pulsar-common (only tests use it). This makes the new TLS SPI, and its transitive OpenTelemetry API dependency, part of the published dependency graph of pulsar-common. Is that intentional at this stage?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari

lhotari commented Jul 25, 2026

Copy link
Copy Markdown
Member Author

I noticed that pulsar-common declares api(project(":pulsar-tls-factory-api")), while this PR does not add any main-source usage of the TLS SPI in pulsar-common (only tests use it). This makes the new TLS SPI, and its transitive OpenTelemetry API dependency, part of the published dependency graph of pulsar-common. Is that intentional at this stage?

there will be 4 more PRs for PIP-478 implementation. The dependency will get used in future PRs.

void-ptr974 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

void-ptr974
void-ptr974 approved these changes Jul 25, 2026
View reviewed changes
merlimat
merlimat approved these changes Aug 4, 2026
View reviewed changes
@merlimat
merlimat merged commit c61fc19 into apache:master Aug 4, 2026
44 of 45 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Aug 4, 2026
[feat][misc] PIP-478: default file-based TLS factory implementation #26271
Merged
[feat][client] PIP-478: asynchronous v5 client authentication and TLS factory integration (core migration) #26282
Merged
This was referenced Aug 12, 2026
[improve][client] PIP-478: drive the v5 authentication model natively in the client (Personal CI) lhotari/pulsar#252
Closed
[improve][client] PIP-478: drive the v5 authentication model natively in the client #26317
Merged
@lhotari lhotari added this to the 5.0.0-M2 milestone Aug 14, 2026
Radiancebobo pushed a commit to Radiancebobo/pulsar that referenced this pull request Oct 8, 2026
@lhotari hechengbo
[feat][misc] PIP-478: dedicated pulsar-tls-factory-api and pulsar-htt…
c810882
…p-client-api SPI modules (apache#26222)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merlimat merlimat merlimat approved these changes
+1 more reviewer
@void-ptr974 void-ptr974 void-ptr974 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

5.0.0-M2

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@lhotari @void-ptr974 @merlimat
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.