[ 
https://issues.apache.org/jira/browse/KNOX-2571?focusedWorklogId=578609&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-578609
 ]

ASF GitHub Bot logged work on KNOX-2571:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Apr/21 19:42
            Start Date: 07/Apr/21 19:42
    Worklog Time Spent: 10m 
      Work Description: moresandeep commented on a change in pull request #430:
URL: https://github.com/apache/knox/pull/430#discussion_r609000893



##########
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 -> {

Review comment:
       i don't follow what `this` object is here

##########
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:
       Why not define these as static constants? added and reduced when needed 
(by cloning)




-- 
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 578609)
    Time Spent: 40m  (was: 0.5h)

> Knox Homepage Profiles
> ----------------------
>
>                 Key: KNOX-2571
>                 URL: https://issues.apache.org/jira/browse/KNOX-2571
>             Project: Apache Knox
>          Issue Type: New Feature
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 1.6.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> There may be certain circumstances, when hiding functionality via links in 
> the General Proxy Information section to things like the Knox Admin UI, Knox 
> public certs, etc... is useful.
> This improvement would allow for specific profiles to be defined within 
> gateway-site.xml that would be referenced by name as a query param in the 
> URL. A token profile will allow the homepage to filter itself based on the 
> definition in gateway-site.xml to include only the links and topologies 
> described in the profile.
> This same feature would likely be able to be used as the default app on any 
> topology endpoint. Instead of a 404 we could redirect to the homepage with an 
> implied topology profile and the specific topology name.
> This would lead us to a possible URL like:
> [https://localhost:8443/gateway/homepage/home?profile=topology&name=sandbox]
> This will tell it to filter for only the links described in the general 
> topology profile and the indicated topology name and possibly with any 
> additional topologies that are in the profile as well. Typically, I would 
> imagine it to only have the one named in the query param but it would be up 
> to the profile definition author.
> Using the above idea, the token-based profile URL could be done in a similar 
> way - so that it can differ the filter for token integrations, we would make 
> it a different profile:
> [https://localhost:8443/gateway/homepage/home?profile=token&name=tokenbased]
> There should be 3 pre-configured profiles OOTB:
>  * full - all elements of GPI (General Proxy Information) is shown; no 
> topology filtering
>  * thin - only the version and public certification elements are showing in 
> GPI; no topology filtering
>  * token - only the version and token integration elements are shown in GPI; 
> no topology filtering



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to