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

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

                Author: ASF GitHub Bot
            Created on: 15/Jul/22 10:34
            Start Date: 15/Jul/22 10:34
    Worklog Time Spent: 10m 
      Work Description: MrtnBalazs commented on code in PR #608:
URL: https://github.com/apache/knox/pull/608#discussion_r922043218


##########
gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java:
##########
@@ -1335,4 +1343,49 @@ public int getJettyMaxFormKeys() {
     return getInt(JETTY_MAX_FORM_KEYS, ContextHandler.DEFAULT_MAX_FORM_KEYS);
   }
 
+  @Override
+  public int getPrivilegedUserConcurrentSessionLimit(){
+    int limit = getInt(GATEWAY_PRIVILEGED_USER_CONCURRENT_SESSION_LIMIT, 
GATEWAY_PRIVILEGED_USER_CONCURRENT_SESSION_LIMIT_DEFAULT);
+    if(limit < 0)
+      return GATEWAY_PRIVILEGED_USER_CONCURRENT_SESSION_LIMIT_DEFAULT;
+    else
+      return limit;
+  }
+
+  @Override
+  public int getNonPrivilegedUserConcurrentSessionLimit(){
+    int limit = getInt(GATEWAY_NON_PRIVILEGED_USER_CONCURRENT_SESSION_LIMIT, 
GATEWAY_NON_PRIVILEGED_USER_CONCURRENT_SESSION_LIMIT_DEFAULT);
+    if(limit < 0)
+      return GATEWAY_NON_PRIVILEGED_USER_CONCURRENT_SESSION_LIMIT_DEFAULT;
+    else
+      return limit;
+  }
+
+  @Override
+  public Set<String> getPrivilegedUsers(){
+    Set<String> set = new HashSet<>();
+
+    String value = get( GATEWAY_PRIVILEGED_USERS );
+    if ((value != null) && (!value.trim().equals("")) ) {

Review Comment:
   Fixed it.





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

    Worklog Id:     (was: 791352)
    Time Spent: 1h 10m  (was: 1h)

> Implement concurrent session verifier
> -------------------------------------
>
>                 Key: KNOX-2777
>                 URL: https://issues.apache.org/jira/browse/KNOX-2777
>             Project: Apache Knox
>          Issue Type: Sub-task
>          Components: Server
>    Affects Versions: 2.0.0
>            Reporter: Sandor Molnar
>            Priority: Major
>             Fix For: 2.0.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> The following needs to be implemented in the scope of this JIRA:
>  * we need 4 new Gateway-level configurations:
>  ** privileged user list (defaults to an empty collection)
>  ** non-privileged user list (defaults to an empty collection)
>  ** session limit for privileged users (defaults to 3)
>  ** session limit for non-privileged users (defaults to 2)
>  * In addition to the new configs, a verifier has to be implemented that 
> enforces the following business logic: if a user is listed in the 
> above-introduced privileged/non-privileged collection AND is about to pass a 
> configured session limit the verification should fail. The verification 
> should succeed if the given user is declared neither a privileged nor a 
> non-privileged user.
> The new verifier implementation may be placed in the {{gateway-util-common}} 
> project for now.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to