[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-28 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r385566807
 
 

 ##
 File path: 
knox-homepage-ui/homepage/app/generalProxyInformation/general.proxy.information.component.ts
 ##
 @@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import {Component, OnInit} from '@angular/core';
+import {HomepageService} from '../homepage.service';
+import {GeneralProxyInformation} from './general.proxy.information';
+
+@Component({
+selector: 'app-general-proxy-information',
+template: `
+General Proxy Information
+
+
+
+
+Knox Version
+{{ getVersion() }}
+
+
+TLS Public Certificate
+
+PEM
+|
+JKS
+
+
+
+Admin UI URL
+{{ getAdminUiUrl() }}
+
+
+
+Admin API Details
+
+
+
+{{ getAdminApiBookUrl() }}
+
+
+
+
+Metadata API
+
+
+General Proxy Information
+|
+Topologies
+
 
 Review comment:
   Done


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-28 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r385566764
 
 

 ##
 File path: 
gateway-service-metadata/src/main/java/org/apache/knox/gateway/service/metadata/ServiceModel.java
 ##
 @@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.knox.gateway.service.metadata;
+
+import java.util.Locale;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.knox.gateway.service.definition.Metadata;
+import org.apache.knox.gateway.topology.Service;
+
+@XmlRootElement(name = "service")
+@XmlAccessorType(XmlAccessType.NONE)
+public class ServiceModel {
+
+  public enum Type {
+API, UI, UNKNOWN
+  };
+
+  protected HttpServletRequest request;
+  protected String topologyName;
+  protected String gatewayPath;
+  protected Service service;
+  protected Metadata serviceMetadata;
+
+  public void setRequest(HttpServletRequest request) {
+this.request = request;
+  }
+
+  public void setTopologyName(String topologyName) {
+this.topologyName = topologyName;
+  }
+
+  public void setGatewayPath(String gatewayPath) {
+this.gatewayPath = gatewayPath;
+  }
+
+  public void setService(Service service) {
+this.service = service;
+  }
+
+  public void setServiceMetadata(Metadata serviceMetadata) {
+this.serviceMetadata = serviceMetadata;
+  }
+
+  @XmlElement
+  public String getServiceName() {
+return this.service == null ? "" : service.getRole();
+  }
+
+  @XmlElement
+  public String getVersion() {
+return this.service == null ? "" : this.service.getVersion() == null ? "" 
: this.service.getVersion().toString();
+  }
+
+  @XmlElement(name = "shortDesc")
+  public String getShortDescription() {
+if (serviceMetadata == null) {
+  return getServiceName().substring(0, 1).toUpperCase(Locale.ROOT) + 
getServiceName().substring(1).toLowerCase(Locale.ROOT);
+} else {
+  return serviceMetadata.getShortDesc();
+}
+  }
+
+  @XmlElement
+  public String getDescription() {
+if (serviceMetadata == null) {
+  return getShortDescription() + (Type.API == getType() ? " REST API" : 
Type.UI == getType() ? " Web User Interface" : "");
+} else {
+  return serviceMetadata.getDescription();
+}
+  }
+
+  @XmlElement
+  public Type getType() {
+return serviceMetadata == null ? Type.UNKNOWN : 
Type.valueOf(serviceMetadata.getType());
+  }
+
+  @XmlElement
+  public String getContext() {
+return (serviceMetadata == null ? "/" + 
getServiceName().toLowerCase(Locale.ROOT) : serviceMetadata.getContext()) + "/";
+  }
+
+  @XmlElement
+  public String getServiceUrl() {
+String context = getContext();
+if ("HIVE".equals(getServiceName())) {
+  return String.format(Locale.ROOT, 
"jdbc:hive2://%s:%d/;?hive.server2.transport.mode=http;hive.server2.thrift.http.path=/%s/%s%s",
 request.getServerName(),
+  request.getServerPort(), gatewayPath, topologyName, context);
+} else {
+  if (context.indexOf("{{BACKEND_HOST}}") > -1) {
+context = context.replaceAll("\\{\\{BACKEND_HOST\\}\\}", 
getBackendServiceUrl());
 
 Review comment:
   Fixed.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-26 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384383203
 
 

 ##
 File path: 
knox-homepage-backend/src/main/java/org/apache/knox/homepage/service/model/ServiceModel.java
 ##
 @@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.knox.homepage.service.model;
+
+import java.util.Locale;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.knox.gateway.topology.Service;
+
+@XmlRootElement(name = "service")
+@XmlAccessorType(XmlAccessType.NONE)
+public class ServiceModel {
+
+  public enum Type {
+API, UI, UNKNOWN
+  };
+
+  protected HttpServletRequest request;
+  protected String topologyName;
+  protected String gatewayPath;
+  protected Service service;
+
+  public void setRequest(HttpServletRequest request) {
+this.request = request;
+  }
+
+  public void setTopologyName(String topologyName) {
+this.topologyName = topologyName;
+  }
+
+  public void setGatewayPath(String gatewayPath) {
+this.gatewayPath = gatewayPath;
+  }
+
+  public void setService(Service service) {
+this.service = service;
+  }
+
 
 Review comment:
   Done.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384082682
 
 

 ##
 File path: 
knox-homepage-backend/src/main/java/org/apache/knox/homepage/service/model/ServiceModel.java
 ##
 @@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.knox.homepage.service.model;
+
+import java.util.Locale;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.knox.gateway.topology.Service;
+
+@XmlRootElement(name = "service")
+@XmlAccessorType(XmlAccessType.NONE)
+public class ServiceModel {
+
+  public enum Type {
+API, UI, UNKNOWN
+  };
+
+  protected HttpServletRequest request;
+  protected String topologyName;
+  protected String gatewayPath;
+  protected Service service;
+
+  public void setRequest(HttpServletRequest request) {
+this.request = request;
+  }
+
+  public void setTopologyName(String topologyName) {
+this.topologyName = topologyName;
+  }
+
+  public void setGatewayPath(String gatewayPath) {
+this.gatewayPath = gatewayPath;
+  }
+
+  public void setService(Service service) {
+this.service = service;
+  }
+
 
 Review comment:
   +1


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384078930
 
 

 ##
 File path: 
gateway-service-definitions/src/main/resources/services/cm-ui/1.0.0/rewrite.xml
 ##
 @@ -0,0 +1,33 @@
+
+
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
 
 Review comment:
   As discussed this is OK.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384078859
 
 

 ##
 File path: 
gateway-service-definitions/src/main/resources/services/cm-ui/1.0.0/rewrite.xml
 ##
 @@ -0,0 +1,33 @@
+
+
+  
+
+  
+  
+
+  
+  
+
+  
+  
 
 Review comment:
   As discussed this is OK.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384078781
 
 

 ##
 File path: 
gateway-service-definitions/src/main/resources/services/cm-ui/1.0.0/rewrite.xml
 ##
 @@ -0,0 +1,33 @@
+
+
+  
+
+  
+  
+
+  
+  
 
 Review comment:
   As discussed this is OK.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384075719
 
 

 ##
 File path: 
gateway-service-definitions/src/main/resources/services/ambari/0.2.2.0/service.xml
 ##
 @@ -15,6 +15,12 @@
limitations under the License.
 -->
 
+
+API
+/ambari/api
 
 Review comment:
   I know it's redundant but it's easier to add it in the metadata than parsing 
the `route` elements.
   It's useful to know what comes after `$KNOX_URL/$GATEWAY_PATH/`


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384072895
 
 

 ##
 File path: knox-homepage-backend/pom.xml
 ##
 @@ -0,0 +1,59 @@
+
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+org.apache.knox
+gateway
+1.4.0-SNAPSHOT
+
+
+knox-homepage-backend
 
 Review comment:
   Renamed the module as discussed above.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384072700
 
 

 ##
 File path: 
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java
 ##
 @@ -93,6 +95,13 @@ public void init( FilterConfig filterConfig ) throws 
ServletException {
 
 // gateway path for deriving an idp url when missing
 gatewayPath = filterConfig.getInitParameter(GATEWAY_PATH);
+if (StringUtils.isBlank(gatewayPath)) {
+  final GatewayConfig gatewayConfig = filterConfig.getServletContext() == 
null ? null
+  : (GatewayConfig) 
filterConfig.getServletContext().getAttribute(GatewayConfig.GATEWAY_CONFIG_ATTRIBUTE);
+  if (gatewayConfig != null) {
+gatewayPath = gatewayConfig.getGatewayPath();
+  }
+}
 
 Review comment:
   Fixed:
   - setting `gatewayPath` in its own method
   - removed the `commons-lang3` dependency


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r383927754
 
 

 ##
 File path: 
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java
 ##
 @@ -93,6 +95,13 @@ public void init( FilterConfig filterConfig ) throws 
ServletException {
 
 // gateway path for deriving an idp url when missing
 gatewayPath = filterConfig.getInitParameter(GATEWAY_PATH);
+if (StringUtils.isBlank(gatewayPath)) {
+  final GatewayConfig gatewayConfig = filterConfig.getServletContext() == 
null ? null
+  : (GatewayConfig) 
filterConfig.getServletContext().getAttribute(GatewayConfig.GATEWAY_CONFIG_ATTRIBUTE);
+  if (gatewayConfig != null) {
+gatewayPath = gatewayConfig.getGatewayPath();
+  }
+}
 
 Review comment:
   > This should be its own method
   
   +1 (let me wait a bit for other review comments before submitting a new 
patchset)


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384022768
 
 

 ##
 File path: gateway-release/home/conf/topologies/metadata.xml
 ##
 @@ -0,0 +1,64 @@
+
 
 Review comment:
   https://issues.apache.org/jira/browse/KNOX-2251


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r384022628
 
 

 ##
 File path: gateway-release/home/conf/topologies/metadata.xml
 ##
 @@ -0,0 +1,64 @@
+
 
 Review comment:
   https://issues.apache.org/jira/browse/KNOX-2251


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r383944969
 
 

 ##
 File path: knox-homepage-backend/pom.xml
 ##
 @@ -0,0 +1,59 @@
+
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+org.apache.knox
+gateway
+1.4.0-SNAPSHOT
+
+
+knox-homepage-backend
 
 Review comment:
   The idea is to add `KnoxShell/Client Downloads and docs` later on into the 
`General Proxy Information` block, but it's been scoped out for now.
   I gave a second thought about the module names and I think the UI should be 
kept as-is (`knox-homepage-ui`) because of the `General Proxy Information` 
block. However, the back-end module can - and should - be renamed like 
`gateway-service-metadata`.
   What do you think?


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r383936897
 
 

 ##
 File path: knox-homepage-backend/pom.xml
 ##
 @@ -0,0 +1,59 @@
+
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+org.apache.knox
+gateway
+1.4.0-SNAPSHOT
+
+
+knox-homepage-backend
 
 Review comment:
   I think it expresses more that they belong to Knox as a product, including 
the gateway, the CLI, the KnoxShell rather than referring only the gateway part.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r383929083
 
 

 ##
 File path: gateway-release/home/conf/topologies/metadata.xml
 ##
 @@ -0,0 +1,64 @@
+
 
 Review comment:
   No, it's not. Without this topology, clients (CM, Ambari, etc...) can not 
query metadata (general proxy info and topology information).
   Please note this can not be added into Admin API because there is no need to 
authorize the incoming requests.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-25 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r383927754
 
 

 ##
 File path: 
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java
 ##
 @@ -93,6 +95,13 @@ public void init( FilterConfig filterConfig ) throws 
ServletException {
 
 // gateway path for deriving an idp url when missing
 gatewayPath = filterConfig.getInitParameter(GATEWAY_PATH);
+if (StringUtils.isBlank(gatewayPath)) {
+  final GatewayConfig gatewayConfig = filterConfig.getServletContext() == 
null ? null
+  : (GatewayConfig) 
filterConfig.getServletContext().getAttribute(GatewayConfig.GATEWAY_CONFIG_ATTRIBUTE);
+  if (gatewayConfig != null) {
+gatewayPath = gatewayConfig.getGatewayPath();
+  }
+}
 
 Review comment:
   > This should be its own method
   
   +1 (let me wait a bit until for review comments before submitting a new 
patchset)


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-14 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r379299791
 
 

 ##
 File path: 
knox-homepage-backend/src/main/java/org/apache/knox/homepage/HomePageResource.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.knox.homepage;
+
+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
+import static javax.ws.rs.core.MediaType.APPLICATION_XML;
+
+import java.io.IOException;
+import java.nio.file.Paths;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateEncodingException;
+import java.security.cert.CertificateException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Optional;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+
+import org.apache.knox.gateway.config.GatewayConfig;
+import org.apache.knox.gateway.i18n.messages.MessagesFactory;
+import org.apache.knox.gateway.service.definition.Metadata;
+import org.apache.knox.gateway.service.definition.ServiceDefinitionPair;
+import org.apache.knox.gateway.services.GatewayServices;
+import org.apache.knox.gateway.services.ServerInfoService;
+import org.apache.knox.gateway.services.ServiceType;
+import org.apache.knox.gateway.services.registry.ServiceDefinitionRegistry;
+import org.apache.knox.gateway.services.security.KeystoreService;
+import org.apache.knox.gateway.services.security.KeystoreServiceException;
+import org.apache.knox.gateway.services.topology.TopologyService;
+import org.apache.knox.gateway.topology.Service;
+import org.apache.knox.gateway.topology.Topology;
+import org.apache.knox.gateway.util.X509CertificateUtil;
+
+@Path("/v1")
+public class HomePageResource {
+  private static final KnoxHomepageMessages LOG = 
MessagesFactory.get(KnoxHomepageMessages.class);
+  private static final String SNAPSHOT_VERSION_POSTFIX = "-SNAPSHOT";
+
+  private java.nio.file.Path pemFilePath;
+  private java.nio.file.Path jksFilePath;
+
+  @Context
+  private HttpServletRequest request;
+
+  @GET
+  @Produces({ APPLICATION_JSON, APPLICATION_XML })
+  @Path("generalProxyInformation")
 
 Review comment:
   Done.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-14 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r379299748
 
 

 ##
 File path: knox-homepage-backend/pom.xml
 ##
 @@ -0,0 +1,67 @@
+
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+org.apache.knox
+gateway
+1.4.0-SNAPSHOT
+
+
+knox-homepage-backend
+knox-homepage-backend
+The Knox Home Page BE
 
 Review comment:
   Fixed :) 


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-14 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r379299666
 
 

 ##
 File path: 
gateway-service-definitions/src/main/resources/services/hdfsui/3.0.0/service.xml
 ##
 @@ -16,6 +16,12 @@
limitations under the License.
 -->
 
+
+UI
+/hdfs?host={{BACKEND_HOST}}
 
 Review comment:
   Fixed.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-14 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r379299589
 
 

 ##
 File path: 
gateway-service-definitions/src/main/resources/services/hdfsui/2.7.0/service.xml
 ##
 @@ -16,6 +16,12 @@
limitations under the License.
 -->
 
+
+UI
+/hdfs?host={{BACKEND_HOST}}
 
 Review comment:
   Fixed.


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


[GitHub] [knox] smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page to Knox

2020-02-13 Thread GitBox
smolnar82 commented on a change in pull request #263: KNOX-2226 - Add home page 
to Knox
URL: https://github.com/apache/knox/pull/263#discussion_r379160241
 
 

 ##
 File path: gateway-release/pom.xml
 ##
 @@ -144,6 +144,14 @@
 
${project.build.directory}
 
applications/**/*
 
+
 
 Review comment:
   Done


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