[
https://issues.apache.org/jira/browse/CALCITE-2294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491446#comment-16491446
]
ASF GitHub Bot commented on CALCITE-2294:
-----------------------------------------
Github user karanmehta93 commented on a diff in the pull request:
https://github.com/apache/calcite-avatica/pull/48#discussion_r191035840
--- Diff:
server/src/test/java/org/apache/calcite/avatica/server/CustomAuthHttpServerTest.java
---
@@ -175,63 +126,165 @@ public void
testCustomBasicImpersonationConfigWithDisallowedUser() throws Except
}
}
+ @Test
+ public void testCustomConfigDisallowsWithHandlerMethod() {
+ AvaticaServerConfiguration configuration = new
CustomBasicImpersonationConfig();
+ server = new HttpServer.Builder()
+ .withCustomAuthentication(configuration)
+ .withHandler(Mockito.mock(AvaticaHandler.class))
+ .withPort(0)
+ .build();
+ try {
+ server.start();
+ fail("Expected an exception");
+ } catch (IllegalStateException e) {
+ String assertString = "Handlers and SSLFactory cannot be configured
with "
+ + "HTTPServer Builder when using CUSTOM Authentication Type";
+ assertThat(e.getMessage(), containsString(assertString));
--- End diff --
I am not a fan of doing that too as well. The tests would unnecessarily
break even when I try to follow your nit suggestion above. I just followed the
pattern from other tests here. Will update it to expect ISE, which is much
neater.
> 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)