0018. Remove the fleet REST identity layer (revert ADR-0017)
Status
Accepted — implemented in the same change that introduced this record. Supersedes ADR-0017.
Context
ADR-0017 adopted the fleet-wide static
bearer-key REST identity (warehouse-ops-agent ADR 0005) across this service's
REST surface (cmd/workforce, cmd/workforce-reports) and its MCP surface
(cmd/mcp): a shared internal/adapters/inbound/auth package, chi/MCP
middleware enforcing read/read-write scopes, static keys sourced from
API_READ_KEY/API_READWRITE_KEY (with MCP_READ_KEY/MCP_READWRITE_KEY
fallbacks), and matching bearer credentials on the outbound
fulfillment-execution and labor-performance clients.
The fleet decision to run this auth layer has been reversed. This service must stop enforcing, logging, or wiring any part of it — REST, MCP, and the outbound peer clients alike — and the Helm chart, OpenAPI contract, and README must reflect a service with no bearer-key gate.
Decision
We will remove the static-bearer-key auth layer entirely:
- Delete
internal/adapters/inbound/auth(the whole package) and its MCP alias layer (internal/adapters/inbound/mcp/auth.go). cmd/workforce,cmd/workforce-reports, andcmd/mcpno longer construct anAuthenticator, parseAUTH_MODE, or readAPI_READ_KEY/API_READWRITE_KEY/MCP_READ_KEY/MCP_READWRITE_KEY. Every route on all three binaries — including/healthzand the MCP Streamable HTTP endpoint at/and/mcp— is unauthenticated at this layer.internal/adapters/inbound/http'sNewRouter/NewReportsRouterdrop theWithAuthoption and the auth middleware group;internal/adapters/inbound/mcp'sHandler/NewServerdrop scope gating on every tool, resource, and prompt.- The outbound
fulfillmentexecutionandlaborperformanceclients dropWithBearerToken/FULFILLMENT_EXECUTION_API_KEY/LABOR_PERFORMANCE_API_KEY; they send noAuthorizationheader. - The Helm chart drops
auth.*,mcp.readKey/mcp.readWriteKey/mcp.existingSecret,fulfillmentExecution.apiKey,laborPerformance.apiKey, theAUTH_MODEConfigMap entry, and the auth/MCP-key Secret templates. apis/openapi.yamldropscomponents.securitySchemes.bearerAuth, the top-levelsecurity:requirement, and every per-operation401/403response.apis/asyncapi.yamlcarried no auth content and is unchanged.- README drops the
AUTH_MODE/API_READ_KEY/API_READWRITE_KEY/FULFILLMENT_EXECUTION_API_KEY/LABOR_PERFORMANCE_API_KEYenv rows and the API "Authentication" section.
ADR-0017 is left in place, unedited, as the historical record of the rollout — it is superseded, not deleted.
Consequences
Easier
- One less moving part on every request path across all three binaries: no key material to provision, rotate, or accidentally omit before a route starts rejecting traffic.
- The Helm chart and README are smaller and describe exactly what the binaries do today.
Harder
- The REST, reports, and MCP surfaces are open to anyone who can reach them on the network — this service now relies entirely on network-level controls (namespace/cluster boundary, ingress policy) for access control. Re-adopting a fleet identity decision later is a fresh ADR, not a revert of this one.