test_class.declarator: authenticator
test_class.modifier: private
test_class.original_string: private Authenticator authenticator;
test_class.type: Authenticator
test_class.var_name: authenticator
test_class.file: gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticatorTest.java
test_class.identifier: SimpleAuthenticatorTest
test_case.body: @Test(expected = IllegalArgumentException.class)
      public void shouldNotAllowNullConfigInSetup() {
          authenticator.setup(null);
      }
test_case.class_method_signature: SimpleAuthenticatorTest.shouldNotAllowNullConfigInSetup()
test_case.full_signature: @Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullConfigInSetup()
test_case.identifier: shouldNotAllowNullConfigInSetup
test_case.invocations: setup
test_case.modifiers: @Test(expected = IllegalArgumentException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldNotAllowNullConfigInSetup()
focal_class.declarator: logger = LoggerFactory.getLogger(SimpleAuthenticator.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(SimpleAuthenticator.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: NUL = 0
focal_class.modifier: private static final
focal_class.original_string: private static final byte NUL = 0;
focal_class.type: byte
focal_class.var_name: NUL
focal_class.declarator: credentialStore
focal_class.modifier: private
focal_class.original_string: private CredentialGraph credentialStore;
focal_class.type: CredentialGraph
focal_class.var_name: credentialStore
focal_class.declarator: CONFIG_CREDENTIALS_LOCATION = "credentialsDbLocation"
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_CREDENTIALS_LOCATION = "credentialsDbLocation";
focal_class.type: String
focal_class.var_name: CONFIG_CREDENTIALS_LOCATION
focal_class.declarator: CONFIG_CREDENTIALS_DB = "credentialsDb"
focal_class.modifier: public static final
focal_class.original_string: public static final String CONFIG_CREDENTIALS_DB = "credentialsDb";
focal_class.type: String
focal_class.var_name: CONFIG_CREDENTIALS_DB
focal_class.file: gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java
focal_class.identifier: SimpleAuthenticator
focal_class.interfaces: implements Authenticator
focal_class.class_method_signature: SimpleAuthenticator.requireAuthentication()
focal_class.full_signature: @Override public boolean requireAuthentication()
focal_class.identifier: requireAuthentication
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean requireAuthentication()
focal_class.class_method_signature: SimpleAuthenticator.setup(final Map<String,Object> config)
focal_class.full_signature: @Override public void setup(final Map<String,Object> config)
focal_class.identifier: setup
focal_class.modifiers: @Override public
focal_class.parameters: (final Map<String,Object> config)
focal_class.return: void
focal_class.signature: void setup(final Map<String,Object> config)
focal_class.class_method_signature: SimpleAuthenticator.newSaslNegotiator()
focal_class.full_signature: @Override @Deprecated public SaslNegotiator newSaslNegotiator()
focal_class.identifier: newSaslNegotiator
focal_class.modifiers: @Override @Deprecated public
focal_class.parameters: ()
focal_class.return: SaslNegotiator
focal_class.signature: SaslNegotiator newSaslNegotiator()
focal_class.class_method_signature: SimpleAuthenticator.authenticate(final Map<String, String> credentials)
focal_class.full_signature: public AuthenticatedUser authenticate(final Map<String, String> credentials)
focal_class.identifier: authenticate
focal_class.modifiers: public
focal_class.parameters: (final Map<String, String> credentials)
focal_class.return: AuthenticatedUser
focal_class.signature: AuthenticatedUser authenticate(final Map<String, String> credentials)
focal_method.body: @Override
      public void setup(final Map<String,Object> config) {
          logger.info("Initializing authentication with the {}", SimpleAuthenticator.class.getName());
  
          if (null == config) {
              throw new IllegalArgumentException(String.format(
                      "Could not configure a %s - provide a 'config' in the 'authentication' settings",
                      SimpleAuthenticator.class.getName()));
          }
  
          if (!config.containsKey(CONFIG_CREDENTIALS_DB)) {
              throw new IllegalStateException(String.format(
                      "Credentials configuration missing the %s key that points to a graph config file", CONFIG_CREDENTIALS_DB));
          }
  
          final Graph graph = GraphFactory.open((String) config.get(CONFIG_CREDENTIALS_DB));
  
          if (graph instanceof TinkerGraph) {
              // have to create the indices because they are not stored in gryo
              final TinkerGraph tinkerGraph = (TinkerGraph) graph;
              tinkerGraph.createIndex(PROPERTY_USERNAME, Vertex.class);
  
              // we deprecated credentialsLocation, but we still need to support it.  if it is present as a key, we can
              // load the data as we always did.
              if (config.containsKey(CONFIG_CREDENTIALS_LOCATION)) {
                  logger.warn("Using {} configuration option which is deprecated - prefer including the location of the credentials graph data in the TinkerGraph config file.");
                  final String location = (String) config.get(CONFIG_CREDENTIALS_LOCATION);
                  try {
                      tinkerGraph.io(IoCore.gryo()).readGraph(location);
                  } catch (IOException e) {
                      logger.warn("Could not read credentials graph from {} - authentication is enabled, but with an empty user database", location);
                  }
              }
          }
  
          credentialStore = CredentialGraph.credentials(graph);
          logger.info("CredentialGraph initialized at {}", credentialStore);
      }
focal_method.class_method_signature: SimpleAuthenticator.setup(final Map<String,Object> config)
focal_method.full_signature: @Override public void setup(final Map<String,Object> config)
focal_method.identifier: setup
focal_method.invocations: info getName format getName containsKey format open get createIndex containsKey warn get readGraph io gryo warn credentials info
focal_method.modifiers: @Override public
focal_method.parameters: (final Map<String,Object> config)
focal_method.return: void
focal_method.signature: void setup(final Map<String,Object> config)