-
Notifications
You must be signed in to change notification settings - Fork 2
[WALLET-202] Add US nationality scope #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
matt-russo-notarize
merged 4 commits into
proof:main
from
matt-russo-notarize:mattrusso/WALLET-202/us-national
Sep 2, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
572f667
[WALLET-202] Add us nationality scope
matt-russo-notarize 0e0c6e8
add exhaustiveness guards, tests, and isNationalUS accessor
matt-russo-notarize 1cdad70
comment
matt-russo-notarize 6fe8de3
Merge branch 'main' into mattrusso/WALLET-202/us-national
matt-russo-notarize File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import { test } from "node:test"; | ||
| import assert from "node:assert/strict"; | ||
|
|
||
| import { PROOF_CREDENTIAL_V1_VCT } from "../dist/index.js"; | ||
| import { getProofCredential } from "../dist/proof_credential_factory.js"; | ||
|
|
||
| const sdjwtWith = (claims) => ({ getClaims: async () => claims }); | ||
|
|
||
| test("maps is_national.us onto isNationalUS", async () => { | ||
| const credential = await getProofCredential( | ||
| sdjwtWith({ | ||
| vct: PROOF_CREDENTIAL_V1_VCT, | ||
| age_equal_or_over: { 18: true }, | ||
| is_national: { us: true }, | ||
| }), | ||
| ); | ||
|
|
||
| assert.equal(credential.isNationalUS, true); | ||
| assert.equal(credential.isOver18, true); | ||
| assert.equal(credential.givenName, undefined); | ||
| assert.equal(credential.familyName, undefined); | ||
| }); | ||
|
|
||
| test("leaves isNationalUS undefined when is_national is absent", async () => { | ||
| const credential = await getProofCredential( | ||
| sdjwtWith({ | ||
| vct: PROOF_CREDENTIAL_V1_VCT, | ||
| given_name: "Frodo", | ||
| age_equal_or_over: { 18: true }, | ||
| }), | ||
| ); | ||
|
|
||
| assert.equal(credential.isNationalUS, undefined); | ||
| assert.equal(credential.givenName, "Frodo"); | ||
| }); |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need
CREDENTIAL_ID_SET?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's so we check
satisfieson compile to ensure no newCredentialTypemember is added without a matching class name.added a comment about it and removed the export