Class GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder
java.lang.Object
org.springframework.vault.authentication.GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder
- Enclosing class:
- GcpIamCredentialsAuthenticationOptions
public static class GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder
extends Object
Builder for
GcpIamCredentialsAuthenticationOptions.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a newGcpIamCredentialsAuthenticationOptionsinstance.Configure theClockused to calculate epoch seconds until the JWT expiration.credentials(com.google.auth.oauth2.GoogleCredentials credentials) Configure static Google credentials, required to create a signed JWT.credentialsSupplier(GoogleCredentialsSupplier credentialsSupplier) Configure aGoogleCredentialsSupplier, required to create a signed JWT.jwtValidity(Duration jwtValidity) Configure theDurationfor the JWT expiration.Configure the mount path, defaults to aws.Configure the name of the role against which the login is being attempted.serviceAccountId(String serviceAccountId) Configure an explicit service account id to use in GCP IAM calls.
-
Method Details
-
path
public GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder path(String path) Configure the mount path, defaults to aws.- Parameters:
path- must not be empty or null.- Returns:
thisGcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder.
-
credentials
public GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder credentials(com.google.auth.oauth2.GoogleCredentials credentials) Configure static Google credentials, required to create a signed JWT. Either use static credentials or provide acredentials provider.- Parameters:
credentials- must not be null.- Returns:
thisGcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder.- See Also:
-
credentialsSupplier
public GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder credentialsSupplier(GoogleCredentialsSupplier credentialsSupplier) Configure aGoogleCredentialsSupplier, required to create a signed JWT. Alternatively, configure staticcredentials.- Parameters:
credentialsSupplier- must not be null.- Returns:
thisGcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder.- See Also:
-
serviceAccountId
public GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder serviceAccountId(String serviceAccountId) Configure an explicit service account id to use in GCP IAM calls. If none is configured, falls back to usingServiceAccountCredentials.getAccount().- Parameters:
serviceAccountId- the service account id (email) to use- Returns:
thisGcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder.- Since:
- 2.1
-
role
public GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder role(String role) Configure the name of the role against which the login is being attempted.- Parameters:
role- must not be empty or null.- Returns:
thisGcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder.
-
jwtValidity
public GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder jwtValidity(Duration jwtValidity) Configure theDurationfor the JWT expiration. This defaults to 15 minutes and cannot be more than a hour.- Parameters:
jwtValidity- must not be null.- Returns:
thisGcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder.
-
clock
public GcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder clock(Clock clock) Configure theClockused to calculate epoch seconds until the JWT expiration.- Parameters:
clock- must not be null.- Returns:
thisGcpIamCredentialsAuthenticationOptions.GcpIamCredentialsAuthenticationOptionsBuilder.
-
build
Build a newGcpIamCredentialsAuthenticationOptionsinstance.- Returns:
- a new
GcpIamCredentialsAuthenticationOptions.
-