Package io.lettuce.core
Interface RedisCredentialsProvider
-
- All Known Subinterfaces:
RedisCredentialsProvider.ImmediateRedisCredentialsProvider
- All Known Implementing Classes:
StaticCredentialsProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface RedisCredentialsProvider
Interface for loadingRedisCredentials
that are used for authentication. A commonly-used implementation isStaticCredentialsProvider
for a fixed set of credentials.Credentials are requested by the driver after connecting to the server. Therefore, credential retrieval is subject to complete within the connection creation timeout to avoid connection failures.
- Since:
- 6.2
- Author:
- Mark Paluch
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RedisCredentialsProvider.ImmediateRedisCredentialsProvider
Extension toRedisCredentialsProvider
that resolves credentials immediately without the need to defer the credential resolution.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static RedisCredentialsProvider
from(Supplier<RedisCredentials> supplier)
Creates a newRedisCredentialsProvider
from a givenSupplier
.Mono<RedisCredentials>
resolveCredentials()
ReturnsRedisCredentials
that can be used to authorize a Redis connection.
-
-
-
Method Detail
-
resolveCredentials
Mono<RedisCredentials> resolveCredentials()
ReturnsRedisCredentials
that can be used to authorize a Redis connection. Each implementation ofRedisCredentialsProvider
can choose its own strategy for loading credentials. For example, an implementation might load credentials from an existing key management system, or load new credentials when credentials are rotated. If an error occurs during the loading of credentials or credentials could not be found, a runtime exception will be raised.- Returns:
- a
Mono
emittingRedisCredentials
that can be used to authorize a Redis connection.
-
from
static RedisCredentialsProvider from(Supplier<RedisCredentials> supplier)
Creates a newRedisCredentialsProvider
from a givenSupplier
.- Parameters:
supplier
- must not benull
.- Returns:
- the
RedisCredentials
using credentials fromSupplier
.
-
-