Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/main/java/io/github/jopenlibs/vault/api/Auth.java
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,31 @@ public AuthResponse loginByKubernetes(final String role, final String jwt)
return loginByJwt("kubernetes", role, jwt);
}

/**
* Basic login operation to authenticate to a kubernetes backend with custom path. Example usage:
*
* <blockquote>
*
* <pre>{@code
* final AuthResponse response =
* vault.auth().loginByKubernetes("dev", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "customAuthPath");
*
* final String token = response.getAuthClientToken();
* }</pre>
* </blockquote>
*
* @param role The kubernetes role used for authentication
* @param jwt The JWT token for the role, typically read from
* /var/run/secrets/kubernetes.io/serviceaccount/token
* @param authPath The Authentication Path for Vault
* @return The auth token, with additional response metadata
* @throws VaultException If any error occurs, or unexpected response received from Vault
*/
public AuthResponse loginByKubernetes(final String role, final String jwt, final String authPath)
throws VaultException {
return loginByJwt("kubernetes", role, jwt, authPath);
}

/**
* <p>Basic login operation to authenticate using Vault's TLS Certificate auth backend.
* Example usage:</p>
Expand Down