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

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

                Author: ASF GitHub Bot
            Created on: 18/Nov/21 17:27
            Start Date: 18/Nov/21 17:27
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on a change in pull request #3849:
URL: https://github.com/apache/activemq-artemis/pull/3849#discussion_r752456648



##########
File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/balancing/targets/TargetResult.java
##########
@@ -0,0 +1,42 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.activemq.artemis.core.server.balancing.targets;
+
+public class TargetResult {
+
+   public static final TargetResult REFUSED_UNAVAILABLE_RESULT = new 
TargetResult(Status.REFUSED_UNAVAILABLE);
+   public static final TargetResult REFUSED_USE_ANOTHER_RESULT = new 
TargetResult(Status.REFUSED_USE_ANOTHER);
+
+   public Status status;
+   public Target target;
+
+   public TargetResult(Target t) {
+      this.target = t;
+      this.status = Status.OK;
+   }
+
+   private TargetResult(Status s) {
+      this.status = s;

Review comment:
       Probably shouldnt allow 'OK' status this way.

##########
File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/balancing/targets/TargetResult.java
##########
@@ -0,0 +1,42 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.activemq.artemis.core.server.balancing.targets;
+
+public class TargetResult {
+
+   public static final TargetResult REFUSED_UNAVAILABLE_RESULT = new 
TargetResult(Status.REFUSED_UNAVAILABLE);
+   public static final TargetResult REFUSED_USE_ANOTHER_RESULT = new 
TargetResult(Status.REFUSED_USE_ANOTHER);
+
+   public Status status;
+   public Target target;

Review comment:
       Should be private, the constants shouldnt be easily mutable.

##########
File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
##########
@@ -211,12 +211,13 @@ public void init(AMQPSessionContext protonSession, 
SASLResult saslResult) throws
                                                            true, //boolean xa,
                                                            (String) null, 
this, true, operationContext, manager.getPrefixes(), 
manager.getSecurityDomain());
       } else {
+         final String validatedUser = manager.getServer().validateUser(user, 
passcode, protonSPI.getProtonConnectionDelegate(), manager.getSecurityDomain());

Review comment:
       Unless there is only a single session callback created per connection 
(doesnt look that way) then this still doesnt feel right. Auth is per 
connection so it doesnt seem it should need to be doing this for each session 
creation. This method even takes and uses a connection SASLResult, which it 
presumably had to get from somewhere that should already have done this.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 683488)
    Time Spent: 3h 20m  (was: 3h 10m)

> Broker balancer based on authenticated user role assignment
> -----------------------------------------------------------
>
>                 Key: ARTEMIS-3569
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3569
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: balancer
>    Affects Versions: 2.19.0
>            Reporter: Gary Tully
>            Assignee: Gary Tully
>            Priority: Major
>             Fix For: 2.20.0
>
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> following up on ARTEMIS-3365 for the local target path.
> add support for ROLE_NAME as a targetKey.
> Matching one of the Roles of an authenticated principal associated with a 
> connection, accept or reject the connection based on some partition policy 
> based on the role.
> Using the existing regular expression based filter, it is possible to ensure 
> a sub set of roles are associated with a given broker.
> The symmeteric-simple-example that uses the client id key type can be 
> extended to support partitioning on role assignment, the configuration, to 
> use role names that begin with "PARTITION_"  and match "PARTITION_FOO" to 
> this broker, would be of the form:
> {code:java}
> <broker-balancer name="symmetric-simple-role">
>       <target-key>ROLE_NAME</target-key>
>       <target-key-filter>^PARTITION_*</target-key-filter>
>       <local-target-filter>^PARTITION_FOO.*</local-target-filter>
> </broker-balancer> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to