Skip to content

Add a test that an enrollment token cannot read a fenced key - #90

Merged
ualtinok merged 1 commit into
cortexkit:masterfrom
iceteaSA:test/enrolled-token-fence
Dec 5, 2026
Merged

ualtinok merged 1 commit into
cortexkit:masterfrom
iceteaSA:test/enrolled-token-fence

Conversation

@iceteaSA

@iceteaSA iceteaSA commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Approved issue: none. This pull request changes tests only. If it fits, please label it trivial, as CONTRIBUTING.md allows when there is no design to agree.

What changes

This adds one test, tests::connectors_contract::an_enrollment_token_does_not_reach_a_fenced_key, in crates/credentials-module/src/connectors_tests.rs. It pins the enrolled arm of the transfer-key fence in the scoped read decision (read_surface.rs:3947). An enrollment token with a category grant must get not_found for a fenced key. First, the same token reads an ordinary key in the same category, so the test cannot pass because the token was dropped. No production code changes.

How it was checked

I made 55 small changes to the scoped read decision and the store functions that it calls, one at a time, and ran both full suites (credentials-core and credentials-module) for each change. Existing tests catch 47 of them, and 6 do not change the answer. This test catches one of the remaining two: with the enrolled fence removed, the request gets past the fence and fails later with kind_not_gettable instead of not_found. I can attach the list of the 55 changes if it helps the review.

On the head of this branch (master 7a1be58d plus this commit), on Linux:

  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings pass.
  • The new test passes. With the enrolled fence removed, it fails at its assertion.
  • cargo test -p credentials-module --all-features --no-fail-fast: 1951 passed, 1 failed. The failure is shipped_binary_probe_requires_the_gate_export_and_distinguishes_the_seam_binary (tests/import_picker.rs:321). It needs a shipped binary that our runner does not have, and it fails the same way on the clean base f4313a9f.
  • In one earlier run, vault_access_approval_samples_regenerate_byte_for_byte failed with "signal did not arrive within the wall-clock hang guard". It passed in the next full run.
  • This pull request does not change credentials-core. Its run had one failure only, the engine_tests.rs:1188 test from Add regression tests for record renewal in credentials-core #88.

AI helped write this draft.


Summary by cubic

Adds a test that pins the enrolled arm of the transfer-key fence in the scoped read decision, so an enrollment token with a category grant gets not_found for a fenced key. The test first confirms the same token can read an ordinary key in the same category, so it fails if the token were dropped. Tests only; no production code changes.

Written for commit 40ebc57. Summary will update on new commits.

View guided diff

Pin the enrolled arm of the scoped read decision: an enrollment token
with a category grant gets not_found for a fenced key, after the same
token reads an ordinary key in that category. Tests only.
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Design gate skipped: the trivial label is applied.

@ualtinok ualtinok added the trivial Typo-class change; exempt from the design-approved gate label Dec 5, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

View guided diff | Re-trigger cubic

@ualtinok
ualtinok merged commit 1998cc8 into cortexkit:master Dec 5, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trivial Typo-class change; exempt from the design-approved gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants