Class FleetConsoleServer.Builder
java.lang.Object
ai.badmonkey.agentspaces.console.FleetConsoleServer.Builder
- Enclosing class:
FleetConsoleServer
Assembles a
FleetConsoleServer.-
Method Summary
Modifier and TypeMethodDescriptionallowOrigin(String origin) Grants a browser origin cross-origin access to the API (ASF-028).build()Builds the server; callFleetConsoleServer.start(int)to serve.commandAndControl(FleetCommander commander, BearerAuthenticator authenticator) Enables command-and-control behind aBearerAuthenticator: the console serves bearer-gated command routes, and the UI shows a command console.commandAndControl(FleetCommander commander, String operatorToken) Enables command-and-control behind one static operator token: the shared-secret form ofcommandAndControl(FleetCommander, BearerAuthenticator), equivalent toBearerAuthenticator.staticToken(operatorToken, "operator"), so every holder is audited asoperator.Names the fleet on the UI and the API root.panel(ConsolePanel panel) Registers a panel.panels(List<? extends ConsolePanel> panels) Registers several panels.requiredScope(String scope) The scope a scoped principal must carry to command; defaultFleetConsoleServer.OPERATE_SCOPE.
-
Method Details
-
allowOrigin
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
Enables command-and-control behind one static operator token: the shared-secret form ofcommandAndControl(FleetCommander, BearerAuthenticator), equivalent toBearerAuthenticator.staticToken(operatorToken, "operator"), so every holder is audited asoperator. 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 executoroperatorToken- the bearer token operators present to command- Returns:
- this builder
-
commandAndControl
public FleetConsoleServer.Builder commandAndControl(FleetCommander commander, BearerAuthenticator authenticator) Enables command-and-control behind aBearerAuthenticator: the console serves bearer-gated command routes, and the UI shows a command console. With the OIDC module'sBearerJwtValidatorthe console is an OAuth2 resource server: each request's JWT is validated, itssubis the audited operator, and its scopes must include the required scope.- Parameters:
commander- the C2 executorauthenticator- the bearer gate on the command routes- Returns:
- this builder
-
requiredScope
The scope a scoped principal must carry to command; defaultFleetConsoleServer.OPERATE_SCOPE. A principal without any scopes (a static token) is never scope-checked.- Parameters:
scope- the required OAuth2 scope- Returns:
- this builder
-
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
Registers several panels.- Parameters:
panels- the panels- Returns:
- this builder
-
build
Builds the server; callFleetConsoleServer.start(int)to serve.
-