Class PulsarAuth

java.lang.Object
org.apache.pulsar.sql.presto.PulsarAuth

public class PulsarAuth extends Object
This class implements the authentication and authorization integration between the Pulsar SQL worker and the Pulsar broker. It will check permissions against the session-topic pair by trying to subscribe to a topic using the Pulsar Reader to check the consumption privilege. The same topic will only be checked once during the same session.
  • Constructor Details

  • Method Details

    • checkTopicAuth

      public void checkTopicAuth(io.prestosql.spi.connector.ConnectorSession session, String topic)
      Check if the session has read access to the topic. It will try to subscribe to that topic using the Pulsar Reader to check the consumption privilege. The same topic will only be checked once during the same session.
    • cleanSession

      public void cleanSession(io.prestosql.spi.connector.ConnectorSession session)
      When the session is closed, this method needs to be called to clear the session's auth verification status.