@pagopa/io-react-native-wallet 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +9 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/pid/issuing.js +28 -0
- package/lib/commonjs/pid/issuing.js.map +1 -1
- package/lib/commonjs/pid/metadata.js +51 -0
- package/lib/commonjs/pid/metadata.js.map +1 -0
- package/lib/commonjs/pid/sd-jwt/index.js +2 -1
- package/lib/commonjs/pid/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/rp/__test__/index.test.js +3 -5
- package/lib/commonjs/rp/__test__/index.test.js.map +1 -1
- package/lib/commonjs/rp/index.js +165 -15
- package/lib/commonjs/rp/index.js.map +1 -1
- package/lib/commonjs/rp/types.js +13 -1
- package/lib/commonjs/rp/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/index.test.js +119 -0
- package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -0
- package/lib/commonjs/sd-jwt/index.js +84 -4
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +9 -0
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/verifier.js +7 -5
- package/lib/commonjs/sd-jwt/verifier.js.map +1 -1
- package/lib/commonjs/utils/errors.js +76 -1
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/module/index.js +5 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/pid/issuing.js +30 -2
- package/lib/module/pid/issuing.js.map +1 -1
- package/lib/module/pid/metadata.js +43 -0
- package/lib/module/pid/metadata.js.map +1 -0
- package/lib/module/pid/sd-jwt/index.js +3 -3
- package/lib/module/pid/sd-jwt/index.js.map +1 -1
- package/lib/module/rp/__test__/index.test.js +3 -5
- package/lib/module/rp/__test__/index.test.js.map +1 -1
- package/lib/module/rp/index.js +168 -18
- package/lib/module/rp/index.js.map +1 -1
- package/lib/module/rp/types.js +11 -0
- package/lib/module/rp/types.js.map +1 -1
- package/lib/module/sd-jwt/__test__/index.test.js +118 -0
- package/lib/module/sd-jwt/__test__/index.test.js.map +1 -0
- package/lib/module/sd-jwt/index.js +83 -3
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/types.js +10 -0
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/sd-jwt/verifier.js +8 -6
- package/lib/module/sd-jwt/verifier.js.map +1 -1
- package/lib/module/utils/errors.js +71 -0
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/typescript/{index.d.ts → src/index.d.ts} +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/pid/index.d.ts.map +1 -0
- package/lib/typescript/{pid → src/pid}/issuing.d.ts +9 -0
- package/lib/typescript/src/pid/issuing.d.ts.map +1 -0
- package/lib/typescript/src/pid/metadata.d.ts +528 -0
- package/lib/typescript/src/pid/metadata.d.ts.map +1 -0
- package/lib/typescript/src/pid/sd-jwt/converters.d.ts.map +1 -0
- package/lib/typescript/{pid → src/pid}/sd-jwt/index.d.ts +1 -1
- package/lib/typescript/src/pid/sd-jwt/index.d.ts.map +1 -0
- package/lib/typescript/src/pid/sd-jwt/types.d.ts.map +1 -0
- package/lib/typescript/src/rp/__test__/index.test.d.ts.map +1 -0
- package/lib/typescript/src/rp/index.d.ts +89 -0
- package/lib/typescript/src/rp/index.d.ts.map +1 -0
- package/lib/typescript/{rp → src/rp}/types.d.ts +71 -47
- package/lib/typescript/{rp → src/rp}/types.d.ts.map +1 -1
- package/lib/typescript/src/sd-jwt/__test__/converters.test.d.ts.map +1 -0
- package/lib/typescript/src/sd-jwt/__test__/index.test.d.ts +2 -0
- package/lib/typescript/src/sd-jwt/__test__/index.test.d.ts.map +1 -0
- package/lib/typescript/src/sd-jwt/__test__/types.test.d.ts.map +1 -0
- package/lib/typescript/src/sd-jwt/converters.d.ts.map +1 -0
- package/lib/typescript/{sd-jwt → src/sd-jwt}/index.d.ts +22 -2
- package/lib/typescript/src/sd-jwt/index.d.ts.map +1 -0
- package/lib/typescript/{sd-jwt → src/sd-jwt}/types.d.ts +12 -0
- package/lib/typescript/src/sd-jwt/types.d.ts.map +1 -0
- package/lib/typescript/src/sd-jwt/verifier.d.ts +3 -0
- package/lib/typescript/src/sd-jwt/verifier.d.ts.map +1 -0
- package/lib/typescript/src/utils/dpop.d.ts.map +1 -0
- package/lib/typescript/{utils → src/utils}/errors.d.ts +41 -0
- package/lib/typescript/src/utils/errors.d.ts.map +1 -0
- package/lib/typescript/src/utils/jwk.d.ts.map +1 -0
- package/lib/typescript/src/wallet-instance-attestation/index.d.ts.map +1 -0
- package/lib/typescript/src/wallet-instance-attestation/issuing.d.ts.map +1 -0
- package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/types.d.ts +8 -8
- package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/types.d.ts.map +1 -1
- package/package.json +7 -5
- package/src/index.ts +13 -1
- package/src/pid/issuing.ts +38 -1
- package/src/pid/metadata.ts +46 -0
- package/src/pid/sd-jwt/index.ts +7 -4
- package/src/rp/__test__/index.test.ts +5 -9
- package/src/rp/index.ts +208 -24
- package/src/rp/types.ts +16 -0
- package/src/sd-jwt/__test__/index.test.ts +171 -0
- package/src/sd-jwt/index.ts +84 -7
- package/src/sd-jwt/types.ts +13 -0
- package/src/sd-jwt/verifier.ts +5 -7
- package/src/utils/errors.ts +81 -0
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/pid/index.d.ts.map +0 -1
- package/lib/typescript/pid/issuing.d.ts.map +0 -1
- package/lib/typescript/pid/sd-jwt/converters.d.ts.map +0 -1
- package/lib/typescript/pid/sd-jwt/index.d.ts.map +0 -1
- package/lib/typescript/pid/sd-jwt/types.d.ts.map +0 -1
- package/lib/typescript/rp/__test__/index.test.d.ts.map +0 -1
- package/lib/typescript/rp/index.d.ts +0 -43
- package/lib/typescript/rp/index.d.ts.map +0 -1
- package/lib/typescript/sd-jwt/__test__/converters.test.d.ts.map +0 -1
- package/lib/typescript/sd-jwt/__test__/types.test.d.ts.map +0 -1
- package/lib/typescript/sd-jwt/converters.d.ts.map +0 -1
- package/lib/typescript/sd-jwt/index.d.ts.map +0 -1
- package/lib/typescript/sd-jwt/types.d.ts.map +0 -1
- package/lib/typescript/sd-jwt/verifier.d.ts +0 -3
- package/lib/typescript/sd-jwt/verifier.d.ts.map +0 -1
- package/lib/typescript/utils/dpop.d.ts.map +0 -1
- package/lib/typescript/utils/errors.d.ts.map +0 -1
- package/lib/typescript/utils/jwk.d.ts.map +0 -1
- package/lib/typescript/wallet-instance-attestation/index.d.ts.map +0 -1
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +0 -1
- /package/lib/typescript/{pid → src/pid}/index.d.ts +0 -0
- /package/lib/typescript/{pid → src/pid}/sd-jwt/converters.d.ts +0 -0
- /package/lib/typescript/{pid → src/pid}/sd-jwt/types.d.ts +0 -0
- /package/lib/typescript/{rp → src/rp}/__test__/index.test.d.ts +0 -0
- /package/lib/typescript/{sd-jwt → src/sd-jwt}/__test__/converters.test.d.ts +0 -0
- /package/lib/typescript/{sd-jwt → src/sd-jwt}/__test__/types.test.d.ts +0 -0
- /package/lib/typescript/{sd-jwt → src/sd-jwt}/converters.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/dpop.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/jwk.d.ts +0 -0
- /package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/index.d.ts +0 -0
- /package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/issuing.d.ts +0 -0
package/src/sd-jwt/index.ts
CHANGED
|
@@ -2,11 +2,21 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
|
|
4
4
|
import { verify as verifyJwt } from "@pagopa/io-react-native-jwt";
|
|
5
|
+
import { sha256ToBase64 } from "@pagopa/io-react-native-jwt";
|
|
5
6
|
|
|
6
7
|
import { decodeBase64 } from "@pagopa/io-react-native-jwt";
|
|
7
|
-
import { Disclosure } from "./types";
|
|
8
|
+
import { Disclosure, SdJwt4VC, type DisclosureWithEncoded } from "./types";
|
|
8
9
|
import { verifyDisclosure } from "./verifier";
|
|
9
10
|
import type { JWK } from "src/utils/jwk";
|
|
11
|
+
import {
|
|
12
|
+
ClaimsNotFoundBetweenDislosures,
|
|
13
|
+
ClaimsNotFoundInToken,
|
|
14
|
+
} from "../utils/errors";
|
|
15
|
+
|
|
16
|
+
const decodeDisclosure = (encoded: string): DisclosureWithEncoded => {
|
|
17
|
+
const decoded = Disclosure.parse(JSON.parse(decodeBase64(encoded)));
|
|
18
|
+
return { decoded, encoded };
|
|
19
|
+
};
|
|
10
20
|
|
|
11
21
|
/**
|
|
12
22
|
* Decode a given SD-JWT with Disclosures to get the parsed SD-JWT object they define.
|
|
@@ -25,7 +35,10 @@ import type { JWK } from "src/utils/jwk";
|
|
|
25
35
|
export const decode = <S extends z.AnyZodObject>(
|
|
26
36
|
token: string,
|
|
27
37
|
schema: S
|
|
28
|
-
): {
|
|
38
|
+
): {
|
|
39
|
+
sdJwt: z.infer<S>;
|
|
40
|
+
disclosures: DisclosureWithEncoded[];
|
|
41
|
+
} => {
|
|
29
42
|
// token are expected in the form "sd-jwt~disclosure0~disclosure1~...~disclosureN~"
|
|
30
43
|
if (token.slice(-1) === "~") {
|
|
31
44
|
token = token.slice(0, -1);
|
|
@@ -43,14 +56,75 @@ export const decode = <S extends z.AnyZodObject>(
|
|
|
43
56
|
// get disclosures as list of triples
|
|
44
57
|
// validate each triple
|
|
45
58
|
// throw a validation error if at least one fails to parse
|
|
46
|
-
const disclosures = rawDisclosures
|
|
47
|
-
.map(decodeBase64)
|
|
48
|
-
.map((e) => JSON.parse(e))
|
|
49
|
-
.map((e) => Disclosure.parse(e));
|
|
59
|
+
const disclosures = rawDisclosures.map(decodeDisclosure);
|
|
50
60
|
|
|
51
61
|
return { sdJwt, disclosures };
|
|
52
62
|
};
|
|
53
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Select disclosures from a given SD-JWT with Disclosures.
|
|
66
|
+
* Claims relate with disclosures by their name.
|
|
67
|
+
*
|
|
68
|
+
* @function
|
|
69
|
+
* @param token The encoded token that represents a valid sd-jwt for verifiable credentials
|
|
70
|
+
* @param claims The list of claims to be disclosed
|
|
71
|
+
*
|
|
72
|
+
* @throws {ClaimsNotFoundBetweenDislosures} When one or more claims does not relate to any discloure.
|
|
73
|
+
* @throws {ClaimsNotFoundInToken} When one or more claims are not contained in the SD-JWT token.
|
|
74
|
+
* @returns The encoded token with only the requested disclosures, along with the path each claim can be found on the SD-JWT token
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
export const disclose = async (
|
|
78
|
+
token: string,
|
|
79
|
+
claims: string[]
|
|
80
|
+
): Promise<{ token: string; paths: { claim: string; path: string }[] }> => {
|
|
81
|
+
const [rawSdJwt, ...rawDisclosures] = token.split("~");
|
|
82
|
+
const { sdJwt, disclosures } = decode(token, SdJwt4VC);
|
|
83
|
+
|
|
84
|
+
// for each claim, return the path on which they are located in the SD-JWT token
|
|
85
|
+
const paths = await Promise.all(
|
|
86
|
+
claims.map(async (claim) => {
|
|
87
|
+
const disclosure = disclosures.find(
|
|
88
|
+
({ decoded: [, name] }) => name === claim
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
// check every claim represents a known disclosure
|
|
92
|
+
if (!disclosure) {
|
|
93
|
+
throw new ClaimsNotFoundBetweenDislosures(claim);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const hash = await sha256ToBase64(disclosure.encoded);
|
|
97
|
+
|
|
98
|
+
// _sd is defined in verified_claims.claims and verified_claims.verification
|
|
99
|
+
// we must look into both
|
|
100
|
+
if (sdJwt.payload.verified_claims.claims._sd.includes(hash)) {
|
|
101
|
+
const index = sdJwt.payload.verified_claims.claims._sd.indexOf(hash);
|
|
102
|
+
return { claim, path: `verified_claims.claims._sd[${index}]` };
|
|
103
|
+
} else if (
|
|
104
|
+
sdJwt.payload.verified_claims.verification._sd.includes(hash)
|
|
105
|
+
) {
|
|
106
|
+
const index =
|
|
107
|
+
sdJwt.payload.verified_claims.verification._sd.indexOf(hash);
|
|
108
|
+
return { claim, path: `verified_claims.verification._sd[${index}]` };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
throw new ClaimsNotFoundInToken(claim);
|
|
112
|
+
})
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
const filteredDisclosures = rawDisclosures.filter((d) => {
|
|
116
|
+
const {
|
|
117
|
+
decoded: [, name],
|
|
118
|
+
} = decodeDisclosure(d);
|
|
119
|
+
return claims.includes(name);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// compose the final disclosed token
|
|
123
|
+
const disclosedToken = [rawSdJwt, ...filteredDisclosures].join("~");
|
|
124
|
+
|
|
125
|
+
return { token: disclosedToken, paths };
|
|
126
|
+
};
|
|
127
|
+
|
|
54
128
|
/**
|
|
55
129
|
* Verify a given SD-JWT with Disclosures
|
|
56
130
|
* Same as {@link decode} plus:
|
|
@@ -91,5 +165,8 @@ export const verify = async <S extends z.AnyZodObject>(
|
|
|
91
165
|
)
|
|
92
166
|
);
|
|
93
167
|
|
|
94
|
-
return
|
|
168
|
+
return {
|
|
169
|
+
sdJwt: decoded.sdJwt,
|
|
170
|
+
disclosures: decoded.disclosures.map((d) => d.decoded),
|
|
171
|
+
};
|
|
95
172
|
};
|
package/src/sd-jwt/types.ts
CHANGED
|
@@ -20,6 +20,19 @@ export const Disclosure = z.tuple([
|
|
|
20
20
|
/* claim value */ z.unknown(),
|
|
21
21
|
]);
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Encoding depends on the serialization algorithm used when generating the disclosure tokens.
|
|
25
|
+
* The SD-JWT reference itself take no decision about how to handle whitespaces in serialized objects.
|
|
26
|
+
* For such reason, we may find conveninent to have encoded and decode values stored explicitly in the same structure.
|
|
27
|
+
* Please note that `encoded` can always decode into `decode`, but `decode` may or may not be encoded with the same value of `encoded`
|
|
28
|
+
*
|
|
29
|
+
* @see https://www.ietf.org/id/draft-ietf-oauth-selective-disclosure-jwt-05.html#name-disclosures-for-object-prop
|
|
30
|
+
*/
|
|
31
|
+
export type DisclosureWithEncoded = {
|
|
32
|
+
decoded: Disclosure;
|
|
33
|
+
encoded: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
23
36
|
export type SdJwt4VC = z.infer<typeof SdJwt4VC>;
|
|
24
37
|
export const SdJwt4VC = z.object({
|
|
25
38
|
header: z.object({
|
package/src/sd-jwt/verifier.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sha256ToBase64 } from "@pagopa/io-react-native-jwt";
|
|
2
2
|
|
|
3
3
|
import { ValidationFailed } from "../utils/errors";
|
|
4
|
-
import type {
|
|
4
|
+
import type { DisclosureWithEncoded, ObfuscatedDisclosures } from "./types";
|
|
5
5
|
|
|
6
6
|
export const verifyDisclosure = async (
|
|
7
|
-
|
|
7
|
+
{ encoded, decoded }: DisclosureWithEncoded,
|
|
8
8
|
claims: ObfuscatedDisclosures["_sd"]
|
|
9
9
|
) => {
|
|
10
|
-
let
|
|
11
|
-
let encodedDisclosure = encodeBase64(disclosureString);
|
|
12
|
-
let hash = await sha256ToBase64(encodedDisclosure);
|
|
10
|
+
let hash = await sha256ToBase64(encoded);
|
|
13
11
|
if (!claims.includes(hash)) {
|
|
14
12
|
throw new ValidationFailed(
|
|
15
13
|
"Validation of disclosure failed",
|
|
16
|
-
`${
|
|
14
|
+
`${decoded}`,
|
|
17
15
|
"Disclosure hash not found in claims"
|
|
18
16
|
);
|
|
19
17
|
}
|
package/src/utils/errors.ts
CHANGED
|
@@ -120,3 +120,84 @@ export class PidIssuingError extends IoWalletError {
|
|
|
120
120
|
this.reason = reason;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* When claims are requested but not found in the credential
|
|
126
|
+
*
|
|
127
|
+
*/
|
|
128
|
+
export class ClaimsNotFoundBetweenDislosures extends Error {
|
|
129
|
+
static get code(): "ERR_CLAIMS_NOT_FOUND" {
|
|
130
|
+
return "ERR_CLAIMS_NOT_FOUND";
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
code = "ERR_CLAIMS_NOT_FOUND";
|
|
134
|
+
|
|
135
|
+
/** The Claims not found */
|
|
136
|
+
claims: string[];
|
|
137
|
+
|
|
138
|
+
constructor(claims: string | string[]) {
|
|
139
|
+
const c = Array.isArray(claims) ? claims : [claims];
|
|
140
|
+
const message = `Some requested claims are not present in the disclosurable values, claims: ${c.join(
|
|
141
|
+
", "
|
|
142
|
+
)}`;
|
|
143
|
+
super(message);
|
|
144
|
+
this.claims = c;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* When the SD-JWT does not contain an hashed reference to a given set of claims
|
|
150
|
+
*/
|
|
151
|
+
export class ClaimsNotFoundInToken extends Error {
|
|
152
|
+
static get code(): "ERR_CLAIMS_NOT_FOUND_IN_TOKEN" {
|
|
153
|
+
return "ERR_CLAIMS_NOT_FOUND_IN_TOKEN";
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
code = "ERR_CLAIMS_NOT_FOUND_IN_TOKEN";
|
|
157
|
+
|
|
158
|
+
/** The Claims not found */
|
|
159
|
+
claims: string[];
|
|
160
|
+
|
|
161
|
+
constructor(claims: string | string[]) {
|
|
162
|
+
const c = Array.isArray(claims) ? claims : [claims];
|
|
163
|
+
const message = `Some claims are not found in the given token, claims: ${c.join(
|
|
164
|
+
", "
|
|
165
|
+
)}`;
|
|
166
|
+
super(message);
|
|
167
|
+
this.claims = c;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* When selecting a public key from an entity configuration, and no one meets the requirements for the scenario
|
|
173
|
+
*
|
|
174
|
+
*/
|
|
175
|
+
export class NoSuitableKeysFoundInEntityConfiguration extends Error {
|
|
176
|
+
static get code(): "ERR_NO_SUITABLE_KEYS_NOT_FOUND" {
|
|
177
|
+
return "ERR_NO_SUITABLE_KEYS_NOT_FOUND";
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
code = "ERR_NO_SUITABLE_KEYS_NOT_FOUND";
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @param scenario describe the scenario in which the error arise
|
|
184
|
+
*/
|
|
185
|
+
constructor(scenario: string) {
|
|
186
|
+
const message = `Entity configuration do not provide any suitable keys (${scenario}).`;
|
|
187
|
+
super(message);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* When selecting a public key from an entity configuration, and no one meets the requirements for the scenario
|
|
193
|
+
*
|
|
194
|
+
*/
|
|
195
|
+
export class PidMetadataError extends Error {
|
|
196
|
+
static get code(): "PID_METADATA_ERROR" {
|
|
197
|
+
return "PID_METADATA_ERROR";
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
constructor(message: string) {
|
|
201
|
+
super(message);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,yBAAyB,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,yBAAyB,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pid/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"issuing.d.ts","sourceRoot":"","sources":["../../../src/pid/issuing.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAOnC,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACtE,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,qBAAa,OAAO;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yBAAyB,EAAE,MAAM,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;gBAG7B,kBAAkB,EAAE,MAAM,EAC1B,qBAAqB,EAAE,MAAM,EAC7B,yBAAyB,EAAE,MAAM,EACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,WAAW,CAAC,OAAO,CAAS;IAYxC;;;;;;;;OAQG;IACG,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAoCrD;;;;;;;;;OASG;IACG,MAAM,CAAC,iBAAiB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAwC3E;;;;;;;;OAQG;IACG,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAUhD;;;;;;OAMG;IACG,YAAY,IAAI,OAAO,CAAC,aAAa,CAAC;IA4C5C;;;;;;;;OAQG;IACG,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgB3D;;;;;;;;;;;;;OAaG;IACG,aAAa,CACjB,kBAAkB,EAAE,MAAM,EAC1B,gBAAgB,EAAE,MAAM,EACxB,kBAAkB,EAAE,MAAM,EAC1B,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,WAAW,CAAC;CAsCxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../../src/pid/sd-jwt/converters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAE9B,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,GAAG,CAqB5E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/pid/sd-jwt/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAKlD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAMjE;AAED,KAAK,YAAY,GAAG;IAElB,GAAG,EAAE,GAAG,CAAC;IAET,KAAK,EAAE,QAAQ,CAAC;IAEhB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/pid/sd-jwt/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB;;;;;GAKG;AACH,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;AACtC,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../src/rp/__test__/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { RequestObject, RpEntityConfiguration } from "./types";
|
|
2
|
-
import type { JWK } from "@pagopa/io-react-native-jwt/lib/typescript/types";
|
|
3
|
-
export declare class RelyingPartySolution {
|
|
4
|
-
relyingPartyBaseUrl: string;
|
|
5
|
-
walletInstanceAttestation: string;
|
|
6
|
-
appFetch: GlobalFetch["fetch"];
|
|
7
|
-
constructor(relyingPartyBaseUrl: string, walletInstanceAttestation: string, appFetch?: GlobalFetch["fetch"]);
|
|
8
|
-
/**
|
|
9
|
-
* Decode a QR code content to an authentication request url.
|
|
10
|
-
* @function
|
|
11
|
-
* @param qrcode QR code content
|
|
12
|
-
*
|
|
13
|
-
* @returns The authentication request url
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
decodeAuthRequestQR(qrcode: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Obtain the unsigned wallet instance DPoP for authentication request
|
|
19
|
-
*
|
|
20
|
-
* @function
|
|
21
|
-
* @param walletInstanceAttestationJwk JWT of the Wallet Instance Attestation
|
|
22
|
-
* @param authRequestUrl authentication request url
|
|
23
|
-
*
|
|
24
|
-
* @returns The unsigned wallet instance DPoP
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
getUnsignedWalletInstanceDPoP(walletInstanceAttestationJwk: JWK, authRequestUrl: string): Promise<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Obtain the Request Object for RP authentication
|
|
30
|
-
*
|
|
31
|
-
* @function
|
|
32
|
-
* @param signedWalletInstanceDPoP JWT of the Wallet Instance Attestation DPoP
|
|
33
|
-
*
|
|
34
|
-
* @returns The Request Object JWT
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
getRequestObject(signedWalletInstanceDPoP: string): Promise<RequestObject>;
|
|
38
|
-
/**
|
|
39
|
-
* Obtain the relying party entity configuration.
|
|
40
|
-
*/
|
|
41
|
-
getEntityConfiguration(): Promise<RpEntityConfiguration>;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rp/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAG/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kDAAkD,CAAC;AAE5E,qBAAa,oBAAoB;IAC/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yBAAyB,EAAE,MAAM,CAAC;IAClC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;gBAG7B,mBAAmB,EAAE,MAAM,EAC3B,yBAAyB,EAAE,MAAM,EACjC,QAAQ,GAAE,WAAW,CAAC,OAAO,CAAS;IAOxC;;;;;;;OAOG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAoB3C;;;;;;;;;OASG;IACG,6BAA6B,CACjC,4BAA4B,EAAE,GAAG,EACjC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC;IAiBlB;;;;;;;;OAQG;IACG,gBAAgB,CACpB,wBAAwB,EAAE,MAAM,GAC/B,OAAO,CAAC,aAAa,CAAC;IA2BzB;;OAEG;IACG,sBAAsB,IAAI,OAAO,CAAC,qBAAqB,CAAC;CAuB/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"converters.test.d.ts","sourceRoot":"","sources":["../../../../src/sd-jwt/__test__/converters.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../../../src/sd-jwt/__test__/types.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/converters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,UAAU,EAAE,EACzB,SAAS,EAAE,MAAM,OAmBlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM,oCACV,MAAM;;iBAEsB,UAAU,EAAE;CAwBhD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,oCACV,MAAM,aACF,GAAG;;iBAE6B,UAAU,EAAE;EAqBxD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,QAAQ,aAAuC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;EAAyC,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,eAAO,MAAM,UAAU,4DAIrB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../../src/sd-jwt/verifier.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEjE,eAAO,MAAM,gBAAgB,kDAEnB,qBAAqB,CAAC,KAAK,CAAC,kBAYrC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dpop.d.ts","sourceRoot":"","sources":["../../../src/utils/dpop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,eAAO,MAAM,eAAe,QAAS,GAAG,WAAW,WAAW,KAAG,MAWhE,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACtD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAKtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,6DAA6D;IAC7D,MAAM,KAAK,IAAI,IAAI,MAAM,CAExB;IAED,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAA2B;gBAE3B,OAAO,CAAC,EAAE,MAAM;CAM7B;AACD;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,MAAM,KAAK,IAAI,IAAI,iCAAiC,CAEnD;IAED,IAAI,SAAqC;IAEzC,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAgB,EAAE,MAAM,SAAgB;CAK3E;AAED;;;GAGG;AACH,qBAAa,qCAAsC,SAAQ,aAAa;IACtE,MAAM,KAAK,IAAI,IAAI,mDAAmD,CAErE;IAED,IAAI,SAAuD;IAE3D,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAgB,EAAE,MAAM,SAAgB;CAK3E;AAED;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,MAAM,KAAK,IAAI,IAAI,oDAAoD,CAEtE;IAED,IAAI,SAAwD;IAE5D,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAgB,EAAE,MAAM,SAAgB;CAK3E;AAED;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,aAAa;IAChD,MAAM,KAAK,IAAI,IAAI,kCAAkC,CAEpD;IAED,IAAI,SAAsC;IAE1C,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAgB,EAAE,MAAM,SAAgB;CAK3E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwk.d.ts","sourceRoot":"","sources":["../../../src/utils/jwk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;AACtC,eAAO,MAAM,GAAG;IACd,uCAAuC;;;;;;;IAOvC,yCAAyC;;;IAGzC,gDAAgD;;IAEhD,oCAAoC;;IAEpC;;kCAE8B;;;;;;IAM9B,4CAA4C;;;;IAI5C,qDAAqD;;IAErD,gEAAgE;;IAEhE,mEAAmE;;IAEnE,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEvC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,4BAA4B,CAQlE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,4BAA4B,CAAC,CAOvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"issuing.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/issuing.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAKnC,qBAAa,OAAO;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;gBAE7B,qBAAqB,EAAE,MAAM,EAC7B,QAAQ,GAAE,WAAW,CAAC,OAAO,CAAS;IAMxC;;;;;;;;;OASG;IACG,2BAA2B,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IA0B5D;;;;;;;;;;;;OAYG;IACG,cAAc,CAClB,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC;CAqCnB"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/index.d.ts
RENAMED
|
File without changes
|
/package/lib/typescript/{wallet-instance-attestation → src/wallet-instance-attestation}/issuing.d.ts
RENAMED
|
File without changes
|