@pagopa/io-react-native-wallet 0.11.1 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/client/generated/wallet-provider.js +126 -0
- package/lib/commonjs/client/generated/wallet-provider.js.map +1 -0
- package/lib/commonjs/client/index.js +40 -0
- package/lib/commonjs/client/index.js.map +1 -0
- package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +2 -1
- package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
- package/lib/commonjs/credential/issuance/03-start-credential-issuance.js +287 -0
- package/lib/commonjs/credential/issuance/03-start-credential-issuance.js.map +1 -0
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js +56 -83
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +88 -0
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/05-authorize-access.js +56 -33
- package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +51 -78
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +21 -44
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/index.js +7 -0
- package/lib/commonjs/credential/issuance/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/types.js +28 -0
- package/lib/commonjs/credential/issuance/types.js.map +1 -0
- package/lib/commonjs/index.js +10 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/pid/sd-jwt/converters.js +5 -9
- package/lib/commonjs/pid/sd-jwt/converters.js.map +1 -1
- package/lib/commonjs/pid/sd-jwt/types.js +3 -3
- package/lib/commonjs/pid/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/converters.test.js +1 -1
- package/lib/commonjs/sd-jwt/__test__/converters.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/index.test.js +30 -43
- package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/types.test.js +16 -24
- package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/index.js +3 -9
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +11 -16
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/trust/types.js +70 -29
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/utils/auth.js +44 -0
- package/lib/commonjs/utils/auth.js.map +1 -0
- package/lib/commonjs/utils/errors.js +104 -1
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/commonjs/utils/integrity.js +2 -0
- package/lib/commonjs/utils/integrity.js.map +1 -0
- package/lib/commonjs/utils/misc.js +34 -1
- package/lib/commonjs/utils/misc.js.map +1 -1
- package/lib/commonjs/utils/par.js +23 -15
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/commonjs/utils/pop.js +33 -0
- package/lib/commonjs/utils/pop.js.map +1 -0
- package/lib/commonjs/wallet-instance/index.js +29 -0
- package/lib/commonjs/wallet-instance/index.js.map +1 -0
- package/lib/commonjs/wallet-instance-attestation/issuing.js +62 -65
- package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/types.js +8 -8
- package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
- package/lib/module/client/generated/wallet-provider.js +102 -0
- package/lib/module/client/generated/wallet-provider.js.map +1 -0
- package/lib/module/client/index.js +33 -0
- package/lib/module/client/index.js.map +1 -0
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +2 -1
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
- package/lib/module/credential/issuance/03-start-credential-issuance.js +276 -0
- package/lib/module/credential/issuance/03-start-credential-issuance.js.map +1 -0
- package/lib/module/credential/issuance/03-start-user-authorization.js +56 -80
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +85 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/05-authorize-access.js +54 -33
- package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +50 -75
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +21 -44
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/index.js +2 -1
- package/lib/module/credential/issuance/index.js.map +1 -1
- package/lib/module/credential/issuance/types.js +18 -0
- package/lib/module/credential/issuance/types.js.map +1 -0
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/pid/sd-jwt/converters.js +5 -9
- package/lib/module/pid/sd-jwt/converters.js.map +1 -1
- package/lib/module/pid/sd-jwt/types.js +3 -3
- package/lib/module/pid/sd-jwt/types.js.map +1 -1
- package/lib/module/sd-jwt/__test__/converters.test.js +1 -1
- package/lib/module/sd-jwt/__test__/converters.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/index.test.js +30 -43
- package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/types.test.js +16 -24
- package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/module/sd-jwt/index.js +3 -9
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/types.js +11 -16
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/trust/types.js +70 -29
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/utils/auth.js +35 -0
- package/lib/module/utils/auth.js.map +1 -0
- package/lib/module/utils/errors.js +98 -0
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/module/utils/integrity.js +2 -0
- package/lib/module/utils/integrity.js.map +1 -0
- package/lib/module/utils/misc.js +31 -0
- package/lib/module/utils/misc.js.map +1 -1
- package/lib/module/utils/par.js +24 -16
- package/lib/module/utils/par.js.map +1 -1
- package/lib/module/utils/pop.js +24 -0
- package/lib/module/utils/pop.js.map +1 -0
- package/lib/module/wallet-instance/index.js +23 -0
- package/lib/module/wallet-instance/index.js.map +1 -0
- package/lib/module/wallet-instance-attestation/issuing.js +63 -67
- package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/module/wallet-instance-attestation/types.js +8 -8
- package/lib/module/wallet-instance-attestation/types.js.map +1 -1
- package/lib/typescript/client/generated/wallet-provider.d.ts +264 -0
- package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -0
- package/lib/typescript/client/index.d.ts +7 -0
- package/lib/typescript/client/index.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -0
- package/lib/typescript/credential/issuance/01-start-flow.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +2 -1
- package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/03-start-credential-issuance.d.ts +41 -0
- package/lib/typescript/credential/issuance/03-start-credential-issuance.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +23 -18
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +24 -12
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts +22 -16
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +19 -26
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +10 -15
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/index.d.ts +3 -4
- package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/types.d.ts +63 -0
- package/lib/typescript/credential/issuance/types.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/types.d.ts +6 -6
- package/lib/typescript/index.d.ts +6 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/pid/sd-jwt/converters.d.ts.map +1 -1
- package/lib/typescript/pid/sd-jwt/types.d.ts +36 -36
- package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/index.d.ts +40 -68
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +64 -121
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/trust/index.d.ts +150 -48
- package/lib/typescript/trust/index.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +2838 -1740
- package/lib/typescript/trust/types.d.ts.map +1 -1
- package/lib/typescript/utils/auth.d.ts +52 -0
- package/lib/typescript/utils/auth.d.ts.map +1 -0
- package/lib/typescript/utils/errors.d.ts +48 -0
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/lib/typescript/utils/integrity.d.ts +21 -0
- package/lib/typescript/utils/integrity.d.ts.map +1 -0
- package/lib/typescript/utils/misc.d.ts +18 -0
- package/lib/typescript/utils/misc.d.ts.map +1 -1
- package/lib/typescript/utils/par.d.ts +8 -31
- package/lib/typescript/utils/par.d.ts.map +1 -1
- package/lib/typescript/utils/pop.d.ts +26 -0
- package/lib/typescript/utils/pop.d.ts.map +1 -0
- package/lib/typescript/wallet-instance/index.d.ts +7 -0
- package/lib/typescript/wallet-instance/index.d.ts.map +1 -0
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts +17 -4
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +64 -64
- package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
- package/package.json +9 -5
- package/src/client/generated/wallet-provider.ts +173 -0
- package/src/client/index.ts +53 -0
- package/src/credential/issuance/01-start-flow.ts +1 -0
- package/src/credential/issuance/02-evaluate-issuer-trust.ts +2 -1
- package/src/credential/issuance/03-start-credential-issuance.ts +407 -0
- package/src/credential/issuance/03-start-user-authorization.ts +91 -92
- package/src/credential/issuance/04-complete-user-authorization.ts +114 -13
- package/src/credential/issuance/05-authorize-access.ts +74 -49
- package/src/credential/issuance/06-obtain-credential.ts +77 -111
- package/src/credential/issuance/07-verify-and-parse-credential.ts +30 -67
- package/src/credential/issuance/index.ts +6 -4
- package/src/credential/issuance/types.ts +25 -0
- package/src/index.ts +8 -0
- package/src/pid/sd-jwt/converters.ts +5 -11
- package/src/pid/sd-jwt/types.ts +8 -6
- package/src/sd-jwt/__test__/converters.test.ts +1 -1
- package/src/sd-jwt/__test__/index.test.ts +45 -74
- package/src/sd-jwt/__test__/types.test.ts +21 -33
- package/src/sd-jwt/index.ts +3 -12
- package/src/sd-jwt/types.ts +17 -22
- package/src/trust/types.ts +64 -32
- package/src/utils/auth.ts +37 -0
- package/src/utils/errors.ts +112 -0
- package/src/utils/integrity.ts +23 -0
- package/src/utils/misc.ts +43 -0
- package/src/utils/par.ts +29 -17
- package/src/utils/pop.ts +34 -0
- package/src/wallet-instance/index.ts +29 -0
- package/src/wallet-instance-attestation/issuing.ts +101 -97
- package/src/wallet-instance-attestation/types.ts +12 -8
- package/lib/commonjs/credential/issuance/07-confirm-credential.js +0 -6
- package/lib/commonjs/credential/issuance/07-confirm-credential.js.map +0 -1
- package/lib/commonjs/credential/issuance/08-confirm-credential.js +0 -6
- package/lib/commonjs/credential/issuance/08-confirm-credential.js.map +0 -1
- package/lib/module/credential/issuance/07-confirm-credential.js +0 -2
- package/lib/module/credential/issuance/07-confirm-credential.js.map +0 -1
- package/lib/module/credential/issuance/08-confirm-credential.js +0 -2
- package/lib/module/credential/issuance/08-confirm-credential.js.map +0 -1
- package/lib/typescript/credential/issuance/07-confirm-credential.d.ts +0 -11
- package/lib/typescript/credential/issuance/07-confirm-credential.d.ts.map +0 -1
- package/lib/typescript/credential/issuance/08-confirm-credential.d.ts +0 -11
- package/lib/typescript/credential/issuance/08-confirm-credential.d.ts.map +0 -1
- package/src/credential/issuance/07-confirm-credential.ts +0 -14
- package/src/credential/issuance/08-confirm-credential.ts +0 -14
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["decode","decodeJwt","verify","verifyJwt","sha256ToBase64","decodeBase64","Disclosure","SdJwt4VC","verifyDisclosure","ClaimsNotFoundBetweenDislosures","ClaimsNotFoundInToken","decodeDisclosure","encoded","decoded","parse","JSON","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","parser","sdJwt","header","protectedHeader","payload","disclosures","map","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","hash","
|
1
|
+
{"version":3,"names":["decode","decodeJwt","verify","verifyJwt","sha256ToBase64","decodeBase64","Disclosure","SdJwt4VC","verifyDisclosure","ClaimsNotFoundBetweenDislosures","ClaimsNotFoundInToken","decodeDisclosure","encoded","decoded","parse","JSON","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","parser","sdJwt","header","protectedHeader","payload","disclosures","map","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","hash","_sd","includes","index","indexOf","path","filteredDisclosures","filter","d","disclosedToken","join","publicKey"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":"AAEA,SAASA,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,cAAc,QAAQ,6BAA6B;AAE5D,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,UAAU,EAAEC,QAAQ,QAAoC,SAAS;AAC1E,SAASC,gBAAgB,QAAQ,YAAY;AAE7C,SACEC,+B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AC,CAACI,IAAI,CAAC,GAAG,CAAC;EAEnE,OAAO;IAAElC,KAAK,EAAEiC,cAAc;IAAEjB;EAAM,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM9B,MAAM,GAAG,MAAAA,CACpBc,KAAa,EACbmC,SAAsB,EACtBlC,YAAgB,KAC8C;EAC9D;EACA,MAAM,CAACE,QAAQ,GAAG,EAAE,CAAC,GAAGH,KAAK,CAACK,KAAK,CAAC,GAAG,CAAC;EACxC,MAAMR,OAAO,GAAGb,MAAM,CAACgB,KAAK,EAAEC,YAAY,CAAC;;EAE3C;EACA,MAAMd,SAAS,CAACgB,QAAQ,EAAEgC,SAAS,CAAC;;EAEpC;EACA,MAAMpB,MAAM,GAAG,CAAC,GAAGlB,OAAO,CAACW,KAAK,CAACG,OAAO,CAACc,GAAG,CAAC;EAE7C,MAAMR,OAAO,CAACC,GAAG,CACfrB,OAAO,CAACe,WAAW,CAACC,GAAG,CACrB,MAAOO,UAAU,IAAK,MAAM5B,gBAAgB,CAAC4B,UAAU,EAAEL,MAAM,CACjE,CACF,CAAC;EAED,OAAO;IACLP,KAAK,EAAEX,OAAO,CAACW,KAAK;IACpBI,WAAW,EAAEf,OAAO,CAACe,WAAW,CAACC,GAAG,CAAEmB,CAAC,IAAKA,CAAC,CAACnC,OAAO;EACvD,CAAC;AACH,CAAC;AAED,SAASN,QAAQ"}
|
@@ -27,28 +27,23 @@ export const SdJwt4VC = z.object({
|
|
27
27
|
header: z.object({
|
28
28
|
typ: z.literal("vc+sd-jwt"),
|
29
29
|
alg: z.string(),
|
30
|
-
kid: z.string().optional()
|
31
|
-
trust_chain: z.array(z.string())
|
30
|
+
kid: z.string().optional()
|
32
31
|
}),
|
33
|
-
payload: z.object({
|
32
|
+
payload: z.intersection(z.object({
|
34
33
|
iss: z.string(),
|
35
34
|
sub: z.string(),
|
36
|
-
|
37
|
-
iat: UnixTime,
|
35
|
+
iat: UnixTime.optional(),
|
38
36
|
exp: UnixTime,
|
39
|
-
|
37
|
+
_sd_alg: z.literal("sha-256"),
|
38
|
+
status: z.object({
|
39
|
+
status_attestation: z.object({
|
40
|
+
credential_hash_alg: z.literal("sha-256")
|
41
|
+
})
|
42
|
+
}),
|
40
43
|
cnf: z.object({
|
41
44
|
jwk: JWK
|
42
45
|
}),
|
43
|
-
|
44
|
-
|
45
|
-
verification: z.intersection(z.object({
|
46
|
-
trust_framework: z.literal("eidas"),
|
47
|
-
assurance_level: z.string()
|
48
|
-
}), ObfuscatedDisclosures),
|
49
|
-
claims: ObfuscatedDisclosures
|
50
|
-
}),
|
51
|
-
_sd_alg: z.literal("sha-256")
|
52
|
-
})
|
46
|
+
vct: z.string()
|
47
|
+
}), ObfuscatedDisclosures)
|
53
48
|
});
|
54
49
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JWK","z","UnixTime","number","min","max","ObfuscatedDisclosures","object","_sd","array","string","Disclosure","tuple","unknown","SdJwt4VC","header","typ","literal","alg","kid","optional","
|
1
|
+
{"version":3,"names":["JWK","z","UnixTime","number","min","max","ObfuscatedDisclosures","object","_sd","array","string","Disclosure","tuple","unknown","SdJwt4VC","header","typ","literal","alg","kid","optional","payload","intersection","iss","sub","iat","exp","_sd_alg","status","status_attestation","credential_hash_alg","cnf","jwk","vct"],"sourceRoot":"../../../src","sources":["sd-jwt/types.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,cAAc;AAClC,SAASC,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,QAAQ,GAAGD,CAAC,CAACE,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,aAAa,CAAC;AAI5D,OAAO,MAAMC,qBAAqB,GAAGL,CAAC,CAACM,MAAM,CAAC;EAAEC,GAAG,EAAEP,CAAC,CAACQ,KAAK,CAACR,CAAC,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C,CAACS,MAAM,CAAC;EAChB,CAAC,CAAC,EACFJ,qBACF;AACF,CAAC,CAAC"}
|
@@ -24,30 +24,40 @@ const CredentialDisplayMetadata = z.object({
|
|
24
24
|
logo: z.object({
|
25
25
|
url: z.string(),
|
26
26
|
alt_text: z.string()
|
27
|
-
}),
|
28
|
-
|
29
|
-
|
27
|
+
}).optional(),
|
28
|
+
// TODO [SIW-1268]: should not be optional
|
29
|
+
background_color: z.string().optional(),
|
30
|
+
// TODO [SIW-1268]: should not be optional
|
31
|
+
text_color: z.string().optional() // TODO [SIW-1268]: should not be optional
|
30
32
|
});
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
|
34
|
+
// Metadata for displaying issuer information
|
35
|
+
|
36
|
+
const CredentialIssuerDisplayMetadata = z.object({
|
37
|
+
name: z.string(),
|
38
|
+
locale: z.string(),
|
39
|
+
logo: z.object({
|
40
|
+
url: z.string(),
|
41
|
+
alt_text: z.string()
|
42
|
+
})
|
40
43
|
});
|
44
|
+
const ClaimsMetadata = z.record(z.object({
|
45
|
+
value_type: z.string(),
|
46
|
+
display: z.array(z.object({
|
47
|
+
name: z.string(),
|
48
|
+
locale: z.string()
|
49
|
+
}))
|
50
|
+
}));
|
41
51
|
|
42
52
|
// Metadata for a credentia which i supported by a Issuer
|
43
53
|
|
44
54
|
const SupportedCredentialMetadata = z.object({
|
45
|
-
id: z.string(),
|
46
55
|
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
47
|
-
|
48
|
-
cryptographic_suites_supported: z.array(z.string()),
|
56
|
+
scope: z.string(),
|
49
57
|
display: z.array(CredentialDisplayMetadata),
|
50
|
-
|
58
|
+
claims: ClaimsMetadata,
|
59
|
+
cryptographic_binding_methods_supported: z.array(z.string()),
|
60
|
+
credential_signing_alg_values_supported: z.array(z.string())
|
51
61
|
});
|
52
62
|
export const EntityStatement = z.object({
|
53
63
|
header: z.object({
|
@@ -92,17 +102,17 @@ const FederationEntityMetadata = z.object({
|
|
92
102
|
const BaseEntityConfiguration = z.object({
|
93
103
|
header: EntityConfigurationHeader,
|
94
104
|
payload: z.object({
|
95
|
-
exp: UnixTime,
|
96
|
-
iat: UnixTime,
|
97
105
|
iss: z.string(),
|
98
106
|
sub: z.string(),
|
99
|
-
|
100
|
-
|
101
|
-
|
107
|
+
iat: UnixTime,
|
108
|
+
exp: UnixTime,
|
109
|
+
authority_hints: z.array(z.string()).optional(),
|
102
110
|
metadata: z.object({
|
103
111
|
federation_entity: FederationEntityMetadata
|
104
112
|
}).passthrough(),
|
105
|
-
|
113
|
+
jwks: z.object({
|
114
|
+
keys: z.array(JWK)
|
115
|
+
})
|
106
116
|
}).passthrough()
|
107
117
|
});
|
108
118
|
|
@@ -120,20 +130,51 @@ export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(z
|
|
120
130
|
metadata: z.object({
|
121
131
|
openid_credential_issuer: z.object({
|
122
132
|
credential_issuer: z.string(),
|
123
|
-
authorization_endpoint: z.string(),
|
124
|
-
token_endpoint: z.string(),
|
125
|
-
pushed_authorization_request_endpoint: z.string(),
|
126
|
-
dpop_signing_alg_values_supported: z.array(z.string()),
|
127
133
|
credential_endpoint: z.string(),
|
128
|
-
|
134
|
+
revocation_endpoint: z.string(),
|
135
|
+
status_attestation_endpoint: z.string(),
|
136
|
+
display: z.array(CredentialIssuerDisplayMetadata),
|
137
|
+
credential_configurations_supported: z.record(SupportedCredentialMetadata),
|
129
138
|
jwks: z.object({
|
130
139
|
keys: z.array(JWK)
|
131
140
|
})
|
132
141
|
}),
|
142
|
+
oauth_authorization_server: z.object({
|
143
|
+
authorization_endpoint: z.string(),
|
144
|
+
pushed_authorization_request_endpoint: z.string(),
|
145
|
+
dpop_signing_alg_values_supported: z.array(z.string()).optional(),
|
146
|
+
// TODO [SIW-1268]: should not be optional
|
147
|
+
token_endpoint: z.string(),
|
148
|
+
introspection_endpoint: z.string().optional(),
|
149
|
+
// TODO [SIW-1268]: should not be optional
|
150
|
+
client_registration_types_supported: z.array(z.string()),
|
151
|
+
code_challenge_methods_supported: z.array(z.string()),
|
152
|
+
authorization_details_types_supported: z.array(z.string()).optional(),
|
153
|
+
// TODO [SIW-1268]: should not be optional,
|
154
|
+
acr_values_supported: z.array(z.string()),
|
155
|
+
grant_types_supported: z.array(z.string()),
|
156
|
+
issuer: z.string(),
|
157
|
+
jwks: z.object({
|
158
|
+
keys: z.array(JWK)
|
159
|
+
}),
|
160
|
+
scopes_supported: z.array(z.string()),
|
161
|
+
request_parameter_supported: z.boolean().optional(),
|
162
|
+
// TODO [SIW-1268]: should not be optional
|
163
|
+
request_uri_parameter_supported: z.boolean().optional(),
|
164
|
+
// TODO [SIW-1268]: should not be optional
|
165
|
+
response_types_supported: z.array(z.string()).optional(),
|
166
|
+
// TODO [SIW-1268]: should not be optional
|
167
|
+
response_modes_supported: z.array(z.string()),
|
168
|
+
subject_types_supported: z.array(z.string()).optional(),
|
169
|
+
// TODO [SIW-1268]: should not be optional
|
170
|
+
token_endpoint_auth_methods_supported: z.array(z.string()),
|
171
|
+
token_endpoint_auth_signing_alg_values_supported: z.array(z.string()),
|
172
|
+
request_object_signing_alg_values_supported: z.array(z.string())
|
173
|
+
}),
|
133
174
|
/** Credential Issuers act as Relying Party
|
134
175
|
when they require the presentation of other credentials.
|
135
176
|
This does not apply for PID issuance, which requires CIE authz. */
|
136
|
-
|
177
|
+
openid_relying_party: RelyingPartyMetadata.optional()
|
137
178
|
})
|
138
179
|
})
|
139
180
|
}));
|
@@ -155,7 +196,7 @@ export const WalletProviderEntityConfiguration = BaseEntityConfiguration.and(z.o
|
|
155
196
|
metadata: z.object({
|
156
197
|
wallet_provider: z.object({
|
157
198
|
token_endpoint: z.string(),
|
158
|
-
|
199
|
+
aal_values_supported: z.array(z.string()).optional(),
|
159
200
|
grant_types_supported: z.array(z.string()),
|
160
201
|
token_endpoint_auth_methods_supported: z.array(z.string()),
|
161
202
|
token_endpoint_auth_signing_alg_values_supported: z.array(z.string()),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialDefinitionMetadata","type","credentialSubject","record","mandatory","boolean","display","SupportedCredentialMetadata","format","union","literal","cryptographic_binding_methods_supported","cryptographic_suites_supported","credential_definition","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","metadata","federation_entity","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","EntityConfiguration","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAEC,UAAU,EAAEL,CAAC,CAACI,MAAM,CAAC;AAAE,CAAC,CAAC;AAG7E,MAAME,oBAAoB,GAAGN,CAAC,CAACE,MAAM,CAAC;EACpCK,gBAAgB,EAAEP,CAAC,CAACI,MAA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,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CACjBI,QAAQ,CAAC,CAAC;QACbyE,qBAAqB,EAAEjF,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1C8E,qCAAqC,EAAElF,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1D+E,gDAAgD,EAAEnF,CAAC,CAACa,KAAK,CACvDb,CAAC,CAACI,MAAM,CAAC,CACX,CAAC;QACDO,IAAI,EAAEX,CAAC,CAACE,MAAM,CAAC;UAAEU,IAAI,EAAEZ,CAAC,CAACa,KAAK,CAACd,GAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACD6D,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;;AAEA,OAAO,MAAMwB,mBAAmB,GAAGpF,CAAC,CAACgC,KAAK,CACxC,CACE8C,iCAAiC,EACjCZ,mCAAmC,EACnCD,8BAA8B,EAC9BY,+BAA+B,CAChC,EACD;EACEQ,WAAW,EAAE;AACf,CACF,CAAC"}
|
1
|
+
{"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialIssuerDisplayMetadata","ClaimsMetadata","record","value_type","display","SupportedCredentialMetadata","format","union","literal","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","status_attestation_endpoint","credential_configurations_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","token_endpoint","introspection_endpoint","client_registration_types_supported","code_challenge_methods_supported","authorization_details_types_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","request_parameter_supported","boolean","request_uri_parameter_supported","response_types_supported","response_modes_supported","subject_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","openid_relying_party","RelyingPartyEntityConfiguration","wallet_relying_party","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAEC,UAAU,EAAEL,CAAC,CAACI,MAAM,CAAC;AAAE,CAAC,CAAC;AAG7E,MAAME,oBAAoB,GAAGN,CAAC,CAACE,MAAM,CAAC;EACpCK,gBAAgB,EAAEP,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EACvCC,SAAS,EAAET,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EAChCE,WAAW,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EAClCG,IAAI,EAAEX,CAAC,CAACE,MAAM,CAAC;IAAEU,IAAI,EAAEZ,CAAC,CAACa,KAAK,CAACd,GAAG;EAAE,CAAC,CAAC;EACtCe,QAAQ,EAAEd,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACI,QAAQ,CAA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
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Context for authorization during the {@link 03-start-user-authorization.ts} phase.
|
5
|
+
* It consists of a single method to identify the user which takes a URL and a redirect schema as input.
|
6
|
+
* Once the authorization is completed and the URL calls the redirect schema, the method should return the redirect URL.
|
7
|
+
*/
|
8
|
+
|
9
|
+
/**
|
10
|
+
* The result of the identification process.
|
11
|
+
*/
|
12
|
+
export const AuthorizationResultShape = z.object({
|
13
|
+
code: z.string(),
|
14
|
+
state: z.string(),
|
15
|
+
iss: z.string().optional()
|
16
|
+
});
|
17
|
+
|
18
|
+
/**
|
19
|
+
* The error of the identification process.
|
20
|
+
* It follows the OAuth/OIDC error response format.
|
21
|
+
* @see https://openid.net/specs/openid-connect-core-1_0.html#AuthError
|
22
|
+
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1
|
23
|
+
*/
|
24
|
+
export const AuthorizationErrorShape = z.object({
|
25
|
+
error: z.string(),
|
26
|
+
// not enforcing the error code format
|
27
|
+
error_description: z.string().optional(),
|
28
|
+
error_uri: z.string().optional(),
|
29
|
+
state: z.string().optional()
|
30
|
+
});
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Type of the identification result.
|
34
|
+
*/
|
35
|
+
//# sourceMappingURL=auth.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["z","AuthorizationResultShape","object","code","string","state","iss","optional","AuthorizationErrorShape","error","error_description","error_uri"],"sourceRoot":"../../../src","sources":["utils/auth.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;;AAExB;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAGD,CAAC,CAACE,MAAM,CAAC;EAC/CC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAChBC,KAAK,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACjBE,GAAG,EAAEN,CAAC,CAACI,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC;AAC3B,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGR,CAAC,CAACE,MAAM,CAAC;EAC9CO,KAAK,EAAET,CAAC,CAACI,MAAM,CAAC,CAAC;EAAE;EACnBM,iBAAiB,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EACxCI,SAAS,EAAEX,CAAC,CAACI,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAChCF,KAAK,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC;AAC7B,CAAC,CAAC;;AAEF;AACA;AACA"}
|
@@ -218,4 +218,102 @@ export class PidMetadataError extends Error {
|
|
218
218
|
super(message);
|
219
219
|
}
|
220
220
|
}
|
221
|
+
|
222
|
+
/**
|
223
|
+
* An error subclass thrown when a Wallet Provider http request fail
|
224
|
+
*
|
225
|
+
*/
|
226
|
+
export class WalletProviderResponseError extends IoWalletError {
|
227
|
+
static get code() {
|
228
|
+
return "ERR_IO_WALLET_PROVIDER_RESPONSE_FAILED";
|
229
|
+
}
|
230
|
+
code = "ERR_IO_WALLET_PROVIDER_RESPONSE_FAILED";
|
231
|
+
|
232
|
+
/** The Claim for which the validation failed. */
|
233
|
+
|
234
|
+
/** Reason code for the validation failure. */
|
235
|
+
|
236
|
+
/** HTTP status code */
|
237
|
+
|
238
|
+
constructor(message) {
|
239
|
+
let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
|
240
|
+
let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
|
241
|
+
let statusCode = arguments.length > 3 ? arguments[3] : undefined;
|
242
|
+
super(serializeAttrs({
|
243
|
+
message,
|
244
|
+
claim,
|
245
|
+
reason,
|
246
|
+
statusCode: statusCode.toString()
|
247
|
+
}));
|
248
|
+
this.claim = claim;
|
249
|
+
this.reason = reason;
|
250
|
+
this.statusCode = statusCode;
|
251
|
+
}
|
252
|
+
}
|
253
|
+
export class WalletInstanceRevokedError extends IoWalletError {
|
254
|
+
static get code() {
|
255
|
+
return "ERR_IO_WALLET_INSTANCE_REVOKED";
|
256
|
+
}
|
257
|
+
code = "ERR_IO_WALLET_INSTANCE_REVOKED";
|
258
|
+
constructor(message, claim) {
|
259
|
+
let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
|
260
|
+
super(serializeAttrs({
|
261
|
+
message,
|
262
|
+
claim,
|
263
|
+
reason
|
264
|
+
}));
|
265
|
+
this.reason = reason;
|
266
|
+
this.claim = claim;
|
267
|
+
}
|
268
|
+
}
|
269
|
+
export class WalletInstanceNotFoundError extends IoWalletError {
|
270
|
+
static get code() {
|
271
|
+
return "ERR_IO_WALLET_INSTANCE_NOT_FOUND";
|
272
|
+
}
|
273
|
+
code = "ERR_IO_WALLET_INSTANCE_NOT_FOUND";
|
274
|
+
constructor(message, claim) {
|
275
|
+
let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
|
276
|
+
super(serializeAttrs({
|
277
|
+
message,
|
278
|
+
claim,
|
279
|
+
reason
|
280
|
+
}));
|
281
|
+
this.reason = reason;
|
282
|
+
this.claim = claim;
|
283
|
+
}
|
284
|
+
}
|
285
|
+
|
286
|
+
/**
|
287
|
+
* An error subclass thrown when an error occurs during the authorization process.
|
288
|
+
*/
|
289
|
+
export class AuthorizationError extends IoWalletError {
|
290
|
+
static get code() {
|
291
|
+
return "ERR_IO_WALLET_AUTHORIZATION_ERROR";
|
292
|
+
}
|
293
|
+
code = "ERR_IO_WALLET_AUTHORIZATION_ERROR";
|
294
|
+
constructor(message) {
|
295
|
+
super(message);
|
296
|
+
}
|
297
|
+
}
|
298
|
+
|
299
|
+
/**
|
300
|
+
* An error subclass thrown when an error occurs during the authorization process with the IDP.
|
301
|
+
* It contains the error and error description returned by the IDP.
|
302
|
+
*/
|
303
|
+
export class AuthorizationIdpError extends IoWalletError {
|
304
|
+
static get code() {
|
305
|
+
return "ERR_IO_WALLET_IDENTIFICATION_RESPONSE_ERROR";
|
306
|
+
}
|
307
|
+
code = "ERR_IO_WALLET_IDENTIFICATION_RESPONSE_PARSING_FAILED";
|
308
|
+
constructor(error, errorDescription) {
|
309
|
+
super(serializeAttrs(errorDescription ? {
|
310
|
+
error,
|
311
|
+
errorDescription
|
312
|
+
} : {
|
313
|
+
error
|
314
|
+
}));
|
315
|
+
this.error = error;
|
316
|
+
this.errorDescription = errorDescription;
|
317
|
+
}
|
318
|
+
}
|
221
319
|
//# sourceMappingURL=errors.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAIC,KAAsC,IAC5DC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,CAAC,CAAC;AAAA,EAAC,CAChEH,GAAG,CAAEO,CAAC,IAAKA,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA,OAAO,MAAME,wCAAwC,SAASrB,KAAK,CAAC;EAClE,WAAWC,IAAIA,CAAA,EAAqC;IAClD,OAAO,gCAAgC;EACzC;EAEAA,IAAI,GAAG,gCAAgC;;EAEvC;AACF;AACA;EACEC,WAAWA,CAACoB,QAAgB,EAAE;IAC5B,MAAMnB,OAAO,GAAI,0DAAyDmB,QAAS,IAAG;IACtF,KAAK,CAACnB,OAAO,CAAC;EAChB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMoB,gBAAgB,SAASvB,KAAK,CAAC;EAC1C,WAAWC,IAAIA,CAAA,EAAyB;IACtC,OAAO,oBAAoB;EAC7B;EAEAC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;EAChB;AACF"}
|
1
|
+
{"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","statusCode","toString","WalletInstanceRevokedError","WalletInstanceNotFoundError","AuthorizationError","AuthorizationIdpError","error","errorDescription"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAIC,KAAsC,IAC5DC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,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AA,IAAI,GAAG,mCAAmC;EAE1CC,WAAWA,CAACC,OAAgB,EAAE;IAC5B,KAAK,CAACA,OAAO,CAAC;EAChB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAM2B,qBAAqB,SAAS/B,aAAa,CAAC;EACvD,WAAWE,IAAIA,CAAA,EAAkD;IAC/D,OAAO,6CAA6C;EACtD;EAEAA,IAAI,GAAG,sDAAsD;EAK7DC,WAAWA,CAAC6B,KAAa,EAAEC,gBAAyB,EAAE;IACpD,KAAK,CACH7C,cAAc,CAAC6C,gBAAgB,GAAG;MAAED,KAAK;MAAEC;IAAiB,CAAC,GAAG;MAAED;IAAM,CAAC,CAC3E,CAAC;IACD,IAAI,CAACA,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,gBAAgB,GAAGA,gBAAgB;EAC1C;AACF"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/integrity.ts"],"mappings":""}
|
package/lib/module/utils/misc.js
CHANGED
@@ -14,4 +14,35 @@ export const hasStatus = status => async res => {
|
|
14
14
|
|
15
15
|
// extract a type from an async function output
|
16
16
|
// helpful to bind the input of a function to the output of another
|
17
|
+
/**
|
18
|
+
* TODO [SIW-1310]: replace this function with a cryptographically secure one.
|
19
|
+
* @param size - The size of the string to generate
|
20
|
+
* @returns A random alphanumeric string of the given size
|
21
|
+
*/
|
22
|
+
export const generateRandomAlphaNumericString = size => Array.from(Array(size), () => Math.floor(Math.random() * 36).toString(36)).join("");
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Repeatedly checks a condition function until it returns true,
|
26
|
+
* then resolves the returned promise. If the condition function does not return true
|
27
|
+
* within the specified timeout, the promise is rejected.
|
28
|
+
*
|
29
|
+
* @param conditionFunction - A function that returns a boolean value.
|
30
|
+
* The promise resolves when this function returns true.
|
31
|
+
* @param timeout - An optional timeout in seconds. The promise is rejected if the
|
32
|
+
* condition function does not return true within this time.
|
33
|
+
* @returns A promise that resolves once the conditionFunction returns true or rejects if timed out.
|
34
|
+
*/
|
35
|
+
export const until = (conditionFunction, timeoutSeconds) => new Promise((resolve, reject) => {
|
36
|
+
const start = Date.now();
|
37
|
+
const poll = () => {
|
38
|
+
if (conditionFunction()) {
|
39
|
+
resolve();
|
40
|
+
} else if (timeoutSeconds !== undefined && Date.now() - start >= timeoutSeconds * 1000) {
|
41
|
+
reject(new Error("Timeout exceeded"));
|
42
|
+
} else {
|
43
|
+
setTimeout(poll, 400);
|
44
|
+
}
|
45
|
+
};
|
46
|
+
poll();
|
47
|
+
});
|
17
48
|
//# sourceMappingURL=misc.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IoWalletError","hasStatus","status","res","url","text"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,UAAU;;AAExC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GACnBC,MAAc,IACf,MAAOC,GAAa,IAAwB;EAC1C,IAAIA,GAAG,CAACD,MAAM,KAAKA,MAAM,EAAE;IACzB,MAAM,IAAIF,aAAa,CACpB,iCAAgCE,MAAO,SAAQC,GAAG,CAACD,MAAO,UACzDC,GAAG,CAACC,GACL,mBAAkB,MAAMD,GAAG,CAACE,IAAI,CAAC,CAAE,EACtC,CAAC;EACH;EACA,OAAOF,GAAG;AACZ,CAAC;;AAEH;AACA"}
|
1
|
+
{"version":3,"names":["IoWalletError","hasStatus","status","res","url","text","generateRandomAlphaNumericString","size","Array","from","Math","floor","random","toString","join","until","conditionFunction","timeoutSeconds","Promise","resolve","reject","start","Date","now","poll","undefined","Error","setTimeout"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,UAAU;;AAExC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GACnBC,MAAc,IACf,MAAOC,GAAa,IAAwB;EAC1C,IAAIA,GAAG,CAACD,MAAM,KAAKA,MAAM,EAAE;IACzB,MAAM,IAAIF,aAAa,CACpB,iCAAgCE,MAAO,SAAQC,GAAG,CAACD,MAAO,UACzDC,GAAG,CAACC,GACL,mBAAkB,MAAMD,GAAG,CAACE,IAAI,CAAC,CAAE,EACtC,CAAC;EACH;EACA,OAAOF,GAAG;AACZ,CAAC;;AAEH;AACA;AAOA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,gCAAgC,GAAIC,IAAY,IAC3DC,KAAK,CAACC,IAAI,CAACD,KAAK,CAACD,IAAI,CAAC,EAAE,MACtBG,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAACC,QAAQ,CAAC,EAAE,CAC5C,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGA,CACnBC,iBAAgC,EAChCC,cAAuB,KAEvB,IAAIC,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KAAK;EACrC,MAAMC,KAAK,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;EACxB,MAAMC,IAAI,GAAGA,CAAA,KAAM;IACjB,IAAIR,iBAAiB,CAAC,CAAC,EAAE;MACvBG,OAAO,CAAC,CAAC;IACX,CAAC,MAAM,IACLF,cAAc,KAAKQ,SAAS,IAC5BH,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,KAAK,IAAIJ,cAAc,GAAG,IAAI,EAC3C;MACAG,MAAM,CAAC,IAAIM,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACvC,CAAC,MAAM;MACLC,UAAU,CAACH,IAAI,EAAE,GAAG,CAAC;IACvB;EACF,CAAC;EAEDA,IAAI,CAAC,CAAC;AACR,CAAC,CAAC"}
|
package/lib/module/utils/par.js
CHANGED
@@ -2,11 +2,10 @@ import { sha256ToBase64, SignJWT } from "@pagopa/io-react-native-jwt";
|
|
2
2
|
import uuid from "react-native-uuid";
|
3
3
|
import * as z from "zod";
|
4
4
|
import * as WalletInstanceAttestation from "../wallet-instance-attestation";
|
5
|
-
import { hasStatus } from "./misc";
|
5
|
+
import { generateRandomAlphaNumericString, hasStatus } from "./misc";
|
6
|
+
import { createPopToken } from "./pop";
|
6
7
|
export const AuthorizationDetail = z.object({
|
7
|
-
|
8
|
-
type: z.string()
|
9
|
-
}),
|
8
|
+
credential_configuration_id: z.string(),
|
10
9
|
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
11
10
|
type: z.literal("openid_credential")
|
12
11
|
});
|
@@ -20,16 +19,21 @@ export const makeParRequest = _ref => {
|
|
20
19
|
wiaCryptoContext,
|
21
20
|
appFetch = fetch
|
22
21
|
} = _ref;
|
23
|
-
return async (clientId, codeVerifier,
|
22
|
+
return async (clientId, codeVerifier, redirectUri, responseMode, parEndpoint, walletInstanceAttestation, authorizationDetails, assertionType) => {
|
24
23
|
const wiaPublicKey = await wiaCryptoContext.getPublicKey();
|
25
24
|
const parUrl = new URL(parEndpoint);
|
26
25
|
const aud = `${parUrl.protocol}//${parUrl.hostname}`;
|
27
26
|
const iss = WalletInstanceAttestation.decode(walletInstanceAttestation).payload.cnf.jwk.kid;
|
27
|
+
const signedWiaPoP = await createPopToken({
|
28
|
+
jti: `${uuid.v4()}`,
|
29
|
+
aud,
|
30
|
+
iss
|
31
|
+
}, wiaCryptoContext);
|
28
32
|
|
29
33
|
/** A code challenge is provided so that the PAR is bound
|
30
34
|
to the subsequent authorization code request
|
31
35
|
@see https://datatracker.ietf.org/doc/html/rfc9126#name-request */
|
32
|
-
const codeChallengeMethod = "
|
36
|
+
const codeChallengeMethod = "S256";
|
33
37
|
const codeChallenge = await sha256ToBase64(codeVerifier);
|
34
38
|
|
35
39
|
/** The PAR request token is signed used the Wallet Instance Attestation key.
|
@@ -37,20 +41,24 @@ export const makeParRequest = _ref => {
|
|
37
41
|
with the it will ship the Wallet Instance Attestation.
|
38
42
|
The key is matched by its kid */
|
39
43
|
const signedJwtForPar = await new SignJWT(wiaCryptoContext).setProtectedHeader({
|
44
|
+
typ: "jwk",
|
40
45
|
kid: wiaPublicKey.kid
|
41
46
|
}).setPayload({
|
42
|
-
iss,
|
43
|
-
aud,
|
44
47
|
jti: `${uuid.v4()}`,
|
45
|
-
|
46
|
-
authorization_details: authorizationDetails,
|
48
|
+
aud,
|
47
49
|
response_type: "code",
|
48
|
-
|
49
|
-
state: `${uuid.v4()}`,
|
50
|
+
response_mode: responseMode,
|
50
51
|
client_id: clientId,
|
52
|
+
iss,
|
53
|
+
state: generateRandomAlphaNumericString(32),
|
54
|
+
code_challenge: codeChallenge,
|
51
55
|
code_challenge_method: codeChallengeMethod,
|
52
|
-
|
53
|
-
|
56
|
+
authorization_details: authorizationDetails,
|
57
|
+
redirect_uri: redirectUri,
|
58
|
+
client_assertion_type: assertionType,
|
59
|
+
client_assertion: walletInstanceAttestation + "~" + signedWiaPoP
|
60
|
+
}).setIssuedAt() //iat is set to now
|
61
|
+
.setExpirationTime("5min").sign();
|
54
62
|
|
55
63
|
/** The request body for the Pushed Authorization Request */
|
56
64
|
var formBody = new URLSearchParams({
|
@@ -58,9 +66,9 @@ export const makeParRequest = _ref => {
|
|
58
66
|
client_id: clientId,
|
59
67
|
code_challenge: codeChallenge,
|
60
68
|
code_challenge_method: "S256",
|
69
|
+
request: signedJwtForPar,
|
61
70
|
client_assertion_type: assertionType,
|
62
|
-
client_assertion: walletInstanceAttestation
|
63
|
-
request: signedJwtForPar
|
71
|
+
client_assertion: walletInstanceAttestation + "~" + signedWiaPoP
|
64
72
|
});
|
65
73
|
return await appFetch(parEndpoint, {
|
66
74
|
method: "POST",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","hasStatus","
|
1
|
+
{"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","generateRandomAlphaNumericString","hasStatus","createPopToken","AuthorizationDetail","object","credential_configuration_id","string","format","union","literal","type","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","redirectUri","responseMode","parEndpoint","walletInstanceAttestation","authorizationDetails","assertionType","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","signedWiaPoP","jti","v4","codeChallengeMethod","codeChallenge","signedJwtForPar","setProtectedHeader","typ","setPayload","response_type","response_mode","client_id","state","code_challenge","code_challenge_method","authorization_details","redirect_uri","client_assertion_type","client_assertion","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","request","method","headers","body","toString","then","res","json","result","request_uri"],"sourceRoot":"../../../src","sources":["utils/par.ts"],"mappings":"AAAA,SACEA,cAAc,EAEdC,OAAO,QACF,6BAA6B;AACpC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,OAAO,KAAKC,yBAAyB,MAAM,gCAAgC;AAC3E,SAASC,gCAAgC,EAAEC,SAAS,QAAQ,QAAQ;AACpE,SAASC,cAAc,QAAQ,OAAO;AAGtC,OAAO,MAAMC,mBAAmB,GAAGL,CAAC,CAACM,MAAM,CAAC;EAC1CC,2BAA2B,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC;EACvCC,MAAM,EAAET,CAAC,CAACU,KAAK,CAAC,CAACV,CAAC,CAACW,OAAO,CAAC,WAAW,CAAC,EAAEX,CAAC,CAACW,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;EACpEC,IAAI,EAAEZ,CAAC,CAACW,OAAO,CAAC,mBAAmB;AACrC,CAAC,CAAC;AAGF,OAAO,MAAME,oBAAoB,GAAGb,CAAC,CAACc,KAAK,CAACT,mBAAmB,CAAC;;AAEhE;AACA;AACA;AACA,OAAO,MAAMU,cAAc,GACzBC,IAAA;EAAA,IAAC;IACCC,gBAAgB;IAChBC,QAAQ,GAAGC;EAIb,CAAC,GAAAH,IAAA;E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AAqB,EAAE9B,oBAAoB;MAC3C+B,YAAY,EAAEnC,WAAW;MACzBoC,qBAAqB,EAAE/B,aAAa;MACpCgC,gBAAgB,EAAElC,yBAAyB,GAAG,GAAG,GAAGgB;IACtD,CAAC,CAAC,CACDmB,WAAW,CAAC,CAAC,CAAC;IAAA,CACdC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;;IAET;IACA,IAAIC,QAAQ,GAAG,IAAIC,eAAe,CAAC;MACjCd,aAAa,EAAE,MAAM;MACrBE,SAAS,EAAEhC,QAAQ;MACnBkC,cAAc,EAAET,aAAa;MAC7BU,qBAAqB,EAAE,MAAM;MAC7BU,OAAO,EAAEnB,eAAe;MACxBY,qBAAqB,EAAE/B,aAAa;MACpCgC,gBAAgB,EAAElC,yBAAyB,GAAG,GAAG,GAAGgB;IACtD,CAAC,CAAC;IAEF,OAAO,MAAMvB,QAAQ,CAACM,WAAW,EAAE;MACjC0C,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEL,QAAQ,CAACM,QAAQ,CAAC;IAC1B,CAAC,CAAC,CACCC,IAAI,CAACnE,SAAS,CAAC,GAAG,CAAC,CAAC,CACpBmE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEG,MAAM,IAAKA,MAAM,CAACC,WAAW,CAAC;EACzC,CAAC;AAAA"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import * as z from "zod";
|
2
|
+
import { SignJWT } from "@pagopa/io-react-native-jwt";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Create a signed PoP token
|
6
|
+
*
|
7
|
+
* @param payload The payload to be included in the token.
|
8
|
+
* @param crypto The crypto context that handles the key bound to the DPoP.
|
9
|
+
*
|
10
|
+
* @returns The signed crypto token.
|
11
|
+
*/
|
12
|
+
export const createPopToken = async (payload, crypto) => {
|
13
|
+
const kid = await crypto.getPublicKey().then(_ => _.kid);
|
14
|
+
return new SignJWT(crypto).setPayload(payload).setProtectedHeader({
|
15
|
+
typ: "jwt-client-attestation-pop",
|
16
|
+
kid
|
17
|
+
}).setIssuedAt().setExpirationTime("5min").sign();
|
18
|
+
};
|
19
|
+
export const PoPPayload = z.object({
|
20
|
+
jti: z.string(),
|
21
|
+
aud: z.string(),
|
22
|
+
iss: z.string()
|
23
|
+
});
|
24
|
+
//# sourceMappingURL=pop.js.map
|