feat(consent): add app.consent config, the consent service and ListConsentDocuments - #1913
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for CI Build 33429107722Coverage increased (+0.1%) to 49.642%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
rohanchkrabrty
marked this pull request as draft
August 31, 2026 10:36
This was referenced Aug 31, 2026
…onsentDocuments Config is the source of truth for what a deployment asks people to accept, and an endpoint is how a client learns it. No database, no writes, and frontier never reads a document or parses a version string. app.consent is a map keyed by document id, beside app.authentication and app.pat. A map because it matches authenticate.Config keying oidc_config by strategy name, the key enforces unique ids, and a single field stays env-overridable. Every document in it is required at signup, so there is no per-document required flag: an optional document would need withdrawal, which is out of scope. Boot validation rejects empty ids, versions and URLs, URLs that do not parse or that a client cannot link to, and an enabled block with no documents, which would otherwise look identical to a working deployment while asking nobody to accept anything. The resolved set is logged at boot, because an env override cannot alter an existing record but it can produce wrong new ones, and that log rather than the config repo is what says what a deployment was serving. The service owns the config, so it owns the checks. Documents orders by id. Resolve maps ids to their config snapshots and rejects ids config does not know, saying nothing about completeness. ResolveAll adds the completeness rule and compares both sets in both directions, so the error names what is wrong. Disabled, all three are empty and no id is rejected, so one client build works against both kinds of deployment. ListConsentDocuments mirrors ListAuthStrategies and is unauthenticated on purpose: the URLs are meant to be read by anyone considering an account, and the ids are an input to an unauthenticated Authenticate, so requiring a session to learn what to accept before the account exists is a cycle. It joins both the authentication and the authorization skip lists, since an endpoint missing from the second is denied by default. The transactional write and the SDK follow separately. Refs docs/rfcs/0002-explicit-consent-at-signup.md Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VW3nysiE4H83VQk6BroMYc
rohanchkrabrty
force-pushed
the
feature/featconsent-add-appconsent-config-the-consent-service-and
branch
from
August 31, 2026 19:10
d1ded9a to
1d572e9
Compare
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.
Summary
app.consenttoserver.Config— a map of documents keyed by id, each with a title, an opaque version and a URL — plus thecore/consentservice that owns it, per RFC 0002, Document config and Enforcement → Consent.Documents()serves the list ordered by id,Resolve()maps ids to config snapshots and rejects unknown ones, andResolveAll()adds the completeness rule and compares both sets in both directions, so the error names what is missing rather than just that something is.ListConsentDocumentsmirrorsListAuthStrategies— reads config, touches no database, and joins both interceptor skip lists. The authorization list denies by default, so without that second entry the endpoint would 403 on every call. It is public because the URLs are already public and the ids are an input to an unauthenticatedAuthenticate; requiring a session to learn what to accept before the account exists is a cycle.Resolve/ResolveAllaccept anything, so one client build works against both kinds of deployment. Nothing enforces consent yet — the write path follows.