Class DelegationTokenStore
java.lang.Object
org.apache.zookeeper.server.token.DelegationTokenStore
Layout of the delegation token store kept in the ZooKeeper data tree.
Each active token lives at /zookeeper/token/DT_<sequenceNumber>
whose data is a store entry: a version byte, the current expiry time and the
serialized identifier. The nodes are written only by the server itself
(token opcodes and expiry cleanup), replicated as ordinary create/setData/delete
transactions and persisted in snapshots like any other znode.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRead access to stored token entries, keyed by the identifier sequence number; returns null when the token is not in the store.static interfaceRead access to stored master key entries, keyed by the key id; returns null when the key is not in the store. -
Field Summary
FieldsModifier and TypeFieldDescriptionACL of the key znodes: no permissions for anyone, so only the server itself (internal reads bypass ACLs) and super sessions can see key bytes.static final Stringstatic final Stringstatic final StringAuthInfo scheme marking a session as token-authenticated.static final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]encodeEntry(long expiryTime, byte[] identifierBytes) static byte[]encodeKeyEntry(long createdTime, long expiryTime, byte[] keyBytes) static longentryExpiry(byte[] entry) static byte[]entryIdentifier(byte[] entry) static booleanstatic booleanisTokenAuthenticated(List<Id> authInfo) static byte[]keyEntryBytes(byte[] entry) static longkeyEntryCreated(byte[] entry) static longkeyEntryExpiry(byte[] entry) static StringkeyPathOf(int keyId) static StringpathOf(int sequenceNumber) static StringsaslPrincipal(List<Id> authInfo) Returns the SASL principal from the request auth info, or null when the session is not SASL-authenticated.
-
Field Details
-
TOKEN_NODE
- See Also:
-
TOKEN_NODE_PREFIX
- See Also:
-
KEY_NODE
- See Also:
-
KEY_NODE_PREFIX
- See Also:
-
KEY_ACL
ACL of the key znodes: no permissions for anyone, so only the server itself (internal reads bypass ACLs) and super sessions can see key bytes. -
TOKEN_AUTH_SCHEME
AuthInfo scheme marking a session as token-authenticated.- See Also:
-
-
Method Details
-
pathOf
-
encodeEntry
public static byte[] encodeEntry(long expiryTime, byte[] identifierBytes) -
entryExpiry
- Throws:
IOException
-
entryIdentifier
- Throws:
IOException
-
keyPathOf
-
encodeKeyEntry
public static byte[] encodeKeyEntry(long createdTime, long expiryTime, byte[] keyBytes) -
keyEntryCreated
- Throws:
IOException
-
keyEntryExpiry
- Throws:
IOException
-
keyEntryBytes
- Throws:
IOException
-
saslPrincipal
Returns the SASL principal from the request auth info, or null when the session is not SASL-authenticated. -
isSuper
-
isTokenAuthenticated
-