fix: 🔒️ reject bare tokens in stateless HTTP auth #185
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/OpenSpec
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
RFC - Request For Comments
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
hermes-attempted
hermes-needs-clarification
hermes-ready
hermes-review
hermes-wip
human-required
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
agentic-forges/forgejo-mcp!185
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/185/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
While verifying the
stateless-http-authOpenSpec change for archival, found one remaining spec violation. The spec's "Bare token rejected" scenario mandates:But
extractTokenaccepted scheme-lessAuthorizationvalues, silently treating them as per-request identities. This is privilege-relevant: a bare value that should fall to the global singleton instead forges a per-request identity.What changed
operation/operation.go—extractTokenreturns""for scheme-less headers; onlytoken/bearer(case-insensitive) schemes resolve a token. (task 2.5)operation/extracttoken_test.go(new) — case-insensitivity (token/Bearer/BEARER/TOKEN) + bare-token rejection. (task 4.4)pkg/forgejo/forgejo_test.go— ephemeral-client construction failure surfaces an error and nil client, no silent singleton downgrade. (task 4.3)README.md— cross-link thestateless-http-authOpenSpec change. (task 5.2)openspec/changes/stateless-http-auth/tasks.md— mark completed blocker fixes (1.3, 2.4, 2.5, 4.2–4.4, 5.x, 6.3).The other blocker fixes (1.3 error propagation, 2.4 case-insensitive matching, 4.2 httptest header-leakage test) were already implemented on main; this PR closes the last gap.
Verification
make build✅go test ./...✅ (no failures)openspec validate stateless-http-auth --strict✅Remaining before archive (post-merge)
stateless-http-authonce mergedCloses the archival blocker for the
stateless-http-authchange.op1st Pipelines as Code/forgejo-mcp-code-scans-l4cs6 is running.
Starting Pipelinerun forgejo-mcp-code-scans-l4cs6 in namespace op1st-pipelines
You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:
tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-l4cs6 -fop1st Pipelines as Code/forgejo-mcp-openspec-validate-pr-hp6xk is running.
Starting Pipelinerun forgejo-mcp-openspec-validate-pr-hp6xk in namespace op1st-pipelines
You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:
tkn pr logs -n op1st-pipelines forgejo-mcp-openspec-validate-pr-hp6xk -fop1st Pipelines as Code/forgejo-mcp-on-pull-request-k98hd is running.
Starting Pipelinerun forgejo-mcp-on-pull-request-k98hd in namespace op1st-pipelines
You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:
tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-k98hd -fop1st Pipelines as Code/forgejo-mcp-code-scans-l4cs6 has successfully validated your commit.
Task Statuses:
fetch-source
gitleaks-version
gitleaks
op1st Pipelines as Code/forgejo-mcp-openspec-validate-pr-hp6xk has successfully validated your commit.
Task Statuses:
fetch-source
validate
op1st Pipelines as Code/forgejo-mcp-on-pull-request-pktpx is running.
Starting Pipelinerun forgejo-mcp-on-pull-request-pktpx in namespace op1st-pipelines
You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:
tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-pktpx -fop1st Pipelines as Code/forgejo-mcp-openspec-validate-pr-n9bhc is running.
Starting Pipelinerun forgejo-mcp-openspec-validate-pr-n9bhc in namespace op1st-pipelines
You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:
tkn pr logs -n op1st-pipelines forgejo-mcp-openspec-validate-pr-n9bhc -fop1st Pipelines as Code/forgejo-mcp-code-scans-zrqs5 is running.
Starting Pipelinerun forgejo-mcp-code-scans-zrqs5 in namespace op1st-pipelines
You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:
tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-zrqs5 -fop1st Pipelines as Code/forgejo-mcp-on-pull-request-k98hd
Task Statuses:
fetch-source
build-and-test
commit-title-check
Failure snippet:
task build-and-test has the status "TaskRunCancelled":op1st Pipelines as Code/forgejo-mcp-openspec-validate-pr-n9bhc has successfully validated your commit.
Task Statuses:
fetch-source
validate
op1st Pipelines as Code/forgejo-mcp-code-scans-zrqs5 has successfully validated your commit.
Task Statuses:
gitleaks-version
fetch-source
gitleaks
op1st Pipelines as Code/forgejo-mcp-code-scans-zrqs5 has successfully validated your commit.
Task Statuses:
gitleaks-version
fetch-source
gitleaks
Tracking bead:
forgejo-mcp-8if(P1) — after this PR merges, complete the remainingstateless-http-authtasks and archive the change:bearerscheme, broken-URL error path) against a live instanceopenspec archive stateless-http-authBead recorded in
.beads/issues.jsonl.op1st Pipelines as Code/forgejo-mcp-on-pull-request-pktpx has successfully validated your commit.
Task Statuses:
fetch-source
build-and-test
commit-title-check