Class DelegationTokenStore

java.lang.Object
org.apache.zookeeper.server.token.DelegationTokenStore

public final class DelegationTokenStore extends Object
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.

  • Field Details

  • Method Details

    • pathOf

      public static String pathOf(int sequenceNumber)
    • encodeEntry

      public static byte[] encodeEntry(long expiryTime, byte[] identifierBytes)
    • entryExpiry

      public static long entryExpiry(byte[] entry) throws IOException
      Throws:
      IOException
    • entryIdentifier

      public static byte[] entryIdentifier(byte[] entry) throws IOException
      Throws:
      IOException
    • keyPathOf

      public static String keyPathOf(int keyId)
    • encodeKeyEntry

      public static byte[] encodeKeyEntry(long createdTime, long expiryTime, byte[] keyBytes)
    • keyEntryCreated

      public static long keyEntryCreated(byte[] entry) throws IOException
      Throws:
      IOException
    • keyEntryExpiry

      public static long keyEntryExpiry(byte[] entry) throws IOException
      Throws:
      IOException
    • keyEntryBytes

      public static byte[] keyEntryBytes(byte[] entry) throws IOException
      Throws:
      IOException
    • saslPrincipal

      public static String saslPrincipal(List<Id> authInfo)
      Returns the SASL principal from the request auth info, or null when the session is not SASL-authenticated.
    • isSuper

      public static boolean isSuper(List<Id> authInfo)
    • isTokenAuthenticated

      public static boolean isTokenAuthenticated(List<Id> authInfo)