-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,17 +1,24 @@ | ||
import { z } from "zod"; | ||
import { decode, disclose } from "../index"; | ||
|
||
import { encodeBase64, decodeBase64 } from "@pagopa/io-react-native-jwt"; | ||
import { SdJwt4VC } from "../types"; | ||
|
||
// Examples from https://www.ietf.org/id/draft-terbu-sd-jwt-vc-02.html#name-example-4 | ||
// but adapted to adhere to format declared in https://italia.github.io/eudi-wallet-it-docs/versione-corrente/en/pid-eaa-data-model.html#id2 | ||
// In short, the token is a Frankenstein composed as follows: | ||
// - the header is taken from the italian specification, with kid and alg valued according to the signing keys | ||
// - disclosures are taken from the SD-JWT-4-VC standard | ||
// - payload is taken from the italian specification, but _sd are compiled with: | ||
// - "address" is used as verification._sd | ||
// - all others disclosures are in claims._sd | ||
const token = | ||
"eyJhbGciOiAiRVMyNTYifQ.eyJfc2QiOiBbIjA5dktySk1PbHlUV00wc2pwdV9wZE9CVkJRMk0xeTNLaHBINTE1blhrcFkiLCAiMnJzakdiYUMwa3k4bVQwcEpyUGlvV1RxMF9kYXcxc1g3NnBvVWxnQ3diSSIsICJFa084ZGhXMGRIRUpidlVIbEVfVkNldUM5dVJFTE9pZUxaaGg3WGJVVHRBIiwgIklsRHpJS2VpWmREd3BxcEs2WmZieXBoRnZ6NUZnbldhLXNONndxUVhDaXciLCAiSnpZakg0c3ZsaUgwUjNQeUVNZmVadTZKdDY5dTVxZWhabzdGN0VQWWxTRSIsICJQb3JGYnBLdVZ1Nnh5bUphZ3ZrRnNGWEFiUm9jMkpHbEFVQTJCQTRvN2NJIiwgIlRHZjRvTGJnd2Q1SlFhSHlLVlFaV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edDisclosures = [ | |
"WyJlbHVWNU9nM2dTTklJOEVZbnN4QV9BIiwgImZhbWlseV9uYW1lIiwgIkRvZSJd", | ||
"WyI2SWo3dE0tYTVpVlBHYm9TNXRtdlZBIiwgImVtYWlsIiwgImpvaG5kb2VAZXhhbXBsZS5jb20iXQ", | ||
"WyJlSThaV205UW5LUHBOUGVOZW5IZGhRIiwgInBob25lX251bWJlciIsICIrMS0yMDItNTU1LTAxMDEiXQ", | ||
"WyJRZ19PNjR6cUF4ZTQxMmExMDhpcm9BIiwgImFkZHJlc3MiLCB7InN0cmVldF9hZGRyZXNzIjogIjEyMyBNYWluIFN0IiwgImxvY2FsaXR5IjogIkFueXRvd24iLCAicmVnaW9uIjogIkFueXN0YXRlIiwgImNvdW50cnkiOiAiVVMifV0", | ||
"WyJBSngtMDk1VlBycFR0TjRRTU9xUk9BIiwgImJpcnRoZGF0ZSIsICIxOTQwLTAxLTAxIl0", | ||
"WyJQYzMzSk0yTGNoY1VfbEhnZ3ZfdWZRIiwgImlzX292ZXJfMTgiLCB0cnVlXQ", | ||
"WyJHMDJOU3JRZmpGWFE3SW8wOXN5YWpBIiwgImlzX292ZXJfMjEiLCB0cnVlXQ", | ||
"WyJsa2x4RjVqTVlsR1RQVW92TU5JdkNBIiwgImlzX292ZXJfNjUiLCB0cnVlXQ", | ||
"WyJRZ19PNjR6cUF4ZTQxMmExMDhpcm9BIiwgImFkZHJlc3MiLCB7InN0cmVldF9hZGRyZXNzIjogIjEyMyBNYWluIFN0IiwgImxvY2FsaXR5IjogIkFueXRvd24iLCAicmVnaW9uIjogIkFueXN0YXRlIiwgImNvdW50cnkiOiAiVVMifV0", | ||
]; | ||
|
||
const sdJwt = { | ||
header: { | ||
typ: "vc+sd-jwt", | ||
alg: "ES256", | ||
kid: "b186ea0c1925793097bf01b8a289a45f", | ||
trust_chain: [ | ||
"NEhRdERpYnlHY3M5WldWTWZ2aUhm ...", | ||
"eyJhbGciOiJSUzI1NiIsImtpZCI6 ...", | ||
"IkJYdmZybG5oQU11SFIwN2FqVW1B ...", | ||
], | ||
}, | ||
payload: { | ||
_sd: [ | ||
"09vKrJMOlyTWM0sjpu_pdOBVBQ2M1y3KhpH515nXkpY", | ||
"2rsjGbaC0ky8mT0pJrPioWTq0_daw1sX76poUlgCwbI", | ||
"EkO8dhW0dHEJbvUHlE_VCeuC9uRELOieLZhh7XbUTtA", | ||
"IlDzIKeiZdDwpqpK6ZfbyphFvz5FgnWa-sN6wqQXCiw", | ||
"JzYjH4svliH0R3PyEMfeZu6Jt69u5qehZo7F7EPYlSE", | ||
"PorFbpKuVu6xymJagvkFsFXAbRoc2JGlAUA2BA4o7cI", | ||
"TGf4oLbgwd5JQaHyKVQZU9UdGE0w5rtDsrZzfUaomLo", | ||
"jdrTE8YcbY4EifugihiAe_BPekxJQZICeiUQwY9QqxI", | ||
"jsu9yVulwQQlhFlM_3JlzMaSFzglhQG0DpfayQwLUK4", | ||
], | ||
iss: "https://example.com/issuer", | ||
iat: 1683000000, | ||
exp: 1883000000, | ||
type: "IdentityCredential", | ||
_sd_alg: "sha-256", | ||
sub: "NzbLsXh8uDCcd7noWXFZAfHkxZsRGC9Xs...", | ||
jti: "urn:uuid:6c5c0a49-b589-431d-bae7-219122a9ec2c", | ||
iat: 1541493724, | ||
exp: 1541493724, | ||
status: "https://example.com/status", | ||
cnf: { | ||
jwk: { | ||
kty: "EC", | ||
crv: "P-256", | ||
x: "TCAER19Zvu3OHF4j4W4vfSVoHIP1ILilDls7vCeGemc", | ||
y: "ZxjiWWbZMQGHVWKVQ4hbSIirsVfuecCE6t4jT9F2HZQ", | ||
kty: "RSA", | ||
use: "sig", | ||
n: "1Ta-sE", | ||
e: "AQAB", | ||
kid: "YhNFS3YnC9tjiCaivhWLVUJ3AxwGGz_98uRFaqMEEs", | ||
}, | ||
}, | ||
type: "PersonIdentificationData", | ||
verified_claims: { | ||
verification: { | ||
_sd: ["JzYjH4svliH0R3PyEMfeZu6Jt69u5qehZo7F7EPYlSE"], | ||
trust_framework: "eidas", | ||
assurance_level: "high", | ||
}, | ||
claims: { | ||
_sd: [ | ||
"09vKrJMOlyTWM0sjpu_pdOBVBQ2M1y3KhpH515nXkpY", | ||
"2rsjGbaC0ky8mT0pJrPioWTq0_daw1sX76poUlgCwbI", | ||
"EkO8dhW0dHEJbvUHlE_VCeuC9uRELOieLZhh7XbUTtA", | ||
"IlDzIKeiZdDwpqpK6ZfbyphFvz5FgnWa-sN6wqQXCiw", | ||
"PorFbpKuVu6xymJagvkFsFXAbRoc2JGlAUA2BA4o7cI", | ||
"TGf4oLbgwd5JQaHyKVQZU9UdGE0w5rtDsrZzfUaomLo", | ||
"jdrTE8YcbY4EifugihiAe_BPekxJQZICeiUQwY9QqxI", | ||
"jsu9yVulwQQlhFlM_3JlzMaSFzglhQG0DpfayQwLUK4", | ||
], | ||
}, | ||
}, | ||
_sd_alg: "sha-256", | ||
}, | ||
}; | ||
|
||
|
@@ -65,6 +91,10 @@ const disclosures = [ | |
["eluV5Og3gSNII8EYnsxA_A", "family_name", "Doe"], | ||
["6Ij7tM-a5iVPGboS5tmvVA", "email", "[email protected]"], | ||
["eI8ZWm9QnKPpNPeNenHdhQ", "phone_number", "+1-202-555-0101"], | ||
["AJx-095VPrpTtN4QMOqROA", "birthdate", "1940-01-01"], | ||
["Pc33JM2LchcU_lHggv_ufQ", "is_over_18", true], | ||
["G02NSrQfjFXQ7Io09syajA", "is_over_21", true], | ||
["lklxF5jMYlGTPUovMNIvCA", "is_over_65", true], | ||
[ | ||
"Qg_O64zqAxe412a108iroA", | ||
"address", | ||
|
@@ -75,10 +105,6 @@ const disclosures = [ | |
country: "US", | ||
}, | ||
], | ||
["AJx-095VPrpTtN4QMOqROA", "birthdate", "1940-01-01"], | ||
["Pc33JM2LchcU_lHggv_ufQ", "is_over_18", true], | ||
["G02NSrQfjFXQ7Io09syajA", "is_over_21", true], | ||
["lklxF5jMYlGTPUovMNIvCA", "is_over_65", true], | ||
]; | ||
it("Ensures example data correctness", () => { | ||
expect( | ||
|
@@ -89,11 +115,11 @@ it("Ensures example data correctness", () => { | |
|
||
describe("decode", () => { | ||
it("should decode a valid token", () => { | ||
// @ts-ignore because z.any() != z.AnyObject() | ||
const result = decode(token, z.any()); | ||
const result = decode(token, SdJwt4VC); | ||
|
||
expect(result.sdJwt).toEqual(sdJwt); | ||
expect(result.disclosures).toEqual(disclosures); | ||
expect(result.disclosures.length).toBe(disclosures.length); | ||
expect(result.disclosures).toEqual(expect.arrayContaining(disclosures)); | ||
}); | ||
}); | ||
|
||
|