feat(feedback): POST /v1/feedback files crash and bug reports as Gitea issues
ci / shared (pull_request) Successful in 15s
ci / test (pull_request) Successful in 6m48s
ci / image (pull_request) Skipped

A CLI user sends a crash report or /bug report with their own token; the
registry files it as an issue in the private feedback repo, titled
"[<tenant slug>] <kind>: <title>", with a provenance block (tenant, user,
product, version, device, kind, time received) above the body. The caller
gets the issue number only.

- route group "feedback"; user tokens only; tenant from the principal
- 10 reports per person and hour (in memory)
- FEEDBACK_GITEA_URL / _REPO / _TOKEN; no token answers 503
- Gitea errors become 502 feedback_failed without body, URL or token
- audit event feedback.submitted

Refs platform/werkpilot#86

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRayW7ztyk1uAtwMJPR
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-11-23 13:49:00 +01:00
1 parent 69c15be333
commit 553f4c52fe
13 files changed
+718 -16

No files matched your search

+8 -3
View File
@@ -53,9 +53,10 @@ type Server struct {
// ones (contractdocs.Default). Tests pass their own.
Contracts *contractdocs.Catalogue
blocks blockCache // MemberBlocked answers for user tokens (team.go)
ciLimiter keyRateLimiter // CI licence issues per API key (licences_ci.go)
connLimiter keyRateLimiter // codes entered per tenant and person (connections.go)
blocks blockCache // MemberBlocked answers for user tokens (team.go)
ciLimiter keyRateLimiter // CI licence issues per API key (licences_ci.go)
connLimiter keyRateLimiter // codes entered per tenant and person (connections.go)
feedbackLimiter keyRateLimiter // feedback reports per person (feedback.go)
}
func (s *Server) now() time.Time {
@@ -237,6 +238,10 @@ func NewRouter(s *Server) http.Handler {
mux.HandleFunc("GET /v1/licences", s.listLicences)
mux.HandleFunc("POST /v1/licences/{id}/revoke", s.revokeLicence)
// Crash and /bug reports from the CLIs (werkpilot#86; group "feedback"):
// any member, with their own token.
mux.HandleFunc("POST /v1/feedback", s.postFeedback)
// keycloak claims refresh — the URL the protocol mapper would call at
// token issuance to grab the up-to-date entitlement bundle. Today the
// dev realm projects user attributes (set by SyncClaims) — this is