[ 
https://issues.apache.org/jira/browse/CALCITE-2294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16487873#comment-16487873
 ] 

ASF GitHub Bot commented on CALCITE-2294:
-----------------------------------------

Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/calcite-avatica/pull/48#discussion_r190365547
  
    --- Diff: 
server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java ---
    @@ -251,35 +238,70 @@ protected void internalStart() {
         } catch (Exception e) {
           throw new RuntimeException(e);
         }
    -    port = connector.getLocalPort();
     
    -    LOG.info("Service listening on port {}.", getPort());
    +    if (null != serverConnector && null != handlerList) {
    +      port = serverConnector.getLocalPort();
    +      LOG.info("Service listening on port {}.", getPort());
     
    -    // Set the information about the address for this server
    -    try {
    -      
this.handler.setServerRpcMetadata(createRpcServerMetadata(connector));
    -    } catch (UnknownHostException e) {
    -      // Failed to do the DNS lookup, bail out.
    -      throw new RuntimeException(e);
    +      // Set the information about the address for this server
    +      try {
    +        
this.handler.setServerRpcMetadata(createRpcServerMetadata(serverConnector));
    +      } catch (UnknownHostException e) {
    +        // Failed to do the DNS lookup, bail out.
    +        throw new RuntimeException(e);
    +      }
    +    } else if (0 == server.getConnectors().length) {
    +      LOG.warn("No server connectors have been configured for this Avatica 
server.");
    --- End diff --
    
    This sounds like it should be thrown as a RuntimeException to me. If there 
are no connectors, this HttpServer couldn't possibly be doing what it's 
intended to do.


> Allow customization for AvaticaServerConfiguration for plugging new 
> authentication mechanisms
> ---------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2294
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2294
>             Project: Calcite
>          Issue Type: Improvement
>          Components: avatica
>            Reporter: Karan Mehta
>            Priority: Major
>
> {{AvaticaServerConfiguration}} is currently only created if authentication 
> mechanism such as {{BASIC, DIGEST or SPNEGO}} is provided. We can change it 
> to a builder pattern to create this object and provide a way for users to 
> plugin their own security configuration.
> An example here can be using it for custom config that supports MTLS.
> Thanks [~alexaraujo] for suggesting this approach.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to