Class BlockListStore

java.lang.Object
org.gridgain.internal.security.jwt.store.BlockListStore

public class BlockListStore extends Object
Store for revoked tokens and timestamps.
  • Constructor Details

    • BlockListStore

      public BlockListStore(org.apache.ignite.internal.metastorage.MetaStorageManager metaStorage, long cleanerInterval, TimeUnit cleanerIntervalUnit, org.apache.ignite.internal.security.jwt.configuration.JwtConfiguration jwtConfiguration, String nodeName)
      Constructor.
      Parameters:
      metaStorage - Meta storage manager.
      cleanerInterval - Cleaner interval in minutes.
  • Method Details

    • start

      public void start()
      Starts the store.
    • stop

      public void stop()
      Stops the store.
    • saveToken

      public CompletableFuture<Void> saveToken(String token, Instant expirationTime)
      Saves revoked token.
      Parameters:
      token - Token.
      expirationTime - Expiration time.
      Returns:
      Future that will be completed when the token is saved.
    • isTokenBlocked

      public boolean isTokenBlocked(String token)
      Returns token metadata for a given token.
      Parameters:
      token - Token.
      Returns:
      Token metadata. null if token is not blocked.
    • saveUsernameAndTimestamp

      public CompletableFuture<Void> saveUsernameAndTimestamp(String username, Instant timestampRecord)
      Saves timestamp for a given username. Timestamp is used to invalidate all tokens issued before the timestamp.
      Parameters:
      username - Username.
      timestampRecord - Timestamp.
      Returns:
      Future that will be completed when operation the timestamp is saved.
    • getTimestamp

      @Nullable public @Nullable Instant getTimestamp(String username)
      Returns saved timestamp for a given username.
      Parameters:
      username - Username.
      Returns:
      Timestamp. null if timestamp is not set.