smolnar82 commented on a change in pull request #430:
URL: https://github.com/apache/knox/pull/430#discussion_r609065048
##########
File path:
gateway-service-metadata/src/main/java/org/apache/knox/gateway/service/metadata/KnoxMetadataResource.java
##########
@@ -250,4 +253,18 @@ private ServiceModel getServiceModel(HttpServletRequest
request, String gatewayP
return serviceModel;
}
+ @GET
+ @Produces({ APPLICATION_JSON })
+ @Path("profiles/{profile}")
+ public String getProfile(@PathParam("profile") String profileName) {
+ final GatewayConfig config = (GatewayConfig)
request.getServletContext().getAttribute(GatewayConfig.GATEWAY_CONFIG_ATTRIBUTE);
+ final Map<String, Collection<String>> configuredProfiles =
config.getHomePageProfiles();
+ if (configuredProfiles.containsKey(profileName)) {
Review comment:
Fixed.
##########
File path:
gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java
##########
@@ -1209,4 +1211,23 @@ public long getKeystoreCacheEntryTimeToLiveInMinutes() {
public boolean isGatewayServerIncomingXForwardedSupportEnabled() {
return getBoolean(KNOX_INCOMING_XFORWARDED_ENABLED, true);
}
+
+ @Override
+ public Map<String, Collection<String>> getHomePageProfiles() {
+ final Map<String, Collection<String>> profiles =
getPreConfiguredProfiles(); // pre-configured profiles might be overwritten
+ this.forEach(config -> {
+ if (config.getKey().startsWith(KNOX_HOMEPAGE_PROFILE_PREFIX)) {
+
profiles.put(config.getKey().substring(KNOX_HOMEPAGE_PROFILE_PREFIX.length()),
getTrimmedStringCollection(config.getKey()));
+ }
+ });
+ return profiles;
+ }
+
+ private Map<String, Collection<String>> getPreConfiguredProfiles() {
+ final Map<String, Collection<String>> profiles = new HashMap<>();
+ profiles.put("full", Arrays.asList("gpi_version", "gpi_cert",
"gpi_admin_ui", "gpi_admin_api", "gpi_md_api", "gpi_tokens"));
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:
[email protected]