Repository navigation
[access] test(rbac): cover grant constraints, derived grants, external grants, matrix rows and baseline authorization blocks - #7590
Conversation
Assisted-by: ClaudeCode:claude-opus-5-5
…and system attribution Assisted-by: ClaudeCode:claude-opus-5-5
…nd lapse holders Assisted-by: ClaudeCode:claude-opus-5-5
…d per-schema cache Assisted-by: ClaudeCode:claude-opus-5-5
…allbacks Assisted-by: ClaudeCode:claude-opus-5-5
…rossing findings Assisted-by: ClaudeCode:claude-opus-5-5
… lapses Assisted-by: ClaudeCode:claude-opus-5-5
…nd group collection Assisted-by: ClaudeCode:claude-opus-5-5
|
CI note: Newman API Test Suite is red on a56fe28 (job). The failure comes from tests this PR does not touch. The failing tests are the same set that fails on #7517, #7546 and #7578:
This PR does not add or change any of these tests, and none of its nine new test files appears in the failures. This PR contains no fix for them. I could not re-run the job from this session. Generated by Claude Code |
|
CI note: quality / Frontend Check (test:l10n) is red on a56fe28 (job). The cause is outside this PR: 14 keys used in The rest of the quality matrix runs from the same Those files are outside this test-only lane, so no fix is ported here. I could not re-run jobs from this session. Generated by Claude Code |
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ❌ | ||||
| psalm | ❌ | ||||
| phpstan | ❌ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ❌ | ||||
| test-l10n-parity | ❌ | ||||
| format | ❌ | ||||
| check-schema-l10n | ✅ | ||||
| test-coverage-ratchet | ✅ | ||||
| composer | ✅ | ✅ 168/168 | |||
| npm | ✅ | ✅ 641/641 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ✅ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ❌ 49060/49070 · 19 skipped | ||||
| Newman | ❌ 1625/1628 | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development. |
||||
| Hydra gates | ❌ |
Quality workflow — 2026-11-09 17:40 UTC
Download the full PDF report from the workflow artifacts.
Covers nine RBAC grant-shaping and audit classes from lane T03 (round t1, SIG test coverage). Two of them had no dedicated test before this PR.
What is covered (new test files only; "before" is the CI clover on development 30fbb6d)
lib/Service/Rbac/RoleActionMap.php(12/14) →RoleActionMapTest: non-array input; the list and keyed shapes; non-string actions, nameless entries and scalar definitions dropped.lib/Service/ShippedBaseline/AuthorizationBlocks.php(69/74) →tests/Unit/Service/ShippedBaseline/AuthorizationBlocksTest:rootOf(schema block, property block, none); roots across definitions;settleroll-up (local, upstream and both; decided blocks applied upstream withlocalMoved; same and non-authorization paths dropped);outcome(applied, replacedLocal, conflicts with subtree trees).lib/Service/Organisation/OrganisationLifecycleAuditor.php(41/43) →OrganisationLifecycleAuditorBehaviourTest: an unchanged status or edit writes nothing; a write with no session is attributed tosystem/Systemand records only the fields that moved.lib/Service/Rbac/ExternalGrantGuard.php(81/88) →ExternalGrantGuardShapeTest: a null block; skipped pseudo keys, numeric keys and non-lists; only a literaltruecounts as external; a blankuntil; principal naming order; lapse holders, and the horizon cut-off.lib/Service/Rbac/MatrixRowsFromApps.php(57/70) →MatrixRowsFromAppsProviderTest: no provider or a blank one passes through untouched; no dispatcher; malformed declared rows; a dotless provider is owned by the app of that name; the per-schema and per-provider cache.lib/Service/Rbac/ExplicitRevealTrailMasker.php(31/38) →ExplicitRevealTrailMaskerShapeTest: an unreadable schema is looked up once and everything is masked; a raw row's JSON is masked and re-encoded; a serialisable entry with no schema; unreadable entries and unaffected schemas pass through unchanged.lib/Service/Rbac/MatrixRowWhere.php(38/40) →MatrixRowWhereTest: readablewheresorted and$inunwrapped; each unreadable shape refuses the whole row; organisation-crossing intent; crossing findings.lib/Service/Rbac/GrantConstraints.php(78/85) →GrantConstraintsShapeTest: empty blocks; malformed or emptyscopedTo, an area that cannot be named, and a blank or non-stringuntilall fail closed; pseudo keys and scalars pass through; roles whose holders have all lapsed are dropped; non-list holders are kept.lib/Service/Rbac/DerivedGrantResolver.php(62/66) →DerivedGrantResolverTest: no rules; each skip reason; a missing claim or wrong value;equalsandoneOfagainst single and multi-valued claims; groups collected once from grants that still reach the area.What ran
origin/developmentbefore opening.weak.phpreports none of these tests.groupsFor(), which reads the real time internally; its tests use the years 2000 and 2999 so the result cannot change.After: coverage was not measured. No coverage driver could be installed in this sandbox: there is no pcov or xdebug package, and building one from source was not permitted.
Mutation samples (each applied by hand, the tests went red, then reverted; none committed)
Left
ExternalGrantGuard::principalOf(): the string-entry and non-array branches are dead code (b). The method is only ever called for entriesisExternal()has already accepted, and those are always arrays.Tests written with Claude Code.
Generated by Claude Code