joshelser commented on a change in pull request #14: PHOENIX-5642 Add HTTPS
support to Phoenix Query Server and thin client
URL: https://github.com/apache/phoenix-queryserver/pull/14#discussion_r364803676
##########
File path:
queryserver/src/it/java/org/apache/phoenix/end2end/HttpParamImpersonationQueryServerIT.java
##########
@@ -77,20 +87,34 @@ public static void setUp() throws Exception {
conf.set("hadoop.proxyuser.user1.groups", "*");
conf.set("hadoop.proxyuser.user1.hosts", "*");
conf.setBoolean(QueryServerProperties.QUERY_SERVER_WITH_REMOTEUSEREXTRACTOR_ATTRIB,
true);
+ environment = new QueryServerEnvironment(conf, 2, tls);
+ }
- configureAndStartQueryServer(conf, 2);
+ @AfterClass
+ public static void stopEnvironment() throws Exception {
+ environment.stop();
+ }
+
+ private String getUrlTemplate() {
+ if(environment.getTls()) {
+ return Driver.CONNECT_STRING_PREFIX + "url=https://localhost:" +
environment.getPqsPort() + "?"
+ +
QueryServerOptions.DEFAULT_QUERY_SERVER_REMOTEUSEREXTRACTOR_PARAM +
"=%s;authentication=SPNEGO;serialization=PROTOBUF;truststore="
+
+TlsUtil.getTrustStoreFile().getAbsolutePath()+";truststore_password="+TlsUtil.getTrustStorePassword();
+ } else {
+ return Driver.CONNECT_STRING_PREFIX + "url=http://localhost:" +
environment.getPqsPort() + "?"
Review comment:
Can remove duplication of the common prefix of the URL here. e.g.
```
String url = Driver.CONNECT_STRING_PREFIX + ... + "..
;serialization=PROTOBUF";
if (environment.getTls()) {
url += ";truststore=" +
TlsUtil.getTrustStoreFile().getAbsolutePath()+";truststore_password="+TlsUtil.getTrustStorePassword();
}
return url;
```
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services