test: add ICRC-3 certified attribute test vectors#3788
Open
aterga wants to merge 1 commit intosea-snake/icrc3-text-typesfrom
Open
test: add ICRC-3 certified attribute test vectors#3788aterga wants to merge 1 commit intosea-snake/icrc3-text-typesfrom
aterga wants to merge 1 commit intosea-snake/icrc3-text-typesfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a reproducible set of ICRC-3 certified-attribute “test vectors” to the Internet Identity integration test suite and documents the encoding/signing pipeline so external verifiers can validate signatures end-to-end.
Changes:
- Adds an
icrc3_test_vectorsintegration test that generates 10 scenario vectors, verifies canister signatures, and prints a JSON payload for capture/regeneration. - Adds documentation describing the encoding pipeline, scenarios, and regeneration steps.
- Checks in a JSON snapshot (
docs/icrc3-test-vectors.json) from a sample test run.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/internet_identity/tests/integration/attributes.rs | New integration test that generates/verifies ICRC-3 vectors and prints them as JSON. |
| docs/icrc3-test-vectors.md | Reference documentation for vector structure, scenarios, and regeneration instructions. |
| docs/icrc3-test-vectors.json | Machine-readable snapshot of generated vectors from one run. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0a5cf6d to
151d340
Compare
b864233 to
3a037f6
Compare
Adds an integration test generating 10 test vectors covering every combination of attribute selection, key scoping, nonce, and value validation that the II backend canister can produce for ICRC-3 certified attributes. The test uses a synthetic OpenID credential backed by a JWT signed in-test by a deterministically-generated RSA key, so the emitted vectors contain no real personal information. The JWKS endpoint is mocked to return the corresponding public key, and the canister verifies the JWT against it in the normal flow. Each vector exercises the full prepare -> get -> verify pipeline and emits Candid message bytes, the domain-separated signed message, and the full CBOR certificate as hex. `ICRC3_ATTRIBUTES_CERTIFICATION_DOMAIN` is promoted from a function-local const in `canister_tests::framework` to a module-level `pub const` so both the test and the verification helper share a single source of truth. Also adds docs/icrc3-test-vectors.md (reference doc) and docs/icrc3-test-vectors.json (machine-readable snapshot from one deterministic run). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3a037f6 to
c89bd78
Compare
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.
Summary
Adds 10 integration test vectors for ICRC-3 certified attributes, covering every combination of attribute selection and encoding that the II backend canister can produce. Built on top of #3770.
Each vector exercises the full pipeline —
prepare_icrc3_attributes→get_icrc3_attributes→ signature verification — and captures:[0x0e] || "ic-sender-info" || message)Scenarios covered:
omit_scope = true)Tests
icrc3_test_vectorsintegration test inattributes.rs— generates all 10 vectors, verifies every CBOR signature, and prints results as JSONdocs/icrc3-test-vectors.md— reference doc explaining the encoding pipeline and how to regeneratedocs/icrc3-test-vectors.json— machine-readable snapshot from a single test run🤖 Generated with Claude Code
< Previous PR |