Interface Authorizer
- 
public interface AuthorizerProvides the interface for authorizing a user per request.- Author:
 - Marc de Lignie
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Bytecodeauthorize(AuthenticatedUser user, Bytecode bytecode, Map<String,String> aliases)Checks whether a user is authorized to have a gremlin bytecode request from a client answered and raises anAuthorizationExceptionif this is not the case.voidauthorize(AuthenticatedUser user, RequestMessage msg)Checks whether a user is authorized to have a script request from a gremlin client answered and raises anAuthorizationExceptionif this is not the case.voidsetup(Map<String,Object> config)This method is called once upon system startup to initialize theAuthorizer. 
 - 
 
- 
- 
Method Detail
- 
setup
void setup(Map<String,Object> config) throws AuthorizationException
This method is called once upon system startup to initialize theAuthorizer.- Throws:
 AuthorizationException
 
- 
authorize
Bytecode authorize(AuthenticatedUser user, Bytecode bytecode, Map<String,String> aliases) throws AuthorizationException
Checks whether a user is authorized to have a gremlin bytecode request from a client answered and raises anAuthorizationExceptionif this is not the case. The returned bytecde is used for further processing of the request.- Parameters:
 user-AuthenticatedUserthat needs authorization.bytecode- The gremlinBytecoderequest to authorize the user for.aliases- AMapwith a single key/value pair that maps the name of theTraversalSourcein theBytecoderequest to name of one configured in Gremlin Server.- Returns:
 - The original or modified 
Bytecodeto be used for further processing. - Throws:
 AuthorizationException
 
- 
authorize
void authorize(AuthenticatedUser user, RequestMessage msg) throws AuthorizationException
Checks whether a user is authorized to have a script request from a gremlin client answered and raises anAuthorizationExceptionif this is not the case.- Parameters:
 user-AuthenticatedUserthat needs authorization.msg-RequestMessagein which theTokens.ARGS_GREMLIN argument can contain an arbitrary succession of script statements.- Throws:
 AuthorizationException
 
 - 
 
 -