-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
271 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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.spi.core.security; | ||
|
||
import java.util.Set; | ||
|
||
import org.apache.activemq.artemis.core.security.CheckType; | ||
import org.apache.activemq.artemis.core.security.Role; | ||
|
||
/** | ||
* Used to validate whether a user is authorized to connect to the | ||
* server and perform certain functions on certain destinations. | ||
* | ||
* This is an evolution of {@link ActiveMQSecurityManager} that adds | ||
* the ability to perform authorization taking the destination address | ||
* into account. | ||
*/ | ||
public interface ActiveMQSecurityManager2 extends ActiveMQSecurityManager { | ||
|
||
/** | ||
* Determine whether the given user is valid and whether they have | ||
* the correct role for the given destination address. | ||
* | ||
* This method is called instead of | ||
* {@link ActiveMQSecurityManager.validateUserAndRole}. | ||
* | ||
* @param user the user | ||
* @param password the user's password | ||
* @param roles the user's roles | ||
* @param checkType which permission to validate | ||
* @param address the address for which to perform authorization | ||
* @return true if the user is valid and they have the correct roles for the given destination address | ||
*/ | ||
boolean validateUserAndRole(String user, String password, Set<Role> roles, CheckType checkType, String address); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters