mirror of
https://github.com/civitai/civitai.git
synced 2026-09-20 22:08:18 +08:00
5fbfc81939
* 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>