risdenk commented on a change in pull request #92: [WIP][CALCITE-2972] Upgrade 
jetty to 9.4.15.v20190215
URL: https://github.com/apache/calcite-avatica/pull/92#discussion_r271473370
 
 

 ##########
 File path: 
server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java
 ##########
 @@ -337,17 +343,23 @@ protected ConstraintSecurityHandler 
configureSpnego(Server server,
       AvaticaServerConfiguration config) {
     final String realm = Objects.requireNonNull(config.getKerberosRealm());
     final String principal = 
Objects.requireNonNull(config.getKerberosPrincipal());
-
-    // A customization of SpnegoLoginService to explicitly set the server's 
principal, otherwise
-    // we would have to require a custom file to set the server's principal.
-    PropertyBasedSpnegoLoginService spnegoLoginService =
-        new PropertyBasedSpnegoLoginService(realm, principal);
+    final String principalWithoutRealm = principal.split("@", 2)[0];
+    final String[] principalParts = principalWithoutRealm.split("/", 2);
+    final String serviceName = principalParts[0];
+    final String hostname = principalParts[1];
 
 Review comment:
   Currently Avatica server is configured with a principal. The Jetty 
implementation builds a principal from the service name (ie: `avatica`) and the 
hostname (ie: `localhost`). So breaking apart here to get into necessary parts.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to