Skip to content

feat(consent): add app.consent config, the consent service and ListConsentDocuments - #1913

Draft
rohanchkrabrty wants to merge 1 commit into
feature/featauthenticate-separate-login-from-signup-with-an-explicitfrom
feature/featconsent-add-appconsent-config-the-consent-service-and
Draft

feat(consent): add app.consent config, the consent service and ListConsentDocuments#1913
rohanchkrabrty wants to merge 1 commit into
feature/featauthenticate-separate-login-from-signup-with-an-explicitfrom
feature/featconsent-add-appconsent-config-the-consent-service-and

Conversation

@rohanchkrabrty

@rohanchkrabrty rohanchkrabrty commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds app.consent to server.Config — a map of documents keyed by id, each with a title, an opaque version and a URL — plus the core/consent service that owns it, per RFC 0002, Document config and Enforcement → Consent.
  • Three read functions with deliberately different rules: Documents() serves the list ordered by id, Resolve() maps ids to config snapshots and rejects unknown ones, and ResolveAll() adds the completeness rule and compares both sets in both directions, so the error names what is missing rather than just that something is.
  • ListConsentDocuments mirrors ListAuthStrategies — 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 unauthenticated Authenticate; requiring a session to learn what to accept before the account exists is a cycle.
  • Config is validated at boot and the resolved set is logged there, so a deployment that asks for documents it cannot serve fails at startup rather than at someone's signup, and the log — not the config repo — says what was being served. Enabled with no documents is an error, since silently disabling itself would look identical to a working deployment.
  • Disabled changes nothing: the list comes back empty rather than erroring, and Resolve/ResolveAll accept anything, so one client build works against both kinds of deployment. Nothing enforces consent yet — the write path follows.

@rohanchkrabrty rohanchkrabrty self-assigned this Aug 31, 2026
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview Aug 31, 2026 7:13pm

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls

coveralls commented Aug 31, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 33429107722

Coverage increased (+0.1%) to 49.642%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: 23 uncovered changes across 2 files (118 of 141 lines covered, 83.69%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
cmd/serve.go 22 0 0.0%
internal/api/v1beta1connect/v1beta1connect.go 1 0 0.0%
Total (5 files) 141 118 83.69%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 40752
Covered Lines: 20230
Line Coverage: 49.64%
Coverage Strength: 15.92 hits per line

💛 - Coveralls

…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
rohanchkrabrty force-pushed the feature/featconsent-add-appconsent-config-the-consent-service-and branch from d1ded9a to 1d572e9 Compare August 31, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants