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

ASF GitHub Bot logged work on ARTEMIS-2886:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Oct/20 18:42
            Start Date: 06/Oct/20 18:42
    Worklog Time Spent: 10m 
      Work Description: luisalves00 commented on pull request #3254:
URL: https://github.com/apache/activemq-artemis/pull/3254#issuecomment-704476708


   So...let me explain with the code (comments inline):
   
   ```java
   
   //best match for roles using the wildcards
   Set<Role> roles = securityRepository.getMatch(bareAddress.toString());
   ...
   if (bareQueue != null) {
      fqqn = CompositeAddress.toFullyQualified(bareAddress, bareQueue);
      if (securityRepository.containsExactMatch(fqqn.toString())) {
         //if I don't have an exact match I don't set the roles here
         //and this seems to be the main purpose of the IF, i.e. to find 
specific roles to the fqqn, no?
         roles = securityRepository.getMatch(fqqn.toString());
         isFullyQualified = true;
      }
   }
   ```
   so now calling the authorize with the code you've propose:
   
   ```java
   validated = ((ActiveMQSecurityManager5) securityManager).authorize(subject, 
roles, checkType, fqqn != null ? fqqn.toString() : bareAddress.toString());
   ```
   
   the roles passed to the method will not be the ones of the exact match, 
right?
   As I said, I don't need the roles, I'll ignore them as I'm going to get them 
from an access token, but might be important to other users that implement the 
ActiveMQSecurityManager5.
   
   
   


----------------------------------------------------------------
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: 496101)
    Time Spent: 4h 40m  (was: 4.5h)

> Optimize security auth
> ----------------------
>
>                 Key: ARTEMIS-2886
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2886
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>             Fix For: 2.16.0
>
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> Both authentication and authorization will hit the underlying security 
> repository (e.g. files, LDAP, etc.). For example, creating a JMS connection 
> and a consumer will result in 2 hits with the *same* authentication request. 
> This can cause unwanted (and unnecessary) resource utilization, especially in 
> the case of networked configuration like LDAP.
> There is a rudimentary cache for authorization, but it is cleared *totally* 
> every 10 seconds by default (controlled via the 
> {{security-invalidation-interval setting}}), and it must be populated 
> initially which still results in duplicate auth requests.



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

Reply via email to