@pagopa/io-react-native-wallet 0.28.0 → 0.28.2
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/credential/issuance/03-start-user-authorization.js +3 -0
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +5 -3
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/presentation/01-start-flow.js +12 -23
- package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +4 -2
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/commonjs/credential/presentation/03-get-request-object.js +31 -43
- package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js +32 -0
- package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js.map +1 -0
- package/lib/commonjs/credential/presentation/05-verify-request-object.js +60 -0
- package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -0
- package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js +39 -0
- package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js.map +1 -0
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +134 -0
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -0
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +296 -0
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -0
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js +170 -0
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -0
- package/lib/commonjs/credential/presentation/README.md +88 -2
- package/lib/commonjs/credential/presentation/errors.js +68 -1
- package/lib/commonjs/credential/presentation/errors.js.map +1 -1
- package/lib/commonjs/credential/presentation/index.js +54 -1
- package/lib/commonjs/credential/presentation/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js +125 -4
- package/lib/commonjs/credential/presentation/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/index.js +41 -1
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/trust/chain.js.map +1 -1
- package/lib/commonjs/trust/types.js +26 -6
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/trust/utils.js +5 -0
- package/lib/commonjs/trust/utils.js.map +1 -1
- package/lib/commonjs/utils/jwk.js +5 -1
- package/lib/commonjs/utils/jwk.js.map +1 -1
- package/lib/module/credential/issuance/03-start-user-authorization.js +3 -0
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +5 -3
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/presentation/01-start-flow.js +13 -24
- package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js +4 -2
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/module/credential/presentation/03-get-request-object.js +32 -44
- package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/module/credential/presentation/04-retrieve-rp-jwks.js +25 -0
- package/lib/module/credential/presentation/04-retrieve-rp-jwks.js.map +1 -0
- package/lib/module/credential/presentation/05-verify-request-object.js +53 -0
- package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -0
- package/lib/module/credential/presentation/06-fetch-presentation-definition.js +32 -0
- package/lib/module/credential/presentation/06-fetch-presentation-definition.js.map +1 -0
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +127 -0
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -0
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +285 -0
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -0
- package/lib/module/credential/presentation/08-send-authorization-response.js +158 -0
- package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -0
- package/lib/module/credential/presentation/README.md +88 -2
- package/lib/module/credential/presentation/errors.js +63 -0
- package/lib/module/credential/presentation/errors.js.map +1 -1
- package/lib/module/credential/presentation/index.js +7 -2
- package/lib/module/credential/presentation/index.js.map +1 -1
- package/lib/module/credential/presentation/types.js +122 -3
- package/lib/module/credential/presentation/types.js.map +1 -1
- package/lib/module/sd-jwt/index.js +40 -1
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/trust/chain.js.map +1 -1
- package/lib/module/trust/types.js +26 -6
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/trust/utils.js +5 -0
- package/lib/module/trust/utils.js.map +1 -1
- package/lib/module/utils/jwk.js +3 -0
- package/lib/module/utils/jwk.js.map +1 -1
- 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 +2 -2
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/01-start-flow.d.ts +23 -7
- package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +1 -0
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts +7 -11
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts +23 -0
- package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +20 -0
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts +21 -0
- package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +28 -0
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +93 -0
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +70 -0
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/errors.d.ts +43 -0
- package/lib/typescript/credential/presentation/errors.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/index.d.ts +8 -3
- package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/types.d.ts +750 -13
- package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/index.d.ts +19 -0
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/trust/index.d.ts +236 -8
- package/lib/typescript/trust/index.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +3046 -76
- package/lib/typescript/trust/types.d.ts.map +1 -1
- package/lib/typescript/trust/utils.d.ts +6 -6
- package/lib/typescript/trust/utils.d.ts.map +1 -1
- package/lib/typescript/utils/decoder.d.ts +1 -1
- package/lib/typescript/utils/decoder.d.ts.map +1 -1
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/lib/typescript/utils/jwk.d.ts +137 -0
- package/lib/typescript/utils/jwk.d.ts.map +1 -1
- package/lib/typescript/utils/misc.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +16 -16
- package/package.json +15 -11
- package/src/credential/issuance/03-start-user-authorization.ts +3 -0
- package/src/credential/issuance/04-complete-user-authorization.ts +6 -3
- package/src/credential/presentation/01-start-flow.ts +18 -28
- package/src/credential/presentation/02-evaluate-rp-trust.ts +3 -2
- package/src/credential/presentation/03-get-request-object.ts +36 -60
- package/src/credential/presentation/04-retrieve-rp-jwks.ts +34 -0
- package/src/credential/presentation/05-verify-request-object.ts +63 -0
- package/src/credential/presentation/06-fetch-presentation-definition.ts +48 -0
- package/src/credential/presentation/07-evaluate-dcql-query.ts +174 -0
- package/src/credential/presentation/07-evaluate-input-descriptor.ts +393 -0
- package/src/credential/presentation/08-send-authorization-response.ts +222 -0
- package/src/credential/presentation/README.md +88 -2
- package/src/credential/presentation/errors.ts +64 -0
- package/src/credential/presentation/index.ts +40 -1
- package/src/credential/presentation/types.ts +135 -4
- package/src/sd-jwt/index.ts +49 -1
- package/src/trust/chain.ts +2 -2
- package/src/trust/types.ts +25 -5
- package/src/trust/utils.ts +6 -3
- package/src/utils/decoder.ts +1 -1
- package/src/utils/errors.ts +2 -2
- package/src/utils/jwk.ts +8 -1
- package/src/utils/misc.ts +2 -2
- package/lib/commonjs/credential/presentation/04-send-authorization-response.js +0 -138
- package/lib/commonjs/credential/presentation/04-send-authorization-response.js.map +0 -1
- package/lib/module/credential/presentation/04-send-authorization-response.js +0 -128
- package/lib/module/credential/presentation/04-send-authorization-response.js.map +0 -1
- package/lib/typescript/credential/presentation/04-send-authorization-response.d.ts +0 -34
- package/lib/typescript/credential/presentation/04-send-authorization-response.d.ts.map +0 -1
- package/src/credential/presentation/04-send-authorization-response.ts +0 -168
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"05-verify-request-object.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/05-verify-request-object.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,MAAM,mBAAmB,GAAG,CAChC,uBAAuB,EAAE,MAAM,EAC/B,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,KACE,OAAO,CAAC;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAsCjC,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { PresentationDefinition, RequestObject } from "./types";
|
2
|
+
import { RelyingPartyEntityConfiguration } from "../../trust/types";
|
3
|
+
export type FetchPresentationDefinition = (requestObject: RequestObject, rpConf?: RelyingPartyEntityConfiguration["payload"]["metadata"]) => Promise<{
|
4
|
+
presentationDefinition: PresentationDefinition;
|
5
|
+
}>;
|
6
|
+
/**
|
7
|
+
* Retrieves a PresentationDefinition based on the given parameters.
|
8
|
+
*
|
9
|
+
* The method attempts the following strategies in order:
|
10
|
+
* 1. Checks if `presentation_definition` is directly available in the request object.
|
11
|
+
* 2. Uses a pre-configured `presentation_definition` from the relying party configuration if the `scope` is present in the request object.
|
12
|
+
*
|
13
|
+
* If none of the above conditions are met, the function throws an error indicating the definition could not be found. Note that `presentation_definition_uri` is not supported in 0.9.x.
|
14
|
+
*
|
15
|
+
* @param {RequestObject} requestObject - The request object containing the presentation definition or references to it.
|
16
|
+
* @param {RelyingPartyEntityConfiguration["payload"]["metadata"]} [rpConf] - Optional relying party configuration.
|
17
|
+
* @returns {Promise<{ presentationDefinition: PresentationDefinition }>} - Resolves with the presentation definition.
|
18
|
+
* @throws {Error} - Throws if the presentation definition cannot be found or fetched.
|
19
|
+
*/
|
20
|
+
export declare const fetchPresentDefinition: FetchPresentationDefinition;
|
21
|
+
//# sourceMappingURL=06-fetch-presentation-definition.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"06-fetch-presentation-definition.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/06-fetch-presentation-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAEpE,MAAM,MAAM,2BAA2B,GAAG,CACxC,aAAa,EAAE,aAAa,EAC5B,MAAM,CAAC,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,KAC5D,OAAO,CAAC;IACX,sBAAsB,EAAE,sBAAsB,CAAC;CAChD,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,EAAE,2BAuBpC,CAAC"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { DcqlQuery } from "dcql";
|
2
|
+
import type { Disclosure } from "../../sd-jwt/types";
|
3
|
+
import type { RemotePresentation } from "./types";
|
4
|
+
/**
|
5
|
+
* The purpose for the credential request by the RP.
|
6
|
+
*/
|
7
|
+
type CredentialPurpose = {
|
8
|
+
required: boolean;
|
9
|
+
description?: string;
|
10
|
+
};
|
11
|
+
export type EvaluateDcqlQuery = (credentialsSdJwt: [string, string][], query: DcqlQuery.Input) => {
|
12
|
+
id: string;
|
13
|
+
vct: string;
|
14
|
+
credential: string;
|
15
|
+
keyTag: string;
|
16
|
+
requiredDisclosures: Disclosure[];
|
17
|
+
purposes: CredentialPurpose[];
|
18
|
+
}[];
|
19
|
+
export type PrepareRemotePresentations = (credentials: {
|
20
|
+
id: string;
|
21
|
+
credential: string;
|
22
|
+
keyTag: string;
|
23
|
+
requestedClaims: string[];
|
24
|
+
}[], nonce: string, clientId: string) => Promise<RemotePresentation[]>;
|
25
|
+
export declare const evaluateDcqlQuery: EvaluateDcqlQuery;
|
26
|
+
export declare const prepareRemotePresentations: PrepareRemotePresentations;
|
27
|
+
export {};
|
28
|
+
//# sourceMappingURL=07-evaluate-dcql-query.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"07-evaluate-dcql-query.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/07-evaluate-dcql-query.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIV,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;GAEG;AACH,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAC9B,gBAAgB,EAAE,CAAC,MAAM,EAAe,MAAM,CAAkB,EAAE,EAClE,KAAK,EAAE,SAAS,CAAC,KAAK,KACnB;IACH,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,UAAU,EAAE,CAAC;IAClC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,EAAE,CAAC;AAEJ,MAAM,MAAM,0BAA0B,GAAG,CACvC,WAAW,EAAE;IACX,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,EAAE,EACH,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAyCnC,eAAO,MAAM,iBAAiB,EAAE,iBAmE/B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,0BAqBxC,CAAC"}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { InputDescriptor, type LegacyRemotePresentation } from "./types";
|
2
|
+
import { SdJwt4VC, type DisclosureWithEncoded } from "../../sd-jwt/types";
|
3
|
+
export type EvaluatedDisclosures = {
|
4
|
+
requiredDisclosures: DisclosureWithEncoded[];
|
5
|
+
optionalDisclosures: DisclosureWithEncoded[];
|
6
|
+
unrequestedDisclosures: DisclosureWithEncoded[];
|
7
|
+
};
|
8
|
+
export type EvaluateInputDescriptorSdJwt4VC = (inputDescriptor: InputDescriptor, payloadCredential: SdJwt4VC["payload"], disclosures: DisclosureWithEncoded[]) => EvaluatedDisclosures;
|
9
|
+
export type EvaluateInputDescriptors = (descriptors: InputDescriptor[], credentialsSdJwt: [string, string][]) => Promise<{
|
10
|
+
evaluatedDisclosure: EvaluatedDisclosures;
|
11
|
+
inputDescriptor: InputDescriptor;
|
12
|
+
credential: string;
|
13
|
+
keyTag: string;
|
14
|
+
}[]>;
|
15
|
+
/**
|
16
|
+
* @deprecated Use `prepareRemotePresentations` from DCQL
|
17
|
+
*/
|
18
|
+
export type PrepareLegacyRemotePresentations = (credentialAndDescriptors: {
|
19
|
+
requestedClaims: string[];
|
20
|
+
inputDescriptor: InputDescriptor;
|
21
|
+
credential: string;
|
22
|
+
keyTag: string;
|
23
|
+
}[], nonce: string, client_id: string) => Promise<LegacyRemotePresentation[]>;
|
24
|
+
/**
|
25
|
+
* Evaluates an InputDescriptor for an SD-JWT-based verifiable credential.
|
26
|
+
*
|
27
|
+
* - Checks each field in the InputDescriptor against the provided `payloadCredential`
|
28
|
+
* and `disclosures` (selectively disclosed claims).
|
29
|
+
* - Validates whether required fields are present (unless marked optional)
|
30
|
+
* and match any specified JSONPath.
|
31
|
+
* - If a field includes a JSON Schema filter, validates the claim value against that schema.
|
32
|
+
* - Enforces `limit_disclosure` rules by returning only disclosures, required and optional, matching the specified fields
|
33
|
+
* if set to "required". Otherwise also return the array unrequestedDisclosures with disclosures which can be passed for a particular use case.
|
34
|
+
* - Throws an error if a required field is invalid or missing.
|
35
|
+
*
|
36
|
+
* @param inputDescriptor - Describes constraints (fields, filters, etc.) that must be satisfied.
|
37
|
+
* @param payloadCredential - The credential payload to check against.
|
38
|
+
* @param disclosures - An array of DisclosureWithEncoded objects representing selective disclosures.
|
39
|
+
* @returns A filtered list of disclosures satisfying the descriptor constraints, or throws an error if not.
|
40
|
+
* @throws Will throw an error if any required constraint fails or if JSONPath lookups are invalid.
|
41
|
+
*/
|
42
|
+
export declare const evaluateInputDescriptorForSdJwt4VC: EvaluateInputDescriptorSdJwt4VC;
|
43
|
+
type DecodedCredentialSdJwt = {
|
44
|
+
keyTag: string;
|
45
|
+
credential: string;
|
46
|
+
sdJwt: SdJwt4VC;
|
47
|
+
disclosures: DisclosureWithEncoded[];
|
48
|
+
};
|
49
|
+
/**
|
50
|
+
* Finds the first credential that satisfies the input descriptor constraints.
|
51
|
+
* @param inputDescriptor The input descriptor to evaluate.
|
52
|
+
* @param decodedSdJwtCredentials An array of decoded SD-JWT credentials.
|
53
|
+
* @returns An object containing the matched evaluation, keyTag, and credential.
|
54
|
+
*/
|
55
|
+
export declare const findCredentialSdJwt: (inputDescriptor: InputDescriptor, decodedSdJwtCredentials: DecodedCredentialSdJwt[]) => {
|
56
|
+
matchedEvaluation: EvaluatedDisclosures;
|
57
|
+
matchedKeyTag: string;
|
58
|
+
matchedCredential: string;
|
59
|
+
};
|
60
|
+
/**
|
61
|
+
* Evaluates multiple input descriptors against provided SD-JWT and MDOC credentials.
|
62
|
+
*
|
63
|
+
* For each input descriptor, this function:
|
64
|
+
* - Checks the credential format.
|
65
|
+
* - Decodes the credential.
|
66
|
+
* - Evaluates the descriptor using the associated disclosures.
|
67
|
+
*
|
68
|
+
* @param inputDescriptors - An array of input descriptors.
|
69
|
+
* @param credentialsSdJwt - An array of tuples containing keyTag and SD-JWT credential.
|
70
|
+
* @returns An array of objects, each containing the evaluated disclosures,
|
71
|
+
* the input descriptor, the credential, and the keyTag.
|
72
|
+
* @throws {CredentialNotFoundError} When the credential format is unsupported.
|
73
|
+
*/
|
74
|
+
export declare const evaluateInputDescriptors: EvaluateInputDescriptors;
|
75
|
+
/**
|
76
|
+
* Prepares remote presentations for a set of credentials based on input descriptors.
|
77
|
+
*
|
78
|
+
* For each credential and its corresponding input descriptor, this function:
|
79
|
+
* - Validates the credential format.
|
80
|
+
* - Generates a verifiable presentation token (vpToken) using the provided nonce and client identifier.
|
81
|
+
*
|
82
|
+
* @deprecated Use `prepareRemotePresentations` from DCQL
|
83
|
+
*
|
84
|
+
* @param credentialAndDescriptors - An array containing objects with requested claims,
|
85
|
+
* input descriptor, credential, and keyTag.
|
86
|
+
* @param nonce - A unique nonce for the verifiable presentation token.
|
87
|
+
* @param client_id - The client identifier.
|
88
|
+
* @returns A promise that resolves to an array of RemotePresentation objects.
|
89
|
+
* @throws {CredentialNotFoundError} When the credential format is unsupported.
|
90
|
+
*/
|
91
|
+
export declare const prepareLegacyRemotePresentations: PrepareLegacyRemotePresentations;
|
92
|
+
export {};
|
93
|
+
//# sourceMappingURL=07-evaluate-input-descriptor.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"07-evaluate-input-descriptor.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/07-evaluate-input-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAU1E,MAAM,MAAM,oBAAoB,GAAG;IACjC,mBAAmB,EAAE,qBAAqB,EAAE,CAAC;IAC7C,mBAAmB,EAAE,qBAAqB,EAAE,CAAC;IAC7C,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAC5C,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,QAAQ,CAAC,SAAS,CAAC,EACtC,WAAW,EAAE,qBAAqB,EAAE,KACjC,oBAAoB,CAAC;AAE1B,MAAM,MAAM,wBAAwB,GAAG,CACrC,WAAW,EAAE,eAAe,EAAE,EAC9B,gBAAgB,EAAE,CAAC,MAAM,EAAe,MAAM,CAAkB,EAAE,KAC/D,OAAO,CACV;IACE,mBAAmB,EAAE,oBAAoB,CAAC;IAC1C,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,EAAE,CACJ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,CAC7C,wBAAwB,EAAE;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,EAAE,EACH,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;AA+EzC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kCAAkC,EAAE,+BAsG9C,CAAC;AAEJ,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,QAAQ,CAAC;IAChB,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,oBACb,eAAe,2BACP,sBAAsB,EAAE,KAChD;IACD,iBAAiB,EAAE,oBAAoB,CAAC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;CA6B3B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,EAAE,wBAoCtC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gCAAgC,EAAE,gCA0B5C,CAAC"}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import { type FetchJwks } from "./04-retrieve-rp-jwks";
|
2
|
+
import type { VerifyRequestObject } from "./05-verify-request-object";
|
3
|
+
import { type Out } from "../../utils/misc";
|
4
|
+
import { type RemotePresentation, DirectAuthorizationBodyPayload, type LegacyRemotePresentation, LegacyDirectAuthorizationBodyPayload } from "./types";
|
5
|
+
import * as z from "zod";
|
6
|
+
import type { JWK } from "../../utils/jwk";
|
7
|
+
import type { RelyingPartyEntityConfiguration } from "../../trust";
|
8
|
+
export type AuthorizationResponse = z.infer<typeof AuthorizationResponse>;
|
9
|
+
export declare const AuthorizationResponse: z.ZodObject<{
|
10
|
+
status: z.ZodOptional<z.ZodString>;
|
11
|
+
response_code: z.ZodOptional<z.ZodString>;
|
12
|
+
redirect_uri: z.ZodOptional<z.ZodString>;
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
14
|
+
status?: string | undefined;
|
15
|
+
response_code?: string | undefined;
|
16
|
+
redirect_uri?: string | undefined;
|
17
|
+
}, {
|
18
|
+
status?: string | undefined;
|
19
|
+
response_code?: string | undefined;
|
20
|
+
redirect_uri?: string | undefined;
|
21
|
+
}>;
|
22
|
+
/**
|
23
|
+
* Selects a public key (with `use = enc`) from the set of JWK keys
|
24
|
+
* offered by the Relying Party (RP) for encryption.
|
25
|
+
*
|
26
|
+
* @param rpJwkKeys - The array of JWKs retrieved from the RP entity configuration.
|
27
|
+
* @returns The first suitable public key found in the list.
|
28
|
+
* @throws {NoSuitableKeysFoundInEntityConfiguration} If no suitable encryption key is found.
|
29
|
+
*/
|
30
|
+
export declare const choosePublicKeyToEncrypt: (rpJwkKeys: Out<FetchJwks>["keys"]) => JWK;
|
31
|
+
/**
|
32
|
+
* Builds a URL-encoded form body for a direct POST response using JWT encryption.
|
33
|
+
*
|
34
|
+
* @param jwkKeys - Array of JWKs from the Relying Party for encryption.
|
35
|
+
* @param requestObject - Contains state, nonce, and other relevant info.
|
36
|
+
* @param payload - Object that contains the VP token to encrypt and the mapping of the credential disclosures
|
37
|
+
* @returns A URL-encoded string for an `application/x-www-form-urlencoded` POST body, where `response` contains the encrypted JWE.
|
38
|
+
*/
|
39
|
+
export declare const buildDirectPostJwtBody: (requestObject: Out<VerifyRequestObject>["requestObject"], rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"], payload: DirectAuthorizationBodyPayload | LegacyDirectAuthorizationBodyPayload) => Promise<string>;
|
40
|
+
/**
|
41
|
+
* Type definition for the function that sends the authorization response
|
42
|
+
* to the Relying Party, completing the presentation flow.
|
43
|
+
* Use with `presentation_definition`.
|
44
|
+
* @deprecated Use `sendAuthorizationResponse`
|
45
|
+
*/
|
46
|
+
export type SendLegacyAuthorizationResponse = (requestObject: Out<VerifyRequestObject>["requestObject"], presentationDefinitionId: string, remotePresentations: LegacyRemotePresentation[], rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"], context?: {
|
47
|
+
appFetch?: GlobalFetch["fetch"];
|
48
|
+
}) => Promise<AuthorizationResponse>;
|
49
|
+
/**
|
50
|
+
* Sends the authorization response to the Relying Party (RP) using the specified `response_mode`.
|
51
|
+
* This function completes the presentation flow in an OpenID 4 Verifiable Presentations scenario.
|
52
|
+
*
|
53
|
+
* @param requestObject - The request details, including presentation requirements.
|
54
|
+
* @param presentationDefinition - The definition of the expected presentation.
|
55
|
+
* @param jwkKeys - Array of JWKs from the Relying Party for optional encryption.
|
56
|
+
* @param presentation - Tuple with verifiable credential, claims, and crypto context.
|
57
|
+
* @param context - Contains optional custom fetch implementation.
|
58
|
+
* @returns Parsed and validated authorization response from the Relying Party.
|
59
|
+
*/
|
60
|
+
export declare const sendLegacyAuthorizationResponse: SendLegacyAuthorizationResponse;
|
61
|
+
/**
|
62
|
+
* Type definition for the function that sends the authorization response
|
63
|
+
* to the Relying Party, completing the presentation flow.
|
64
|
+
* Use with DCQL queries.
|
65
|
+
*/
|
66
|
+
export type SendAuthorizationResponse = (requestObject: Out<VerifyRequestObject>["requestObject"], remotePresentations: RemotePresentation[], rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"], context?: {
|
67
|
+
appFetch?: GlobalFetch["fetch"];
|
68
|
+
}) => Promise<AuthorizationResponse>;
|
69
|
+
export declare const sendAuthorizationResponse: SendAuthorizationResponse;
|
70
|
+
//# sourceMappingURL=08-send-authorization-response.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"08-send-authorization-response.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/08-send-authorization-response.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EACL,KAAK,kBAAkB,EACvB,8BAA8B,EAC9B,KAAK,wBAAwB,EAC7B,oCAAoC,EACrC,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAUhC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,cACxB,IAAI,SAAS,CAAC,CAAC,MAAM,CAAC,KAChC,GAWF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,kBAClB,IAAI,mBAAmB,CAAC,CAAC,eAAe,CAAC,UAChD,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,WACrD,8BAA8B,GAAG,oCAAoC,KAC7E,QAAQ,MAAM,CAkChB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAC5C,aAAa,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,eAAe,CAAC,EACxD,wBAAwB,EAAE,MAAM,EAChC,mBAAmB,EAAE,wBAAwB,EAAE,EAC/C,MAAM,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,EAC9D,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B,EAAE,+BAkD3C,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,CACtC,aAAa,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,eAAe,CAAC,EACxD,mBAAmB,EAAE,kBAAkB,EAAE,EACzC,MAAM,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,EAC9D,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC,eAAO,MAAM,yBAAyB,EAAE,yBA4BvC,CAAC"}
|
@@ -22,4 +22,47 @@ export declare class NoSuitableKeysFoundInEntityConfiguration extends IoWalletEr
|
|
22
22
|
*/
|
23
23
|
constructor(scenario: string);
|
24
24
|
}
|
25
|
+
/**
|
26
|
+
* When a QR code is not valid.
|
27
|
+
*
|
28
|
+
*/
|
29
|
+
export declare class InvalidQRCodeError extends IoWalletError {
|
30
|
+
code: string;
|
31
|
+
/** Detailed reason for the QR code validation failure. */
|
32
|
+
reason: string;
|
33
|
+
constructor(reason: string);
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* When the entity is unverified because the Relying Party is not trusted.
|
37
|
+
*
|
38
|
+
*/
|
39
|
+
export declare class UnverifiedEntityError extends IoWalletError {
|
40
|
+
code: string;
|
41
|
+
/**
|
42
|
+
* @param reason A description of why the entity cannot be verified.
|
43
|
+
*/
|
44
|
+
constructor(reason: string);
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* When some required data is missing to continue because certain attributes are not contained inside the wallet.
|
48
|
+
*
|
49
|
+
*/
|
50
|
+
export declare class MissingDataError extends IoWalletError {
|
51
|
+
code: string;
|
52
|
+
/**
|
53
|
+
* @param missingAttributes An array or description of the attributes that are missing.
|
54
|
+
*/
|
55
|
+
constructor(missingAttributes: string);
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* When a credential is not found in the wallet.
|
59
|
+
*
|
60
|
+
*/
|
61
|
+
export declare class CredentialNotFoundError extends IoWalletError {
|
62
|
+
code: string;
|
63
|
+
/**
|
64
|
+
* @param credentialId The ID of the credential that was not found.
|
65
|
+
*/
|
66
|
+
constructor(credentialId: string);
|
67
|
+
}
|
25
68
|
//# sourceMappingURL=errors.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,oBAAoB,CAAC;AAEnE;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,IAAI,SAAwD;IAE5D,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAGb,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAsB,EAC7B,MAAM,GAAE,MAAsB;CAMjC;AAED;;;GAGG;AACH,qBAAa,wCAAyC,SAAQ,aAAa;IACzE,IAAI,SAAoC;IAExC;;OAEG;gBACS,QAAQ,EAAE,MAAM;CAI7B"}
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,oBAAoB,CAAC;AAEnE;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,IAAI,SAAwD;IAE5D,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAGb,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAsB,EAC7B,MAAM,GAAE,MAAsB;CAMjC;AAED;;;GAGG;AACH,qBAAa,wCAAyC,SAAQ,aAAa;IACzE,IAAI,SAAoC;IAExC;;OAEG;gBACS,QAAQ,EAAE,MAAM;CAI7B;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,IAAI,SAAyB;IAE7B,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;gBAEH,MAAM,EAAE,MAAM;CAI3B;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,IAAI,SAA8B;IAElC;;OAEG;gBACS,MAAM,EAAE,MAAM;CAI3B;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,IAAI,SAAsB;IAE1B;;OAEG;gBACS,iBAAiB,EAAE,MAAM;CAItC;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,aAAa;IACxD,IAAI,SAA8B;IAElC;;OAEG;gBACS,YAAY,EAAE,MAAM;CAIjC"}
|
@@ -1,8 +1,13 @@
|
|
1
1
|
import { startFlowFromQR, type StartFlow } from "./01-start-flow";
|
2
2
|
import { evaluateRelyingPartyTrust, type EvaluateRelyingPartyTrust } from "./02-evaluate-rp-trust";
|
3
3
|
import { getRequestObject, type GetRequestObject } from "./03-get-request-object";
|
4
|
-
import {
|
4
|
+
import { getJwksFromConfig, type FetchJwks } from "./04-retrieve-rp-jwks";
|
5
|
+
import { verifyRequestObject, type VerifyRequestObject } from "./05-verify-request-object";
|
6
|
+
import { fetchPresentDefinition, type FetchPresentationDefinition } from "./06-fetch-presentation-definition";
|
7
|
+
import { evaluateInputDescriptors, prepareLegacyRemotePresentations, type EvaluateInputDescriptors, type PrepareLegacyRemotePresentations } from "./07-evaluate-input-descriptor";
|
8
|
+
import { evaluateDcqlQuery, prepareRemotePresentations, type EvaluateDcqlQuery, type PrepareRemotePresentations } from "./07-evaluate-dcql-query";
|
9
|
+
import { sendAuthorizationResponse, type SendAuthorizationResponse, sendLegacyAuthorizationResponse, type SendLegacyAuthorizationResponse } from "./08-send-authorization-response";
|
5
10
|
import * as Errors from "./errors";
|
6
|
-
export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, sendAuthorizationResponse, Errors, };
|
7
|
-
export type { StartFlow, EvaluateRelyingPartyTrust, GetRequestObject, SendAuthorizationResponse, };
|
11
|
+
export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, getJwksFromConfig, verifyRequestObject, fetchPresentDefinition, evaluateInputDescriptors, evaluateDcqlQuery, prepareLegacyRemotePresentations, prepareRemotePresentations, sendAuthorizationResponse, sendLegacyAuthorizationResponse, Errors, };
|
12
|
+
export type { StartFlow, EvaluateRelyingPartyTrust, GetRequestObject, FetchJwks, VerifyRequestObject, FetchPresentationDefinition, EvaluateInputDescriptors, EvaluateDcqlQuery, PrepareLegacyRemotePresentations, PrepareRemotePresentations, SendAuthorizationResponse, SendLegacyAuthorizationResponse, };
|
8
13
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,GACP,CAAC;AACF,YAAY,EACV,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EAChB,yBAAyB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,EACjC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,EACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,KAAK,+BAA+B,EACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,EAC/B,MAAM,GACP,CAAC;AACF,YAAY,EACV,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,GAChC,CAAC"}
|