public interface AuthStore extends org.apache.kafka.common.Configurable, Closeable
The reader for this store is started when the store is configured. Configurable.configure(Map)
returns only after the cache associated with this store is populated with the existing contents
of this store. Note that broker does not start any external listeners until this store is
configured and the cache is initialized, so Configurable.configure(Map)
should return immediately
after initialization completes. The cache must be initialized to contain existing LDAP and RBAC
metadata to avoid unexpected authorization exceptions during broker start up. In a single-cluster
set up, this store must be configured to use the inter-broker listener to read the auth topic
since external listeners are not started until after the cache is populated.
Modifier and Type | Method and Description |
---|---|
Collection<URL> |
activeNodeUrls(String protocol)
Returns the collection of URLS of currently active nodes.
|
static void |
addInstance(String brokerSessionUuid,
AuthStore store,
org.slf4j.Logger log) |
AuthCache |
authCache()
Returns a cache that stores all data read from the auth topic.
|
static AuthStore |
getInstance(String brokerSessionUuid) |
boolean |
isMasterWriter()
Returns true if this node is currently the master writer.
|
Integer |
masterWriterId()
Returns the broker id of the master writer.
|
URL |
masterWriterUrl(String protocol)
Returns the URL of the master writer node for the specified protocol.
|
static void |
removeInstance(String brokerSessionUuid,
AuthStore store,
org.slf4j.Logger log) |
CompletionStage<Void> |
startReader()
Starts the metadata reader and returns a completion stage that is completed when
existing metadata from the store has been loaded into the cache.
|
CompletionStage<Void> |
startService(Collection<URL> serverUrls)
Starts the metadata coordinator and writer.
|
io.confluent.security.trustservice.store.TrustCache |
trustCache()
Returns a trust cache that stores all OAuth related metadata from the auth topic.
|
AuthWriter |
writer()
Returns a writer instance that can be used to update this store.
|
static void addInstance(String brokerSessionUuid, AuthStore store, org.slf4j.Logger log)
static void removeInstance(String brokerSessionUuid, AuthStore store, org.slf4j.Logger log)
CompletionStage<Void> startReader()
CompletionStage<Void> startService(Collection<URL> serverUrls)
serverUrls
- The URLs of metadata server hosting this store. Metadata server URLs must be
unique across the cluster since they are used as node ids for master writer
election. The URLs are also used for redirection of update requests to the
current master writer of the metadata service.AuthCache authCache()
io.confluent.security.trustservice.store.TrustCache trustCache()
AuthWriter writer()
boolean isMasterWriter()
URL masterWriterUrl(String protocol)
protocol
- The protocol for which master writer is requested, e.g. httpsIllegalStateException
- if writing is not enabled on this storeInteger masterWriterId()
IllegalStateException
- if writing is not enabled on this storeCollection<URL> activeNodeUrls(String protocol)
protocol
- The protocol for which node urls are requested, e.g. httpsIllegalStateException
- if metadata service was not started using
startService(Collection)