gaoran10 commented on code in PR #15571:
URL: https://github.com/apache/pulsar/pull/15571#discussion_r877007838
##########
pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarMetadata.java:
##########
@@ -273,14 +278,24 @@ public Map<SchemaTableName, List<ColumnMetadata>>
listTableColumns(ConnectorSess
return columns.build();
}
- private ConnectorTableMetadata getTableMetadata(SchemaTableName
schemaTableName, boolean withInternalColumns) {
+ @Override
+ public void cleanupQuery(ConnectorSession session) {
+ if (pulsarConnectorConfig.getAuthorizationEnable()) {
+ pulsarAuth.cleanSession(session);
+ }
+ }
+
+ private ConnectorTableMetadata getTableMetadata(ConnectorSession session,
SchemaTableName schemaTableName,
+ boolean
withInternalColumns) {
if (schemaTableName.getSchemaName().equals(INFORMATION_SCHEMA)) {
return null;
}
TopicName topicName = getMatchedTopicName(schemaTableName);
+ checkTopicAuthorization(session, topicName.toString());
Review Comment:
Maybe we add auth check here is enough, other methods are all based on this
method. The table name in the query will convert to a topic name, and we need
to use the topic name to check the authorization.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]