Skip to content

Validate worker auth token freshness#3602

Open
kebanks2 wants to merge 1 commit into
orchestration-agent:mainfrom
kebanks2:fix-3596-worker-token-nbf
Open

Validate worker auth token freshness#3602
kebanks2 wants to merge 1 commit into
orchestration-agent:mainfrom
kebanks2:fix-3596-worker-token-nbf

Conversation

@kebanks2
Copy link
Copy Markdown

Summary

  • fixes [ Bounty $10k ] [ Auth ] Check token not-before time on worker requests — worker auth #3596 by replacing the bearer-presence check with fail-closed worker token validation before /api/v2 handlers run
  • rejects malformed, future-nbf, stale-by-global-cutoff, revoked, anonymous, underscoped, wrong-workspace, and missing-role worker principals
  • preserves the authorized path by attaching validated claims to request.state.worker_claims for bearer-token and browser-cookie clients
  • includes two current-main test-health fixes needed for API/full-suite validation: export AgentStatus from src.agent and make the metrics timer lock re-entrant

Validation

  • python -m flake8 src/api/middleware.py tests/test_auth_middleware.py src/agent/__init__.py src/common/metrics.py
  • python -m pytest -q -> 31 passed
  • python -m py_compile src/api/middleware.py tests/test_auth_middleware.py src/agent/__init__.py src/common/metrics.py
  • git diff --check
  • star gate verified: gh repo view orchestration-agent/AgentOrchestration --json viewerHasStarred --jq '.viewerHasStarred' -> true

No secrets, tokens, hidden context, private runtime data, or payout details are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Bounty $10k ] [ Auth ] Check token not-before time on worker requests — worker auth

1 participant