Class FleetConsoleServer.Builder

java.lang.Object
ai.badmonkey.agentspaces.console.FleetConsoleServer.Builder
Enclosing class:
FleetConsoleServer

public static final class FleetConsoleServer.Builder extends Object
Assembles a FleetConsoleServer.
  • Method Details

    • allowOrigin

      public FleetConsoleServer.Builder allowOrigin(String origin)
      Grants a browser origin cross-origin access to the API (ASF-028). Without any grant the console sends no CORS headers at all, so only same-origin pages (the built-in UI) can read it from a browser.
      Parameters:
      origin - an exact origin, e.g. https://ops.example.com
      Returns:
      this builder
    • commandAndControl

      public FleetConsoleServer.Builder commandAndControl(FleetCommander commander, String operatorToken)
      Enables command-and-control behind one static operator token: the shared-secret form of commandAndControl(FleetCommander, BearerAuthenticator), equivalent to BearerAuthenticator.staticToken(operatorToken, "operator"), so every holder is audited as operator. Both a commander and a non-blank token are required to turn C2 on; without them the console stays read-only and POST requests are refused.
      Parameters:
      commander - the C2 executor
      operatorToken - the bearer token operators present to command
      Returns:
      this builder
    • commandAndControl

      public FleetConsoleServer.Builder commandAndControl(FleetCommander commander, BearerAuthenticator authenticator)
      Enables command-and-control behind a BearerAuthenticator: the console serves bearer-gated command routes, and the UI shows a command console. With the OIDC module's BearerJwtValidator the console is an OAuth2 resource server: each request's JWT is validated, its sub is the audited operator, and its scopes must include the required scope.
      Parameters:
      commander - the C2 executor
      authenticator - the bearer gate on the command routes
      Returns:
      this builder
    • requiredScope

      public FleetConsoleServer.Builder requiredScope(String scope)
      The scope a scoped principal must carry to command; default FleetConsoleServer.OPERATE_SCOPE. A principal without any scopes (a static token) is never scope-checked.
      Parameters:
      scope - the required OAuth2 scope
      Returns:
      this builder
    • fleetName

      public FleetConsoleServer.Builder fleetName(String fleetName)
      Names the fleet on the UI and the API root.
      Parameters:
      fleetName - the display name
      Returns:
      this builder
    • panel

      Registers a panel.
      Parameters:
      panel - the panel
      Returns:
      this builder
    • panels

      public FleetConsoleServer.Builder panels(List<? extends ConsolePanel> panels)
      Registers several panels.
      Parameters:
      panels - the panels
      Returns:
      this builder
    • build

      public FleetConsoleServer build()
      Builds the server; call FleetConsoleServer.start(int) to serve.