public class BasicAuthModule extends Object implements AuthModule
| Constructor and Description |
|---|
BasicAuthModule(Map<String,Object> config) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<AuthenticationToken> |
authenticateHttp(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req)
Authenticate the request and return a CompletableFuture to indicate the completion.
|
String[] |
getRoles(AuthenticationToken authenticationToken)
Get the list of roles of the user.
|
User |
getUser(AuthenticationToken authenticationToken)
returns the user authenticated by the token
|
boolean |
hasPrivilege(AuthenticationToken authenticationToken,
Privilege.Type type,
String privilege) |
boolean |
hasRole(AuthenticationToken authenticationToken,
String role) |
public String[] getRoles(AuthenticationToken authenticationToken)
AuthModulegetRoles in interface AuthModulepublic CompletableFuture<AuthenticationToken> authenticateHttp(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest req)
AuthModuleauthenticateHttp in interface AuthModulepublic User getUser(AuthenticationToken authenticationToken)
AuthModulegetUser in interface AuthModulepublic boolean hasPrivilege(AuthenticationToken authenticationToken, Privilege.Type type, String privilege)
hasPrivilege in interface AuthModuletype - privilege - a opsname of tc, tm parameter or tm packetpublic boolean hasRole(AuthenticationToken authenticationToken, String role)
hasRole in interface AuthModuleCopyright © 2018 Space Applications Services. All rights reserved.