Files
civitai__civitai/public
Zachary Lowden 5fbfc81939 feat(app-blocks): enforce a justification for sensitive scopes at manifest submit (#3451)
* feat(app-blocks): enforce a justification for sensitive scopes at manifest submit

A manifest that declares a SENSITIVE block scope (one that can spend or read
the viewer's Buzz, read their private data, or write data other users see) must
now carry a non-empty scopeJustifications entry for that scope, or the manifest
is rejected. scopeJustifications was previously optional metadata that was never
required; this makes it required for the sensitive subset.

Enforced in the shared BlockManifestValidator.validate, so it covers every
submit path — the CLI zip submit (/api/v1/blocks/submit-version) and the web
editor (blocks.updateManifest) both funnel through validateSubmission -> validate.
The on-site mod-review checklist now auto-derives the "permissions justified"
item, and SENSITIVE_BLOCK_SCOPES is promoted from a presentation-only
classification to one that also gates manifest validity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(app-blocks): scope sensitive-scope-justification enforcement to SUBMIT only

The enforcement was leaking to the moderator APPROVE path: approve re-validates
the stored submitted manifest via validateSubmission (H-4 invariant), so a legacy
pending request submitted before this rule shipped — sensitive scope, no
scopeJustifications (valid under the old rules) — would throw on approve and
become un-approvable.

Thread a ManifestValidationOptions param (enforceSensitiveScopeJustification,
default true) through validate + validateSubmission. The 3 genuine submit callers
(git-push, developer manifest API, blocks.updateManifest) keep the default (ON);
the approve re-validation passes false, exempting ONLY this rule — every other
manifest check still runs on approve. No bypass: a post-deploy submission already
passed the submit gate (carries justifications), and nothing reaches the approve
queue without passing submit first, so grandfathering legacy pending requests is
safe.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 11:39:42 -05:00
..
2024-03-13 16:37:30 -04:00
2025-03-31 20:07:29 -04:00
2024-08-30 16:54:23 -06:00
2022-12-05 20:49:15 -07:00
2023-03-19 10:42:35 -06:00
2023-03-01 13:00:16 -07:00