~bigbes/sr-ht-spec · parade

main · last commit 18 hours ago · 8tmadfpi

← Back to the parade

spec-cnk Add middleware.PrivateCache to specs' /query mount Lined Up

status: open P2 task
bd update spec-cnk --claim bd close spec-cnk
Created byEugene Blikh
Ownerbigbes@gmail.com
Created2026-08-17T20:40:07Z
Updated2026-08-17T20:40:07Z
Description
What is wrong: `sourcehut-specs/cmd/specsrht/main.go::mountGraphQL`'s chi Group mounting `/query` carries RealIP/log/config/database middleware but never `middleware.PrivateCache`.

Why it matters: specs' schema answers per-credential and also answers anonymous callers, so the same `/query` URL yields different bodies to different viewers with nothing declaring that. This is ranked below the REST/GOPROXY cache-header findings because POST bodies are not normally cached — it becomes live the moment GET-query support or a GraphQL-aware cache sits in front.

Sibling that does it correctly: `sourcehut-curator/graph/graph.go::Mount` and `sourcehut-artifacts/graph/graph.go::privateCache`, both of which set `no-store` + `Vary: Authorization, Cookie` on the `/query` mount.

Fix: add `r.Use(middleware.PrivateCache)` to the chi Group in `mountGraphQL` before it registers the `/query` handler.

Audit: D14 (cross-repo audit, 2026-08-17)

Depends on

No outgoing dependencies.

Depended on by

Nothing depends on this issue.

No comments.

  • Eugene Blikh created the issue · 2026-08-17T23:40:06Z
Stored rows — what this pane was built from, as read
issues 1 row
id spec-cnk
content_hash 3ba24801931581c0a5a05f0eda35da7f48a69b697bc04427f1a3b0835a9c6ad2
title Add middleware.PrivateCache to specs' /query mount
description What is wrong: `sourcehut-specs/cmd/specsrht/main.go::mountGraphQL`'s chi Group mounting `/query` carries RealIP/log/config/database middleware but never `middleware.PrivateCache`. Why it matters: specs' schema answers per-credential and also answers anonymous callers, so the same `/query` URL yields different bodies to different viewers with nothing declaring that. This is ranked below the REST/GOPROXY cache-header findings because POST bodies are not normally cached — it becomes live the moment GET-query support or a GraphQL-aware cache sits in front. Sibling that does it correctly: `sourcehut-curator/graph/graph.go::Mount` and `sourcehut-artifacts/graph/graph.go::privateCache`, both of which set `no-store` + `Vary: Authorization, Cookie` on the `/query` mount. Fix: add `r.Use(middleware.PrivateCache)` to the chi Group in `mountGraphQL` before it registers the `/query` handler. Audit: D14 (cross-repo audit, 2026-08-17)
design
acceptance_criteria
notes
status open
priority 2
issue_type task
assignee NULL
estimated_minutes NULL
created_at 2026-08-17T20:40:07Z
created_by Eugene Blikh
owner bigbes@gmail.com
updated_at 2026-08-17T20:40:07Z
closed_at NULL
closed_by_session
external_ref NULL
spec_id
compaction_level 0
compacted_at NULL
compacted_at_commit NULL
original_size NULL
sender
ephemeral 0
wisp_type
pinned 0
is_template 0
mol_type
work_type
source_system
metadata �{}
source_repo
close_reason
event_kind
actor
target
payload
await_type
await_id
timeout_ns 0
waiters
hook_bead
role_bead
agent_state
last_activity NULL
role_type
rig
due_at NULL
defer_until NULL
no_history 0
started_at NULL
is_blocked 0
events 1 row
id 01a01173-f36a-73b5-b9c4-1349b4691cd6
issue_id spec-cnk
event_type created
actor Eugene Blikh
old_value
new_value
comment NULL
created_at 2026-08-17T23:40:06Z