Class CreateEnrollmentTokenTool

java.lang.Object
org.elasticsearch.cli.Command
org.elasticsearch.common.cli.EnvironmentAwareCommand
org.elasticsearch.common.cli.KeyStoreAwareCommand
org.elasticsearch.xpack.security.tool.BaseRunAsSuperuserCommand
org.elasticsearch.xpack.security.enrollment.tool.CreateEnrollmentTokenTool
All Implemented Interfaces:
Closeable, AutoCloseable

public class CreateEnrollmentTokenTool extends BaseRunAsSuperuserCommand
  • Field Summary

    Fields inherited from class org.elasticsearch.xpack.security.tool.BaseRunAsSuperuserCommand

    urlOption

    Fields inherited from class org.elasticsearch.cli.Command

    description, parser
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    executeCommand(org.elasticsearch.cli.Terminal terminal, joptsimple.OptionSet options, org.elasticsearch.env.Environment env, String username, org.elasticsearch.common.settings.SecureString password)
    This is called after we have created a temporary superuser in the file realm and verified that its credentials work.
    static void
    main(String[] args)
     
    protected void
    validate(org.elasticsearch.cli.Terminal terminal, joptsimple.OptionSet options, org.elasticsearch.env.Environment env)
    This method is called before we attempt to crete a temporary superuser in the file realm.

    Methods inherited from class org.elasticsearch.xpack.security.tool.BaseRunAsSuperuserCommand

    execute

    Methods inherited from class org.elasticsearch.common.cli.KeyStoreAwareCommand

    decryptKeyStore, readPassword

    Methods inherited from class org.elasticsearch.common.cli.EnvironmentAwareCommand

    createEnv, createEnv, execute

    Methods inherited from class org.elasticsearch.cli.Command

    addShutdownHook, close, exit, main, mainWithoutErrorHandling, printAdditionalHelp, printUserException

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception
    • validate

      protected void validate(org.elasticsearch.cli.Terminal terminal, joptsimple.OptionSet options, org.elasticsearch.env.Environment env) throws Exception
      Description copied from class: BaseRunAsSuperuserCommand
      This method is called before we attempt to crete a temporary superuser in the file realm. Commands that implement BaseRunAsSuperuserCommand can do preflight checks such as parsing and validating options without the need to go through the process of attempting to create and remove the temporary user unnecessarily.
      Specified by:
      validate in class BaseRunAsSuperuserCommand
      Throws:
      Exception
    • executeCommand

      protected void executeCommand(org.elasticsearch.cli.Terminal terminal, joptsimple.OptionSet options, org.elasticsearch.env.Environment env, String username, org.elasticsearch.common.settings.SecureString password) throws Exception
      Description copied from class: BaseRunAsSuperuserCommand
      This is called after we have created a temporary superuser in the file realm and verified that its credentials work. The username and password of the generated user are passed as parameters. Overriding methods should not try to close the password.
      Specified by:
      executeCommand in class BaseRunAsSuperuserCommand
      Throws:
      Exception