org.apache.tinkerpop.gremlin.server.authz

## 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 and Description
    --- | ---
    `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 an `AuthorizationException` if this is not the case.
    `void` | `authorize(AuthenticatedUser user, RequestMessage msg)` Checks whether a user is authorized to have a script request from a gremlin client answered and raises an `AuthorizationException` if this is not the case.
    `void` | `setup(Map<String,Object> config)` This method is called once upon system startup to initialize the `Authorizer`.

- - ### Method Detail

    - #### setup

          void setup(Map<String,Object> config)
              throws AuthorizationException

      This method is called once upon system startup to initialize the `Authorizer`.
      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 an `AuthorizationException` 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 gremlin `Bytecode` request to authorize the user for.
        `aliases` - A `Map` with a single key/value pair that maps the name of the `TraversalSource` in the `Bytecode` 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 an `AuthorizationException` if this is not the case.
      Parameters:
        `user` - `AuthenticatedUser` that needs authorization.
        `msg` - `RequestMessage` in which the `Tokens`.ARGS_GREMLIN argument can contain an arbitrary succession of script statements.
      Throws:
        `AuthorizationException`

Copyright © 2013–2021 Apache Software Foundation. All rights reserved.