Class BurpRuntimeMetadata

java.lang.Object
ai.attackframework.tools.burp.utils.BurpRuntimeMetadata

public final class BurpRuntimeMetadata extends Object
Caches stable Burp metadata used by async exporters.

Background reporters should prefer this helper over probing Burp sub-APIs on every export cycle. That avoids repeated lifecycle-sensitive calls during extension startup, shutdown, or project transitions, while still allowing the cache to be primed from a known good MontoyaApi instance.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Stable fallback project identifier used when Burp does not expose a project id.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Returns the cached Burp version, resolving it lazily when needed.
    static void
    Clears all cached metadata.
    static void
    prime(burp.api.montoya.MontoyaApi api)
    Primes cached metadata from the provided API when values are not already known.
    static String
    Returns the cached Burp project id, resolving it lazily when needed.
    static String
    Returns the cached project id, or a stable fallback label when unavailable.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • UNKNOWN_PROJECT_ID

      public static final String UNKNOWN_PROJECT_ID
      Stable fallback project identifier used when Burp does not expose a project id.
      See Also:
  • Method Details

    • prime

      public static void prime(burp.api.montoya.MontoyaApi api)
      Primes cached metadata from the provided API when values are not already known.

      Safe to call multiple times. Failures are swallowed because callers use this helper to avoid turning lifecycle races into user-visible errors.

      Parameters:
      api - current Montoya API handle; ignored when null
    • burpVersion

      public static String burpVersion()
      Returns the cached Burp version, resolving it lazily when needed.

      When the value cannot be resolved safely, returns null.

      Returns:
      Burp version string, or null when unavailable
    • projectId

      public static String projectId()
      Returns the cached Burp project id, resolving it lazily when needed.

      When the value cannot be resolved safely, returns null.

      Returns:
      Burp project id, or null when unavailable
    • projectIdOrUnknown

      public static String projectIdOrUnknown()
      Returns the cached project id, or a stable fallback label when unavailable.
    • clear

      public static void clear()
      Clears all cached metadata.