feat(api): enforce Full Moon premium server-side (ADR 0018)#115
Merged
Conversation
The paywall was UI-only; POST /results accepted fullMoon from anyone. Gate the
server-dependent value surfaces on premium OR is_beta (promo accounts keep
access), leaving client-side scoring and free/public flows untouched.
- deps.require_premium: reusable dependency mirroring require_admin (401 no sub,
403 not entitled), authorizes premium OR is_beta.
- Gated: POST /witness/sessions, GET /witness/my-sessions,
GET /groups/{id}/report-data (on top of membership).
- POST /results: inline gate INSIDE the fullMoon branch only — free instruments
and anonymous posts stay open; anon/non-entitled fullMoon persist -> 403.
- Left open by design: public witness submit, my-contributions, /me/results,
POST /groups.
No migration (handler logic only). ADR 0018 Accepted; auth.md updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…lated) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Implements ADR 0018 (Option A): enforce premium on the server-dependent Full Moon value surfaces. Client-side scoring is untouched (privacy-by-design). Check authorizes
premium OR is_betaso promo accounts keep access.Reusable dependency (
api/deps.py, mirrorsrequire_admin):Gated:
POST /witness/sessions,GET /witness/my-sessions,GET /groups/{id}/report-data(on top of membership).POST /results— inline, fullMoon branch only (free/anon stay open):Left open by design: public witness submit,
/witness/my-contributions,/me/results,POST /groups.No migration (handler logic only). Tests:
require_premiumunit (403/401/pass), route wiring (gated vs non-targets),/resultsfullMoon (anon/non-premium 403; premium/beta persist; anon newMoon 200). Backend185 passed, frontend248 passed, build clean.🤖 Generated with Claude Code