Repository navigation
test(contract): SDK-ZERO-GRANT-1 — zero-grant list is empty 200, single object 403, bad token 401 - #65
Open
aibeshkov wants to merge 1 commit into
Open
test(contract): SDK-ZERO-GRANT-1 — zero-grant list is empty 200, single object 403, bad token 401#65aibeshkov wants to merge 1 commit into
aibeshkov wants to merge 1 commit into
Conversation
…= 403, bad token = 401 Signed-off-by: Andrei Beshkov <andrey.beshkov@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Andrei's decision (2026-10-17): a caller with zero grants gets an EMPTY 200 from a list route (lists are filtered by permission); a single-object read without a grant is 403; a bad or expired token is 401. Found by MACHINE-IDENT-DENY-1.
Item 1: zero-grant list case (all four SDKs)
The "machine identity token" case now asserts
ListProjectssucceeds with an empty list for a zero-grant token (was: expects 403/ForbiddenError). A new bad-token case asserts 401/AuthError, so the token-authenticates proof stays.Item 2: single-object 403 (all four SDKs)
New case:
GET /projects/{id}with a zero-grant token is forbidden (403). The SDKs have no GetProject method, so it uses a raw HTTP GET like the existing helpers.Item 3: COMPATIBILITY.md
States the rule: list = filtered (empty 200), single object = 403, bad token = 401.
Item 4: results against a local keyorix-server built from current main (SQLite)
CI note (needs coordinator)
Current main defaults
security.require_mfaon (ADR-112), so the admin session used by the contract suites is confined to MFA enrolment and gets 403 on every/api/v1call. Locally I ran withsecurity.require_mfa: falsein a copy of.github/contract-server/keyorix.yaml. That file needs the same line undersecurity:for the Contract job to go green. It is under.github/**, which this PR does not touch, so it needs its own PR. Without it the Contract job fails on main as well, independent of this change.Session: SDK-ZERO-GRANT-1