Class OneTimeSecretHandoff

java.lang.Object
com.kingsrook.qqq.backend.core.actions.processes.OneTimeSecretHandoff

public final class OneTimeSecretHandoff extends Object
Hands one-time secrets from a process step that finished as an ASYNC job to the first status poll that sees it complete. The middleware runs a step as a job and answers "job started" when it takes longer than its step timeout (3 s by default), so without this a slow key-producing step would lose its secret. Held in this JVM's memory only, keyed by process UUID (status polls are already restricted to the process's own user), never written to process state, traces or listeners, removed on the first take, and dropped after a short time-to-live. A poll that reaches another server instance finds nothing, which is the documented "shown once, else rotate" outcome.
  • Field Details

    • TIME_TO_LIVE

      public static final Duration TIME_TO_LIVE
      How long an untaken secret is kept.
  • Method Details

    • offer

      public static void offer(String processUUID, List<OneTimeSecret> secrets)
      Park a finished run's secrets for its process UUID (no-op when none).
    • take

      public static List<OneTimeSecret> take(String processUUID)
      Take (and forget) the secrets parked for a process UUID; empty when none, already taken, or expired.