Repository navigation
Conversation
Add the caller x operation matrix of the access control redesign as integration tests, the acceptance suite of the redesign: the design's table as data (access-matrix/matrix.txt), one test per row, caller variant and operation, and the variants next to the table (stamped owner and actor, missing and foreign tasks alike, page tokens of other owners, private service info, all operations at the decision service, list scopes, widening policies, failing closed and open). The tests run against a mock OpenID Connect provider, a mock decision service (a stand-in for the tes-authz reference policy) and a mock Kubernetes API. Cells that the current code doesn't meet yet are listed in access-matrix/pending.csv with the slice that makes them pass and today's status; their tests are strict expected failures and end as skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
- Row 11 is wrong only in its issuer (signed with the provider's key). - Every matrix row needs callers, and every caller a row. - The mock lists all tasks for unknown or missing selectors, so that a selector without the owner shows up as a leak. - The actor must be recorded as an act chain, not as a client ID. - Requests are compared in journal order; pending.csv checks its configurations and statuses. - Docs: the slices, how to run the suite, what a slice updates. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
Reviewer's GuideDocumentationReview the development guide's access-matrix section after the tests to confirm its description of the suite, slices, run command, and update process matches the implemented acceptance tests.
TestsReview the matrix table and pending-cell ledger first: they define the target access behaviour and the exact current-code gaps that the rest of the suite enforces.
Review the shared caller, operation, ownership, and entitlement models together because the test cases and policy expectations depend on these representations.
Review the mock identity provider, decision service, and Kubernetes API as the test boundary that supplies tokens, policy answers, recorded requests, and task behaviour.
Review the harness and parametrized matrix runner together: they configure the test environment, execute each cell, and enforce pending-cell expectations.
Review the focused matrix variants together, since they extend the baseline cases with private service info, all-operation authorization, fail-open handling, and design-specific edge cases.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #223 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 56 56
Lines 2612 2612
Branches 313 313
=========================================
Hits 2612 2612 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #224
Slice T1 of the access control redesign: the access-matrix test suite that pins the target behaviour and becomes the redesign's acceptance suite. Sibling of #222 / #221 (T3a, token validator); touches none of #221's files except a different section of
docs/development.md. Test-only: no main code changes. Draft and unmerged until the whole redesign is done (TESK freeze).Summary
src/integration-test/resources/access-matrix/matrix.txt: the design's caller x operation table (19 rows; service info, create, get in three views, list, cancel), parsed by the tests, so table and suite can't drift.AccessMatrixIT: one test per row, caller variant (e.g. 12a-d: bad signature,alg none, unknown kid, ID token; 18a-c: decision service down / timeout / bad answer; 19a/b: user info 503 / timeout) and operation, plus the variants next to the table: stamped owner<iss>|<sub>, recorded actor of exchanged tokens, missing and foreign tasks alike (404, same Kubernetes requests), page tokens of other owners (400), user info refusing a locally valid token (401 on create only), and which operations ask the decision service (D-407 default: create only).AccessMatrixServiceInfoPrivateIT(serviceInfoPublic: false),AccessMatrixAllOperationsIT(all operations at the decision service: same results as default, one evaluation per operation, fail closed 503, list scopesall/none, widening policy),AccessMatrixFailOpenIT(get/list/cancel fail open: owner-only fallback, create still closed).MockIdp, LS Login-like user info), mock decision service (MockPdp, Java stand-in for the tes-authz owner-only reference policy, failure modes, records requests), mock Kubernetes API (MockCluster; lists honour the owner hash and return all tasks for any other selector, so a missing owner selector shows up as a leak).pending.csv: 180 cells the current code doesn't meet, each with the slice that makes it pass (T2 72, T3b 68, T4a 11, T4b 14, T6 13,decide2) and today's status. Pending tests are strict expected failures: they must still answer the recorded status and miss the target, then end as skipped; once a slice meets a cell, its test fails until the line is removed.docs/development.md, "Access matrix": what the suite is, the slices, how to run it, what each slice must update.Verification
./mvnw clean verify spotless:check checkstyle:check(Java 21 container): BUILD SUCCESS, 584 integration tests, 0 failures, 180 skipped (= the pending cells), coverage check (100 %) passes.mkdocs build --strict: passes.Review
Two rounds of adversarial and quality review. Fixed: row 11 now differs from a valid token only in
iss; rows without callers fail the suite; the Kubernetes mock fails closed for unknown selectors; the actor must be recorded as an act chain; request order from the journal;pending.csvvalidates configurations and statuses; docs list the slices, the run command and the slice checklist.Declined review findings
@AfterAllcheck that everypending.csvline was used: it fails whenever a subset of tests is run; config names and line format are validated instead, and the skip counts equal the line counts today.Harness.check/ a helper for the foreign task: low, readability only.job-type=taskmasterin the owner-hash stubs (lookahead): low; TESK's selectors always carry it.Open questions
aud= the client's own ID, which the D-392 pipeline (feat: validate JWT access tokens #221) accepts only for listed clients, so a real unlisted client gets 401 everywhere, not 403/404/200[]. The suite uses an unlisted client token with an accepted audience to pin the row as written. Keep the row (with a note in the design), or change it to 401?serviceInfoPublic: falsefor rows 16 (untrusted actor) and 17 (usersub= a listed client ID): the design says "others 200", but both tokens are refused on every operation (403 / 401). Markeddecide(skipped) until settled.ownevaluation, while D-407 (pinned here, pending T4b) has list scopesall/noneand policies that widen beyond the owner. The two need aligning before T4b.🤖 Generated with Claude Code
https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5