Skip to content

fix: derive config site from key and let site wildcards govern site config#295

Merged
bosschaert merged 2 commits into
mainfrom
site-config2
Jun 17, 2026
Merged

fix: derive config site from key and let site wildcards govern site config#295
bosschaert merged 2 commits into
mainfrom
site-config2

Conversation

@bosschaert

@bosschaert bosschaert commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description

Two fixes for site config permissions:

  • configPermissionPath derived the site from daCtx.site, which is undefined for a bare /config/{org}/{site} request (the site is parsed as the filename). It now derives the site from daCtx.key, matching getAclCtx, so the route and the authorized gate agree.

  • A site-scoped content wildcard (/{site}/** or /{site}/+**), not just an exact /{site}/CONFIG rule, now activates the per-site /{site}/CONFIG keyword. Root wildcards (/**, /+**) remain non-activating so they do not suppress the org CONFIG fallback. Path matching is factored into pathMatchesTarget and shared.

How Has This Been Tested?

  • Unit tests
  • On stage

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • [] My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

bosschaert and others added 2 commits June 17, 2026 12:25
…onfig

Two fixes for site config permissions:

- configPermissionPath derived the site from daCtx.site, which is undefined for
  a bare /config/{org}/{site} request (the site is parsed as the filename). It
  now derives the site from daCtx.key, matching getAclCtx, so the route and the
  authorized gate agree.

- A site-scoped content wildcard (/{site}/** or /{site}/+**), not just an exact
  /{site}/CONFIG rule, now activates the per-site /{site}/CONFIG keyword. Root
  wildcards (/**, /+**) remain non-activating so they do not suppress the org
  CONFIG fallback. Path matching is factored into pathMatchesTarget and shared.

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

Replace the site-config activation/fallback scan with a simpler union: config
access is granted if the user matches the resource's own keyword (per-site
/{site}/CONFIG, incl. site wildcards, or CONFIG for org config) OR the org-level
CONFIG keyword. Org admins can always manage any site's config; site rules only
add access, never restrict it.

Removes resolveConfigKey and the whole-sheet scan; configPermissionPath becomes
a trivial site->keyword mapping and the union OR lives in the config route.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bosschaert bosschaert marked this pull request as ready for review June 17, 2026 12:10
@bosschaert bosschaert requested review from karlpauls and mhaack June 17, 2026 12:10
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bosschaert bosschaert merged commit fd355f3 into main Jun 17, 2026
6 checks passed
@bosschaert bosschaert deleted the site-config2 branch June 17, 2026 12:46
adobe-bot pushed a commit that referenced this pull request Jun 17, 2026
## [1.11.1](v1.11.0...v1.11.1) (2026-06-17)

### Bug Fixes

* derive config site from key and let site wildcards govern site config ([#295](#295)) ([fd355f3](fd355f3))
@adobe-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants