You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/20 07:12:31 UTC

[GitHub] [pulsar] RobertIndie commented on a diff in pull request #15571: [feature][sql] Add Pulsar Auth support for the Pulsar SQL

RobertIndie commented on code in PR #15571:
URL: https://github.com/apache/pulsar/pull/15571#discussion_r877814912


##########
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:
   You're right. Thanks!



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org