public class Privilege extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Privilege.SystemPrivilege |
static class |
Privilege.Type |
| Modifier and Type | Field and Description |
|---|---|
static Privilege |
instance |
static int |
maxNoSessions |
static boolean |
usePrivileges |
| Modifier | Constructor and Description |
|---|---|
protected |
Privilege()
loads the configuration of the privilege.
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<AuthenticationToken> |
authenticateHttp(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req) |
org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager |
getArtemisAuthModule() |
AuthModule |
getAuthModule() |
static String |
getAuthModuleName() |
static String |
getDefaultUser()
Returns the default user if this server is unsecured.
|
static Privilege |
getInstance() |
int |
getMaxNoSessions() |
String[] |
getRoles(AuthenticationToken authenticationToken) |
Collection<String> |
getTmPacketNames(String yamcsInstance,
AuthenticationToken authToken,
String namespace)
Get packet names this user has appropriate privileges for.
|
Collection<String> |
getTmParameterNames(String yamcsInstance,
AuthenticationToken authToken,
String namespace)
Get parameter names this user has appropriate privileges for.
|
User |
getUser(AuthenticationToken authToken) |
String |
getUsername(AuthenticationToken authToken) |
boolean |
hasPrivilege(AuthenticationToken authenticationToken,
Privilege.SystemPrivilege privilege) |
boolean |
hasPrivilege(AuthenticationToken authenticationToken,
Privilege.Type type,
String privilege) |
boolean |
hasPrivilege1(AuthenticationToken authToken,
Privilege.SystemPrivilege sysPrivilege)
Like above but instead of throwing InvalidAuthenticationToken, it returns false if the token is not valid.
|
boolean |
hasPrivilege1(AuthenticationToken authenticationToken,
Privilege.Type type,
String privilege)
Like the method above but instead of throwing InvalidAuthenticationToken, it returns false in case the token is not valid.
|
boolean |
hasRole(AuthenticationToken authenticationToken,
String role)
Convenience method, check if user has specific role.
|
boolean |
isEnabled() |
public static boolean usePrivileges
public static int maxNoSessions
public static Privilege instance
protected Privilege()
throws ConfigurationException
ConfigurationException - when the privileges.enabled is not set to false and the ldap
parammeters are not presentpublic String[] getRoles(AuthenticationToken authenticationToken) throws InvalidAuthenticationToken
InvalidAuthenticationTokenpublic static Privilege getInstance()
public boolean isEnabled()
public boolean hasRole(AuthenticationToken authenticationToken, String role) throws InvalidAuthenticationToken
authenticationToken - role - Title or full dn.InvalidAuthenticationTokenpublic boolean hasPrivilege(AuthenticationToken authenticationToken, Privilege.Type type, String privilege) throws InvalidAuthenticationToken
authenticationToken - type - privilege - a opsname of tc, tm parameter or tm packetInvalidAuthenticationTokenpublic boolean hasPrivilege1(AuthenticationToken authenticationToken, Privilege.Type type, String privilege)
authenticationToken - type - privilege - public boolean hasPrivilege(AuthenticationToken authenticationToken, Privilege.SystemPrivilege privilege) throws InvalidAuthenticationToken
authenticationToken - privilege - InvalidAuthenticationTokenpublic boolean hasPrivilege1(AuthenticationToken authToken, Privilege.SystemPrivilege sysPrivilege)
authToken - sysPrivilege - public static String getAuthModuleName()
public static String getDefaultUser()
public Collection<String> getTmPacketNames(String yamcsInstance, AuthenticationToken authToken, String namespace) throws ConfigurationException, InvalidAuthenticationToken
yamcsInstance - Used to get MDB.authToken - namespace - If null defaults to "MDB:OPS Name"ConfigurationExceptionInvalidAuthenticationTokenpublic Collection<String> getTmParameterNames(String yamcsInstance, AuthenticationToken authToken, String namespace) throws ConfigurationException, InvalidAuthenticationToken
yamcsInstance - Used to get MDB.authToken - namespace - If null defaults to "MDB:OPS Name"ConfigurationExceptionInvalidAuthenticationTokenpublic int getMaxNoSessions()
public String getUsername(AuthenticationToken authToken)
public User getUser(AuthenticationToken authToken)
public AuthModule getAuthModule()
public org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager getArtemisAuthModule()
public CompletableFuture<AuthenticationToken> authenticateHttp(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest req)
Copyright © 2017 Space Applications Services. All rights reserved.