Package org.yamcs.security
Class RemoteUserAuthModule
java.lang.Object
org.yamcs.security.AbstractHttpRequestAuthModule
org.yamcs.security.RemoteUserAuthModule
- All Implemented Interfaces:
AuthModule
AuthModule that identifies users based on an HTTP header property. This can be used when Yamcs is well-protected from
spoofing attempts and authentication is done on a reverse proxy, like Apache or Nginx.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.yamcs.security.AbstractHttpRequestAuthModule
AbstractHttpRequestAuthModule.HttpRequestToken -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAuthenticationInfo(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request) getAuthorizationInfo(AuthenticationInfo authenticationInfo) Retrieve access control information based on the given AuthenticationInfo.getSpec()Returns the valid configuration of the input args of this AuthModule.booleanhandles(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request) Returns true if this AuthModule is capable of handling the given HTTP request.voidinit(YConfiguration args) Initialize this AuthModule.booleanverifyValidity(AuthenticationInfo authenticationInfo) Verify if previously generated authentication info is (still) valid.Methods inherited from class org.yamcs.security.AbstractHttpRequestAuthModule
getAuthenticationInfoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.yamcs.security.AuthModule
authenticationSucceeded
-
Field Details
-
OPTION_HEADER
- See Also:
-
-
Constructor Details
-
RemoteUserAuthModule
public RemoteUserAuthModule()
-
-
Method Details
-
getSpec
Description copied from interface:AuthModuleReturns the valid configuration of the input args of this AuthModule.- Returns:
- the argument specification.
-
getHeader
-
init
Description copied from interface:AuthModuleInitialize this AuthModule.- Parameters:
args- The configured arguments for this AuthModule. IfAuthModule.getSpec()is implemented then this contains the arguments after being validated (including any defaults).- Throws:
InitException- When something goes wrong during the execution of this method.
-
handles
public boolean handles(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request) Description copied from class:AbstractHttpRequestAuthModuleReturns true if this AuthModule is capable of handling the given HTTP request.- Specified by:
handlesin classAbstractHttpRequestAuthModule
-
getAuthenticationInfo
public AuthenticationInfo getAuthenticationInfo(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request) throws AuthenticationException - Specified by:
getAuthenticationInfoin classAbstractHttpRequestAuthModule- Throws:
AuthenticationException
-
getAuthorizationInfo
public AuthorizationInfo getAuthorizationInfo(AuthenticationInfo authenticationInfo) throws AuthorizationException Description copied from interface:AuthModuleRetrieve access control information based on the given AuthenticationInfo. This AuthenticationInfo may have been generated by a different AuthModule.- Returns:
- an info object containing role/privilege information of the subject
- Throws:
AuthorizationException
-
verifyValidity
Description copied from interface:AuthModuleVerify if previously generated authentication info is (still) valid. For example, if the authentication info references an externally issued expiring ticket, this can be validated here.This method is called very frequently, so implementations must take care to limit external requests.
- Parameters:
authenticationInfo- information relevant to the authentication process- Returns:
- true if the authentication info is valid, false otherwise
-