Class HarnessCliLoginTracker

java.lang.Object
hudson.model.InvisibleAction
io.jenkins.plugins.har.cli.HarnessCliLoginTracker
All Implemented Interfaces:
Action, ModelObject

public class HarnessCliLoginTracker extends InvisibleAction
Build action that records which agents have already run hc auth login for this build.

Auth state for the Harness CLI lives on each agent (e.g. ~/.harness/auth.json), so login must be tracked per node — not once for the whole Run.

Also stores the binary path and workspace used on each agent so logout can run on every agent that logged in.

  • Constructor Details

    • HarnessCliLoginTracker

      public HarnessCliLoginTracker()
  • Method Details

    • needsLogin

      public boolean needsLogin(String nodeName)
      Returns:
      true if this agent has not yet logged in for this build
    • recordLogin

      public void recordLogin(String hcBinaryPath, String workspacePath, String nodeName)
      Records a successful login on the given agent.
    • getSessions

      Returns:
      immutable snapshot of agents that logged in during this build
    • markLoggedOut

      public boolean markLoggedOut()
      Claims the logout responsibility. Returns true exactly once; subsequent calls return false so that neither the Disposer nor the RunListener runs logout twice on the same build.