public class Privilege extends Object
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<AuthenticationToken> |
authenticateHttp(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req) |
AuthModule |
getAuthModule() |
String |
getAuthModuleName() |
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)
Get packet names this user has appropriate privileges for.
|
User |
getUser(AuthenticationToken authToken) |
String |
getUsername(AuthenticationToken authToken) |
boolean |
hasPrivilege(AuthenticationToken authenticationToken,
PrivilegeType type,
String privilege) |
boolean |
hasPrivilege(AuthenticationToken authenticationToken,
SystemPrivilege privilege) |
boolean |
hasPrivilege1(AuthenticationToken authenticationToken,
PrivilegeType type,
String privilege)
Like the method above but instead of throwing InvalidAuthenticationToken, it returns false in case the token is
not valid.
|
boolean |
hasPrivilege1(AuthenticationToken authToken,
SystemPrivilege sysPrivilege)
Like above but instead of throwing InvalidAuthenticationToken, it returns false if the token is not valid.
|
boolean |
hasRole(AuthenticationToken authenticationToken,
String role)
Convenience method, check if user has specific role.
|
boolean |
isEnabled() |
public 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, PrivilegeType type, String privilege) throws InvalidAuthenticationToken
authenticationToken - type - privilege - a opsname of tc, tm parameter or tm packetInvalidAuthenticationTokenpublic boolean hasPrivilege1(AuthenticationToken authenticationToken, PrivilegeType type, String privilege)
authenticationToken - type - privilege - public boolean hasPrivilege(AuthenticationToken authenticationToken, SystemPrivilege privilege) throws InvalidAuthenticationToken
authenticationToken - privilege - InvalidAuthenticationTokenpublic boolean hasPrivilege1(AuthenticationToken authToken, SystemPrivilege sysPrivilege)
authToken - sysPrivilege - public String getAuthModuleName()
public String getDefaultUser()
public Collection<String> getTmPacketNames(String yamcsInstance, AuthenticationToken authToken) throws ConfigurationException
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 CompletableFuture<AuthenticationToken> authenticateHttp(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest req)
Copyright © 2018 Space Applications Services. All rights reserved.