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

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_r190365126
  
    --- Diff: 
server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java ---
    @@ -215,34 +215,21 @@ protected void internalStart() {
         server = new Server(threadPool);
         server.manage(threadPool);
     
    -    final ServerConnector connector = configureConnector(getConnector(), 
port);
    -    ConstraintSecurityHandler securityHandler = null;
    -
    -    if (null != this.config) {
    -      switch (config.getAuthenticationType()) {
    -      case SPNEGO:
    -        // Get the Handler for SPNEGO authentication
    -        securityHandler = configureSpnego(server, connector, this.config);
    -        break;
    -      case BASIC:
    -        securityHandler = configureBasicAuthentication(server, connector, 
config);
    -        break;
    -      case DIGEST:
    -        securityHandler = configureDigestAuthentication(server, connector, 
config);
    -        break;
    -      default:
    -        // Pass
    -        break;
    +    ServerConnector serverConnector = null;
    +    HandlerList handlerList = null;
    +    if (null != this.config && AuthenticationType.CUSTOM == 
config.getAuthenticationType()) {
    +      if (null != handler || null != sslFactory) {
    +        throw new IllegalStateException("Handlers and SSLFactory cannot be 
configured with "
    +                + "HTTPServer Builder when using CUSTOM Authentication 
Type.");
    --- End diff --
    
    nit: "with this Builder" or "with the HttpServer Builder"


> 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