Package io.flipt.client.models
Class AuthenticationLease
java.lang.Object
io.flipt.client.models.AuthenticationLease
An authentication credential with an optional expiry time.
Returned by AuthenticationProvider.get() to provide both the credential and when it
expires. Use the fluent builder to create instances:
// Expiring lease (triggers refresh before expiry)
AuthenticationLease.expiring(expiresAt).jwt(token).build()
AuthenticationLease.expiring(expiresAt).jwt(token).maxRetries(3).build()
// Fixed lease (no expiry, no refresh scheduling)
AuthenticationLease.fixed().clientToken(token).build()
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for expiring leases.static classFinal build step for expiring leases with configurable retries.static classBuilder for fixed leases (no expiry, no retries).static classFinal build step for fixed leases. -
Method Summary
Modifier and TypeMethodDescriptionStarts building an expiring lease that triggers a refresh before the given expiry time.fixed()Starts building a fixed lease with no expiry.Returns the expiry time of this lease, or empty if the lease does not expire.Returns the maximum number of consecutive refresh retries, or empty for fixed leases.
-
Method Details
-
fixed
Starts building a fixed lease with no expiry. No refresh will be scheduled.- Returns:
- a builder to select the authentication type
-
expiring
Starts building an expiring lease that triggers a refresh before the given expiry time.- Parameters:
expiresAt- when this credential expires- Returns:
- a builder to select the authentication type and configure retries
-
getStrategy
-
getExpiresAt
Returns the expiry time of this lease, or empty if the lease does not expire.- Returns:
- an Optional containing the expiry time, or empty for fixed leases
-
getMaxRetries
Returns the maximum number of consecutive refresh retries, or empty for fixed leases.- Returns:
- the max retries for expiring leases, empty for fixed leases
-