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
-
Field Summary
Fields inherited from class org.elasticsearch.xpack.security.tool.BaseRunAsSuperuserCommand
urlOptionFields inherited from class org.elasticsearch.cli.Command
description, parser -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecuteCommand(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 voidprotected voidvalidate(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
executeMethods inherited from class org.elasticsearch.common.cli.KeyStoreAwareCommand
decryptKeyStore, readPasswordMethods inherited from class org.elasticsearch.common.cli.EnvironmentAwareCommand
createEnv, createEnv, executeMethods inherited from class org.elasticsearch.cli.Command
addShutdownHook, close, exit, main, mainWithoutErrorHandling, printAdditionalHelp, printUserException
-
Method Details
-
main
- 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:BaseRunAsSuperuserCommandThis method is called before we attempt to crete a temporary superuser in the file realm. Commands that implementBaseRunAsSuperuserCommandcan 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:
validatein classBaseRunAsSuperuserCommand- 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:BaseRunAsSuperuserCommandThis 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:
executeCommandin classBaseRunAsSuperuserCommand- Throws:
Exception
-