-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#5077] feat(core): Add the check of user before creating metadata object #5096
Conversation
containerSuite.startKafkaContainer(); | ||
kafkaBootstrapServers = | ||
String.format( | ||
"%s:%d", | ||
containerSuite.getKafkaContainer().getContainerIpAddress(), | ||
KafkaContainer.DEFAULT_BROKER_PORT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to use a Kafka container to test?
If we can use Hive container to test at the same time, we can save resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to test the creating topic case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, This UT only have throw ForbiddenException UT.
I think we need to add normal operation UT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other UTs, we have created the metadata objects. It's ok to add it.
@@ -71,6 +72,10 @@ public Catalog createCatalog( | |||
String comment, | |||
Map<String, String> properties) | |||
throws NoSuchMetalakeException, CatalogAlreadyExistsException { | |||
// Check whether the current user exists or not | |||
AuthorizationUtils.checkCurrentUser( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we only need to check createXXX
operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check every operation actually.
We don't support meta authentication now. I think this should be included to meta authentication.
But for some managers, we don't a dispatcher interface for them like ownerManager and TagManager. We will add the interfaces first. I'm not sure to do them now. So I just make a minor improvement to check createXXX
operation first.
What changes were proposed in this pull request?
Add the check of user before creating metadata object.
Why are the changes needed?
Fix: #5077
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added UT.