Class AppRoleAuth

java.lang.Object
codes.grow.packages.vault.AppRoleAuth
All Implemented Interfaces:
AuthMethod

public final class AppRoleAuth extends Object implements AuthMethod
AppRole login: POST auth/<mount>/login {role_id, secret_id} (default mount approle).
  • Constructor Details

    • AppRoleAuth

      public AppRoleAuth(String roleId, String secretId)
      Creates the method on mount approle.
      Parameters:
      roleId - role id
      secretId - secret id, may be null for roles without bind_secret_id
    • AppRoleAuth

      public AppRoleAuth(String roleId, Secret secretId, String mount)
      Creates the method.
      Parameters:
      roleId - role id
      secretId - secret id, may be null
      mount - auth mount path
  • Method Details

    • mount

      public String mount()
      Returns the mount.
      Returns:
      the mount path
    • method

      public String method()
      Description copied from interface: AuthMethod
      Returns the method name, e.g. approle.
      Specified by:
      method in interface AuthMethod
      Returns:
      the name
    • login

      public CompletableFuture<AuthInfo> login(LoginContext context)
      Description copied from interface: AuthMethod
      Performs the login.
      Specified by:
      login in interface AuthMethod
      Parameters:
      context - login helpers of the client
      Returns:
      a future with the auth info
    • toString

      public String toString()
      Overrides:
      toString in class Object