Skip to content

test(e2e): un-skip versionRouting 9.2; record the measured blockers on the RBAC suite - #84

Merged
rubenvdlinde merged 2 commits into
developmentfrom
wip/schema-read-authenticated
Aug 1, 2026
Merged

test(e2e): un-skip versionRouting 9.2; record the measured blockers on the RBAC suite#84
rubenvdlinde merged 2 commits into
developmentfrom
wip/schema-read-authenticated

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Follow-up to #81 (the OpenRegister read grant), which is what made these assertions reachable.

9.2 — enabled, four scenarios replacing one that asserted almost nothing

Two things unblocked it:

  1. Fixture users. globalSetup provisions rbac-owner/-editor/-viewer/-outsider and mints one storageState each, so no spec form-logs-in — four consecutive logins is exactly what trips Nextcloud's brute-force throttle. loginAs is gone from this file.
  2. fix(rbac): grant authenticated read on every openbuild schema (#76) #81. Until every schema carried a read rule, non-admins saw zero objects. "Viewer gets 404" passed for the wrong reason, and no 200 assertion was reachable at all.

The old body could not fail meaningfully: it located the schema list with .ob-schema-list / [data-testid="schema-list"], neither of which exists in src/, so "must NOT be visible" held on any page — including a correct one — and it downgraded a missing not-found UI to a console.warn.

Now asserted:

scenario assertion
viewer + staging 404, body pinned exactly, plus a regex proving the envelope names no authorisation reason
non-member + staging byte-identical to the viewer's — and identical again to an unknown version slug. That indistinguishability is REQ-OBVR-003
editor + staging 200 with a manifest — the positive control
viewer UI .openbuild-schema-list (the real selector) absent, no stack trace

The editor row matters most: without it, a broken fixture, a missing version chain and a blanket denial all look identical to a pass. Setup grants the roles via grantAppRoles(), which had been merged with no caller — so the control now exercises a genuine editor.

schema-access-scopes-rbac — stays skipped, with honest blockers

All three recorded blockers are resolved: the fixture users exist (and map naturally onto "editor in the selected group" vs "editor not in it" — no vets group, no Newman needed); the version chain is seeded; and the feature is real — the warning is an NcNoteCard sibling of .openbuild-access-editor, with the copy in SchemaDesigner.vue. .note-stub never existed.

A fourth blocker, found by driving it rather than reading it, is not resolved: the schema designer is unreachable for a non-admin. rbac-editor lands on the first-time setup wizard with .openbuild-schema-list count 0, because /api/setup/status is admin-only and useSetupStatus read its 403 as "nothing done". Fixed upstream in ConductionNL/nextcloud-vue#574 (merged); unblocks on a published bump.

The comment also records #83, found while measuring: availableGroups feeds the dropdown group:-prefixed values while authorLockedOut compares bare gids, so the lock-out warning fires for members too — precisely the REQ-OBDSA-004 scenario. Noted so this suite is not simply un-skipped and declared green once the wizard blocker lifts.

Verification

versionRouting.spec.ts6 passed against the disposable instance (3.6m), including all four new 9.2 scenarios. Full-suite result reported in a comment below.

🤖 Generated with Claude Code

Every openbuild schema declared

    "authorization": { "create": ["admin"], "update": ["admin"], "delete": ["admin"] }

— non-empty, and with no `read` key. OpenRegister treats that as fail-closed:
`MagicRbacHandler::buildRbacConditionsSql()` bypasses filtering only for an
EMPTY block; a populated block with no `read` rule falls through to the owner
condition alone, so every non-admin caller saw zero rows. Not a bug in OR —
deliberate, and commented as such at MagicRbacHandler:1031.

That is the whole of #76. An owner could grant a colleague editor or viewer on
an app and they still saw an empty list, because OR filtered the objects out
one layer below openbuild's own permission check.

Adds `"read": ["authenticated"]` to all 15 schemas — 6 in the monolith and 9
across the register.d fragments, which were missed by the first pass and would
have left business rules, automations, component blocks and the agent
workspace owner-only.

`authenticated` requires $userId !== null (MagicRbacHandler:414), so anonymous
callers are NOT granted. This is intentionally the coarse layer: appinfo/routes.php
already documents that OR's schema read rule is a group ACL, not a row filter,
and that the per-app `permissions` block is enforced by /api/applications. Both
layers verified live.

Measured on the disposable instance after a FORCED re-import:

  caller          OR object API   openbuild /api/applications
  admin                      21   21
  rbac-editor          0 -> 21    1  (granted editor on pw-verchain)
  rbac-viewer          0 -> 21    1  (granted viewer on pw-verchain)
  rbac-outsider        0 -> 21    0  (no grant)
  anonymous                   0   401

Diagnosis trail: ConductionNL/openregister#2252.
…s on the RBAC suite

9.2 — ENABLED, four scenarios replacing one that asserted almost nothing.

Two things unblocked it. globalSetup now provisions the rbac-* fixture users
and mints one storageState each, so no spec form-logs-in (four consecutive
logins is exactly what trips Nextcloud's brute-force throttle) — `loginAs` is
gone from this file. And openbuild#76: until every schema carried a `read`
rule, non-admins saw ZERO objects, so "viewer gets 404" passed for the wrong
reason and no 200 assertion was reachable at all.

The old body could not fail meaningfully. It located the schema list with
`.ob-schema-list` / `[data-testid="schema-list"]`, neither of which exists in
src/, so "must NOT be visible" held on any page including a correct one; and it
downgraded a missing not-found UI to a console.warn. Now asserted:

  - viewer + staging -> 404 with the body pinned EXACTLY, plus a regex check
    that the envelope names no authorisation reason
  - non-member + staging -> byte-identical to the viewer's, and identical again
    to an unknown version slug (that indistinguishability IS REQ-OBVR-003)
  - editor + staging -> 200 with a manifest. The positive control: without it a
    broken fixture, a missing chain or a blanket denial all look like a pass
  - viewer UI -> `.openbuild-schema-list` (the REAL selector) absent, no stack trace

Setup grants the roles via grantAppRoles(), which had been merged with no
caller — so the editor control now actually exercises an editor.

schema-access-scopes-rbac — STAYS SKIPPED, with honest blockers.

Its three recorded blockers are all resolved (fixture users exist; the version
chain is seeded; the feature and its copy are real — the warning is an
NcNoteCard sibling of .openbuild-access-editor, and `.note-stub` never existed).
A fourth, found by driving it rather than reading it, is not: the schema
designer is unreachable for a non-admin. rbac-editor lands on the first-time
setup wizard with `.openbuild-schema-list` count 0, because /api/setup/status is
admin-only and useSetupStatus read its 403 as "nothing done". Fixed upstream in
ConductionNL/nextcloud-vue#574; unblocks on a published bump.

The comment also records a defect found while measuring, filed as #83:
availableGroups feeds the dropdown `group:`-prefixed values while
authorLockedOut compares bare gids, so the lock-out warning fires for members
too — exactly the REQ-OBDSA-004 scenario. Noted so this suite is not simply
un-skipped and declared green once the wizard blocker lifts.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openbuild @ 141929f

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 659/659
PHPUnit
Newman ⏭️
Playwright ⏭️

Coverage: 89.4% (17/19 statements)


Quality workflow — 2026-08-01 21:55 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
rubenvdlinde merged commit aed98ca into development Aug 1, 2026
30 checks passed
@rubenvdlinde
rubenvdlinde deleted the wip/schema-read-authenticated branch August 1, 2026 22:45
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.

2 participants