GeezerVison is showing github.com — [fix][broker] Check topic permissions for binary GetSchema and GetOrCreateSchema by KannarFr · Pull Request #26643 · apache/pulsar
Conversation
KannarFr
commented
Sep 18, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Motivation
The REST schema endpoints check topic permissions (GET_METADATA to read, PRODUCE to upload in
SchemasResourceBase), but the binary CommandGetSchema and CommandGetOrCreateSchema handlers in
ServerCnx did not check any permission.
Modifications
CommandGetSchema requires LOOKUP on the topic. Producers, consumers and readers already hold it,
since they look the topic up first; the default provider treats LOOKUP and GET_METADATA alike.
CommandGetOrCreateSchema requires PRODUCE on the topic, like the REST schema upload.
- A refused request gets
AuthorizationError, through the new
BrokerServiceException.NotAuthorizedException mapped in getClientErrorCode.
ClientChannelHelper now decodes the two schema responses for tests.
This PR and #26644 both add BrokerServiceException.NotAuthorizedException; whichever is merged second
will merge master.
Verifying this change
- Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
ServerCnxTest: each command refused without the permission (the schema registry or the topic is
never reached) and allowed with it.
Does this pull request potentially affect one of the following parts:
- Dependencies (add or upgrade a dependency)
- The public API
- 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
The binary protocol messages are unchanged; the broker now answers AuthorizationError to these
commands when the client lacks the permission.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…reateSchema
Align the binary schema commands with the REST schema endpoints.
CommandGetSchema now requires LOOKUP on the topic, which producers, consumers
and readers already hold. CommandGetOrCreateSchema requires PRODUCE, like the
REST schema upload. A refused request gets AuthorizationError, through the new
BrokerServiceException.NotAuthorizedException.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
lhotari
pushed a commit
that referenced
this pull request
Sep 23, 2026
…reateSchema (#26643)
Check topic permissions for binary GetSchema and GetOrCreateSchema requests and retain the schema and transaction tests when merging master.
(cherry picked from commit 0f8af32)
lhotari
pushed a commit
that referenced
this pull request
Sep 23, 2026
…reateSchema (#26643)
Check topic permissions for binary GetSchema and GetOrCreateSchema requests and retain the schema and transaction tests when merging master.
(cherry picked from commit 0f8af32)
Radiancebobo
pushed a commit
to Radiancebobo/pulsar
that referenced
this pull request
Oct 8, 2026
…reateSchema (apache#26643)
Check topic permissions for binary GetSchema and GetOrCreateSchema requests and retain the schema and transaction tests when merging master.
nodece
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
Nov 16, 2026
…reateSchema (apache#26643)
Check topic permissions for binary GetSchema and GetOrCreateSchema requests and retain the schema and transaction tests when merging master.
(cherry picked from commit 0f8af32)
Reviewers
lhotari
lhotari approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.