add credential pre-flight check against proof requests#404
Conversation
d278ea9 to
c711cd9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c711cd9a6c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ac09045 to
a506906
Compare
- add `credential_check` module with `check_proof_request` function - evaluate `Any`/`All`/`Enumerate` constraint expressions against non-expired credentials in the store - expose genesis_issued_at from the DB in CredentialRecord
a506906 to
a24fe97
Compare
|
I've spawned a subagent to inspect the code — will follow up once it has the details. |
|
I have enough context. Let me reply to the review comment. |
|
/otto review with GPT 5.5 |
|
Kicking off a GPT-5.5 review of PR #404 — I'll let you know when it's done posting comments. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the addition — the new API is a useful UX primitive, and the depth/node-limit checks generally mirror the current |
|
The subagent only completed one turn and hasn't posted any review comments yet. Let me prompt it to continue. |
|
Continued review pass completed. Note that the branch currently points at |
|
The GPT-5.5 review is complete. It posted:
|
|
@chipp since worldcoin/world-id-protocol#732 is already merged can we simplify File: walletkit-core/src/proof_request_credential_constraints_check.rs#L139C1-C74 // TODO: replace with `request.0.validate_constraints()?` once |
- fix expires_at doc (>= → >) to match circuit strict comparison - add vault test asserting genesis_issued_at round-trips through list_credentials - fix broken rustdoc intra-doc links in module-level comments Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
PR #404 merged — nothing to do on my end. 🎉 |
Why
Pre-flight check to determine whether the credential store can satisfy a proof request before attempting proof generation. Also validates the structural integrity of the constraint expression, mirroring
ProofRequest::validate_response.What
credential_checkmodule withcheck_proof_request(uniffi-exported)CredentialCheckErrorwithStorage,ConstraintTooDeep, andConstraintTooLargevariantsCredentialValidationandCredentialItemValidationrecords expose per-item and overall satisfaction statusAny/All/Enumerateconstraint expressions against non-expired credentials in the storeMAX_CONSTRAINT_NODESbefore evaluatinggenesis_issued_atfrom the DB inCredentialRecordand uses it together withexpires_atto validateRequestItemtime constraints, preventing false-positiveis_satisfiedresultsRisk
Low — additive; the only changes to existing code are exposing
genesis_issued_atinCredentialRecord(query + struct) and thecredential_checkmodule re-export.