Interface Authorizer
-
public interface Authorizer
Provides 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 void
authorize(AuthenticatedUser user, RequestMessage msg)
Checks whether a user is authorized to have a script request from a gremlin client answered and raises anAuthorizationException
if this is not the case.Bytecode
authorize(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 anAuthorizationException
if this is not the case.void
setup(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 anAuthorizationException
if this is not the case. The returned bytecde is used for further processing of the request.- Parameters:
user
-AuthenticatedUser
that needs authorization.bytecode
- The gremlinBytecode
request to authorize the user for.aliases
- AMap
with a single key/value pair that maps the name of theTraversalSource
in theBytecode
request to name of one configured in Gremlin Server.- Returns:
- The original or modified
Bytecode
to 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 anAuthorizationException
if this is not the case.- Parameters:
user
-AuthenticatedUser
that needs authorization.msg
-RequestMessage
in which theTokens
.ARGS_GREMLIN argument can contain an arbitrary succession of script statements.- Throws:
AuthorizationException
-
-