pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] eolivelli commented on a change in pull request #3677: [WIP]PIP-30: interface and mutual change authentication
Date Sat, 23 Feb 2019 15:05:56 GMT
eolivelli commented on a change in pull request #3677: [WIP]PIP-30: interface and mutual change
authentication
URL: https://github.com/apache/pulsar/pull/3677#discussion_r259581423
 
 

 ##########
 File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataSource.java
 ##########
 @@ -82,39 +83,52 @@ default String getHttpHeader(String name) {
 
     /**
      * Check if data from Pulsar protocol are available.
-     * 
+     *
      * @return true if this authentication data contain data from Pulsar protocol
      */
     default boolean hasDataFromCommand() {
         return false;
     }
 
     /**
-     * 
+     *
      * @return authentication data which is stored in a command
      */
     default String getCommandData() {
         return null;
     }
 
+    /**
+     * For mutual authentication, This method use passed in `data` to evaluate and challenge,
+     * then returns null if authentication has completed;
+     * returns authenticated data back to client side, if authentication has not completed.
+     *
+     * used for mutual authentication like sasl.
+     */
+    default byte[] authenticate(byte[] data) throws IOException {
 
 Review comment:
   What about having an 'AuthToken' class.
   It will actually be a wrapper for a byte[] but this way code will be more readable and
type safe

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message