Repository navigation
fix(sites): bind the screenshot key to its project - #14977
Conversation
The screenshot worker's ephemeral key now carries the project ID and sequence and is sent with the project header, instead of skipping the project check. The router honours a key's preview, status and banner bypasses only for the rule's own project, and the worker captures only Appwrite-generated deployment rules.
|
Review complete. 🟡 1 medium 📍 Findings outside the diff (1) — 🟡 1 medium — defects on lines GitHub can't attach comments to🟡 Medium — Screenshots query excludes legacy rules migrated as // src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php
123 Query::equal('trigger', ['deployment']),
124 Query::equal('owner', ['Appwrite']),
125 ]);
126
127 if ($rule->isEmpty()) {
128 throw new PermanentFailure('Rule for deployment not found');
129 }The rule lookup in the Screenshots worker now requires The change hardens the preview key flow: ephemeral JWT keys now carry a
Reviewed commit: cddb2bc |
🟢 Tier S · Ready to mergeThe screenshot worker captures only Appwrite-owned deployment rules and sends a project-bound ephemeral key with the project header; the key is signed with the active configured encryption key. The Sites E2E tests use project-bound preview keys and cover preview branding, rule binding, unbound-key rejection, and canceled deployments. Latest changes: The new commits switch screenshot-key signing from the hard-coded V1 secret to
📂 Walkthrough · 2
Reviewed the commits since |
Security rulesWARNING (2 new) — review signal only; does not fail the job.
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
|
@hansi-codes review |
…ning # Conflicts: # src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php # tests/e2e/Services/Sites/SitesCustomServerTest.php
…ning # Conflicts: # src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php
…ning # Conflicts: # src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php
What does this PR do?
Scopes the screenshot worker's ephemeral key to the project it was minted for. This complements #15031, which binds the key's preview grants to its rule in the router.
projectIdandprojectSequenceclaims, dropsprojectCheckDisabled, and sendsx-appwrite-project, so the key decodes only for its own project.owner=Appwrite), never a custom domain. (Not filtering ontrigger: V22 backfilled legacy rules asmanual.)Test Plan
SitesCustomServerTest::createPreviewKeynow mints keys the way the worker does (project-bound, noprojectCheckDisabled), and every keyed request sendsx-appwrite-project. The preview-branding, rule-binding and deployment-status tests still pass with these keys.composer refactor:check.Related PRs and Issues
Checklist