fix(forge): use an agent-bound token for the benchmark agent and fail on auth rejection - #69
Open
JLCode-tech wants to merge 2 commits into
Open
JLCode-tech wants to merge 2 commits into
JLCode-tech wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--forge-agent-token,AWSBNKCTL_FORGE_AGENT_TOKEN,cluster.yamlforge.agent_token,0600cached token fileforge_agent_token.json, and operator minting viaPOST /api/benchmarks/agents/{id}/token). Configured WebSocket dial to pass bearer token in query parameter and Authorization header. Added fatal non-zero termination on authentication failure (WebSocket close 4401, HTTP 401/403) with one-time cache invalidation and re-minting for stale cached tokens. Updated documentation indocs/FORGE_INTEGRATION.mdanddocs/COMMANDS.md./ws/benchmarks/agents/{agent_id}) require a bearer JWT containing roleagentand anagent_idclaim matching the URL path ID; operator/admin JWTs lack this claim and are closed with code 4401. Token minting endpointPOST /api/benchmarks/agents/{agent_id}/tokenis available on Forge >= 2.11; older Forge builds returning HTTP 404/405 produce an actionable error requiring explicit token configuration.go test ./...including targeted unit testsTestBenchmarkAgentWorker_FatalAuthClose4401,TestBenchmarkAgentWorker_CachedTokenRejection_RemintsAndReconnects, andTestBenchmarkDaemon_EndToEndMock. Validate manual check against Forge without mint endpoint:awsbnkctl benchmark daemon --forge-rest-url <url> --forge-user admin --forge-pass <pw>exits non-zero immediately with the Forge >= 2.11 guidance message without looping.