Fix resourceName used in auth check for SupervisorsTable in SystemSchema#18985
Open
maytasm wants to merge 1 commit intoapache:masterfrom
Open
Fix resourceName used in auth check for SupervisorsTable in SystemSchema#18985maytasm wants to merge 1 commit intoapache:masterfrom
maytasm wants to merge 1 commit intoapache:masterfrom
Conversation
843eead to
6cf4527
Compare
jtuglu1
approved these changes
Feb 4, 2026
FrankChen021
reviewed
Feb 5, 2026
|
|
||
| Function<SupervisorStatus, Iterable<ResourceAction>> raGenerator = supervisor -> Collections.singletonList( | ||
| AuthorizationUtils.DATASOURCE_READ_RA_GENERATOR.apply(supervisor.getSource())); | ||
| AuthorizationUtils.DATASOURCE_READ_RA_GENERATOR.apply(supervisor.getDataSource())); |
Member
There was a problem hiding this comment.
the java doc of orignial getSource says:
/**
* This API is only used for informational purposes in
* org.apache.druid.sql.calcite.schema.SystemSchema.SupervisorsTable
*
* @return source like stream or topic name
*/
String getSource();
Since here we' re using getDataSource I think we should remove the original getSource method definition. I check the code, besides the SystemSchema, there're few references in the the kafka supervisor spec, which can be replaced by calling getIoConfig().getStream()
Contributor
Author
There was a problem hiding this comment.
I don't think that's possible. getIoConfig is not a method of SupervisorSpec. It is only available in some (but not all) sub classes like KafkaSupervisorSpec but not CompactionSupervisorSpec. I think we still need this method
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.
Description
SupervisorsTable in SystemSchema (powering queries to the sys.supervisors table) was using the topic/stream of the supervisorSpec as the resourceName to authenticate against. This is wrong and is inconsistent with other APIs that uses the datasource name of the supervisor (i.e. updating supervisor spec, suspending/starting, querying, etc). This change fixes this to use the datasourceName and add test to verify that only datasourceName is use as resourceName in authentication.
This PR has: