Skip to content

feat: unified (target, matchType, value) match shape for rules and permissions#227

Merged
coopernetes merged 4 commits into
mainfrom
feat/221-unified-rule-shape
May 5, 2026
Merged

feat: unified (target, matchType, value) match shape for rules and permissions#227
coopernetes merged 4 commits into
mainfrom
feat/221-unified-rule-shape

Conversation

@coopernetes
Copy link
Copy Markdown
Member

Summary

Closes #221

  • Replaces the old slug/owner/name fields on AccessRule and path/pathType on RepoPermission with a single match: block (new MatchTarget + MatchType enums) shared by both rules and permissions
  • V5 SQL migration migrates existing data; column named match_value to avoid H2 reserved keyword
  • type is optional in config — defaults to GLOB for both rules and permissions (uniform default, no context-switching)
  • All YAML fixtures, Docker config files, docs, tests, and the dashboard UI dropdowns updated

Config shape is now consistent across rules and permissions:

match:
  target: SLUG | OWNER | NAME
  value:  <pattern>
  type:   LITERAL | GLOB | REGEX   # optional, defaults to GLOB

Test plan

  • ./gradlew test --rerun passes (all unit + integration tests)
  • e2e tests pass locally (54/58 — 4 pre-existing ConfigHotReloadE2ETest failures unrelated to this change)
  • JettyConfigurationBuilderTest covers null-type default (GLOB) for both rules and permissions
  • CI e2e suite

coopernetes and others added 4 commits May 5, 2026 17:08
…rmissions

Replaces the old `slug/owner/name` fields on AccessRule and `path/pathType`
on RepoPermission with a single `match:` block shared by both. Config shape
is now identical across URL rules and permissions:

  match:
    target: SLUG | OWNER | NAME
    value:  <pattern>
    type:   LITERAL | GLOB | REGEX   # optional — defaults to GLOB for rules,
                                      # LITERAL for permissions

New MatchTarget and MatchType enums carry the match semantics. The SQL column
for the pattern is named `match_value` (V5 migration) to avoid the H2 reserved
keyword `value`. All YAML config files, Docker fixtures, docs, tests, and
migration SQL are updated.

closes #221

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removing the asymmetry where permissions defaulted to LITERAL and rules to GLOB.
A single universal default (GLOB) is simpler: operators don't have to remember
which context they're in, and the practical risk is negligible — a permission
value with no wildcard chars behaves identically under GLOB and LITERAL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Aligns the UI default with the backend: omitting type now means GLOB
in both the YAML config and the dashboard add forms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Inline rule snippets still used the old slugs:/operations:[list] shape,
causing GestaltException on reload. Updated to match: block with BOTH/PUSH.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coopernetes coopernetes merged commit 8a2ac46 into main May 5, 2026
16 checks passed
@coopernetes coopernetes deleted the feat/221-unified-rule-shape branch May 5, 2026 21:35
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.

refactor: unify URL rule and permission config shape (consistent target, value, match-type)

1 participant