Class SessionManager

java.lang.Object
com.mwdle.bitwarden.cli.SessionManager

public final class SessionManager extends Object
A singleton that caches a Bitwarden CLI session key to prevent API rate-limiting and improve performance.
  • Method Details

    • getInstance

      @NonNull public static SessionManager getInstance()
      Returns:
      The singleton instance of this manager.
    • isSessionValid

      public boolean isSessionValid()
      Returns:
      true if the Bitwarden session key is present.
    • invalidateSession

      public void invalidateSession()
      Invalidates the current Bitwarden CLI session.
    • getSessionKey

      @NonNull public Secret getSessionKey() throws IOException, InterruptedException
      Returns:
      a Bitwarden CLI session key
      Throws:
      InterruptedException - if the Bitwarden CLI command is interrupted
      IOException - if the login/unlock process fails