@pagopa/io-wallet-oid4vp 1.2.0 → 1.3.0
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/dist/index.d.mts +85 -77
- package/dist/index.d.ts +85 -77
- package/dist/index.js +156 -146
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +163 -153
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -399,8 +399,6 @@ declare function validateAuthorizationRequestParams(params: AuthorizationRequest
|
|
|
399
399
|
request_uri_method?: never;
|
|
400
400
|
}) & typeof params;
|
|
401
401
|
|
|
402
|
-
declare function parseVpToken(vpToken: unknown): Record<string, string | string[]>;
|
|
403
|
-
|
|
404
402
|
declare const zVpToken: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
405
403
|
type VpToken = z.infer<typeof zVpToken>;
|
|
406
404
|
|
|
@@ -511,72 +509,6 @@ interface FetchAuthorizationResponseOptions {
|
|
|
511
509
|
*/
|
|
512
510
|
declare function fetchAuthorizationResponse(options: FetchAuthorizationResponseOptions): Promise<Openid4vpAuthorizationResponseResult>;
|
|
513
511
|
|
|
514
|
-
declare function extractEncryptionJwkFromJwks(jwks: JwkSet, { kid, supportedAlgValues, }: {
|
|
515
|
-
kid?: string;
|
|
516
|
-
supportedAlgValues?: string[];
|
|
517
|
-
}): {
|
|
518
|
-
[x: string]: unknown;
|
|
519
|
-
kty: string;
|
|
520
|
-
alg?: string | undefined;
|
|
521
|
-
crv?: string | undefined;
|
|
522
|
-
d?: string | undefined;
|
|
523
|
-
dp?: string | undefined;
|
|
524
|
-
dq?: string | undefined;
|
|
525
|
-
e?: string | undefined;
|
|
526
|
-
ext?: boolean | undefined;
|
|
527
|
-
k?: string | undefined;
|
|
528
|
-
key_ops?: string[] | undefined;
|
|
529
|
-
kid?: string | undefined;
|
|
530
|
-
n?: string | undefined;
|
|
531
|
-
oth?: {
|
|
532
|
-
[x: string]: unknown;
|
|
533
|
-
d?: string | undefined;
|
|
534
|
-
r?: string | undefined;
|
|
535
|
-
t?: string | undefined;
|
|
536
|
-
}[] | undefined;
|
|
537
|
-
p?: string | undefined;
|
|
538
|
-
q?: string | undefined;
|
|
539
|
-
qi?: string | undefined;
|
|
540
|
-
use?: string | undefined;
|
|
541
|
-
x?: string | undefined;
|
|
542
|
-
x5c?: string[] | undefined;
|
|
543
|
-
x5t?: string | undefined;
|
|
544
|
-
"x5t#S256"?: string | undefined;
|
|
545
|
-
x5u?: string | undefined;
|
|
546
|
-
y?: string | undefined;
|
|
547
|
-
} | undefined;
|
|
548
|
-
|
|
549
|
-
interface ParseJarmAuthorizationResponseOptions {
|
|
550
|
-
/**
|
|
551
|
-
* Parsed authorization request payload used to validate JARM claims.
|
|
552
|
-
*/
|
|
553
|
-
authorizationRequestPayload: Openid4vpAuthorizationRequestPayload;
|
|
554
|
-
/**
|
|
555
|
-
* Callbacks used to decrypt and verify JARM JWT/JWE responses.
|
|
556
|
-
*/
|
|
557
|
-
callbacks: Pick<CallbackContext, "decryptJwe" | "verifyJwt">;
|
|
558
|
-
/**
|
|
559
|
-
* Compact JARM authorization response (`response` parameter value).
|
|
560
|
-
*/
|
|
561
|
-
jarmResponseJwt: string;
|
|
562
|
-
/**
|
|
563
|
-
* Current time used for temporal claim validation (`exp`, `nbf`).
|
|
564
|
-
* Defaults to current date-time when omitted.
|
|
565
|
-
*/
|
|
566
|
-
now?: Date;
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
* Parses and validates a JARM authorization response for OpenID4VP.
|
|
570
|
-
*
|
|
571
|
-
* This function validates compact format, decrypts and/or verifies the JARM token,
|
|
572
|
-
* parses the resulting OpenID4VP authorization response, and validates it against
|
|
573
|
-
* the originating authorization request.
|
|
574
|
-
*
|
|
575
|
-
* @param options {@link ParseJarmAuthorizationResponseOptions}
|
|
576
|
-
* @returns Parsed authorization response enriched with JARM metadata.
|
|
577
|
-
*/
|
|
578
|
-
declare function parseJarmAuthorizationResponse(options: ParseJarmAuthorizationResponseOptions): Promise<ParseAuthorizationResponseResult>;
|
|
579
|
-
|
|
580
512
|
declare const zJarmHeader: z.ZodObject<{
|
|
581
513
|
apu: z.ZodOptional<z.ZodString>;
|
|
582
514
|
apv: z.ZodOptional<z.ZodString>;
|
|
@@ -936,6 +868,8 @@ declare function verifyJarmAuthorizationResponse(options: VerifyJarmAuthorizatio
|
|
|
936
868
|
type: JarmMode;
|
|
937
869
|
}>;
|
|
938
870
|
|
|
871
|
+
declare function parseVpToken(vpToken: unknown): Record<string, string | string[]>;
|
|
872
|
+
|
|
939
873
|
interface ValidateOpenid4vpAuthorizationResponseOptions {
|
|
940
874
|
/**
|
|
941
875
|
* Parsed request payload used as validation source.
|
|
@@ -1001,8 +935,10 @@ declare function parseAuthorizationResponse(options: ParseAuthorizationResponseO
|
|
|
1001
935
|
* Generic error thrown during Oid4vp operations
|
|
1002
936
|
*/
|
|
1003
937
|
declare class Oid4vpError extends Error {
|
|
1004
|
-
readonly statusCode?: number
|
|
1005
|
-
constructor(message: string,
|
|
938
|
+
readonly statusCode?: number;
|
|
939
|
+
constructor(message: string, options?: {
|
|
940
|
+
statusCode?: number;
|
|
941
|
+
} & ErrorOptions);
|
|
1006
942
|
}
|
|
1007
943
|
/**
|
|
1008
944
|
* Error thrown by {@link parseAuthorizeRequest} when the passed
|
|
@@ -1010,30 +946,102 @@ declare class Oid4vpError extends Error {
|
|
|
1010
946
|
* are thrown
|
|
1011
947
|
*/
|
|
1012
948
|
declare class ParseAuthorizeRequestError extends Oid4vpError {
|
|
1013
|
-
readonly statusCode?: number
|
|
1014
|
-
constructor(message: string,
|
|
949
|
+
readonly statusCode?: number;
|
|
950
|
+
constructor(message: string, options?: {
|
|
951
|
+
statusCode?: number;
|
|
952
|
+
} & ErrorOptions);
|
|
1015
953
|
}
|
|
1016
954
|
/**
|
|
1017
955
|
* Error thrown by {@link fetchAuthorizationResponse}
|
|
1018
956
|
*/
|
|
1019
957
|
declare class FetchAuthorizationResponseError extends Oid4vpError {
|
|
1020
|
-
readonly statusCode?: number
|
|
1021
|
-
constructor(message: string,
|
|
958
|
+
readonly statusCode?: number;
|
|
959
|
+
constructor(message: string, options?: {
|
|
960
|
+
statusCode?: number;
|
|
961
|
+
} & ErrorOptions);
|
|
1022
962
|
}
|
|
1023
963
|
/**
|
|
1024
964
|
* Error thrown by {@link createAuthorizationResponse} in case there
|
|
1025
965
|
* are unexpected errors.
|
|
1026
966
|
*/
|
|
1027
967
|
declare class CreateAuthorizationResponseError extends Oid4vpError {
|
|
1028
|
-
readonly statusCode?: number
|
|
1029
|
-
constructor(message: string,
|
|
968
|
+
readonly statusCode?: number;
|
|
969
|
+
constructor(message: string, options?: {
|
|
970
|
+
statusCode?: number;
|
|
971
|
+
} & ErrorOptions);
|
|
1030
972
|
}
|
|
1031
973
|
/**
|
|
1032
974
|
* Error thrown when request_uri_method parameter has an invalid value.
|
|
1033
975
|
* Valid values are "get" or "post" (case-insensitive).
|
|
1034
976
|
*/
|
|
1035
977
|
declare class InvalidRequestUriMethodError extends Oid4vpError {
|
|
1036
|
-
constructor(message: string);
|
|
978
|
+
constructor(message: string, options?: ErrorOptions);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
declare function extractEncryptionJwkFromJwks(jwks: JwkSet, { kid, supportedAlgValues, }: {
|
|
982
|
+
kid?: string;
|
|
983
|
+
supportedAlgValues?: string[];
|
|
984
|
+
}): {
|
|
985
|
+
[x: string]: unknown;
|
|
986
|
+
kty: string;
|
|
987
|
+
alg?: string | undefined;
|
|
988
|
+
crv?: string | undefined;
|
|
989
|
+
d?: string | undefined;
|
|
990
|
+
dp?: string | undefined;
|
|
991
|
+
dq?: string | undefined;
|
|
992
|
+
e?: string | undefined;
|
|
993
|
+
ext?: boolean | undefined;
|
|
994
|
+
k?: string | undefined;
|
|
995
|
+
key_ops?: string[] | undefined;
|
|
996
|
+
kid?: string | undefined;
|
|
997
|
+
n?: string | undefined;
|
|
998
|
+
oth?: {
|
|
999
|
+
[x: string]: unknown;
|
|
1000
|
+
d?: string | undefined;
|
|
1001
|
+
r?: string | undefined;
|
|
1002
|
+
t?: string | undefined;
|
|
1003
|
+
}[] | undefined;
|
|
1004
|
+
p?: string | undefined;
|
|
1005
|
+
q?: string | undefined;
|
|
1006
|
+
qi?: string | undefined;
|
|
1007
|
+
use?: string | undefined;
|
|
1008
|
+
x?: string | undefined;
|
|
1009
|
+
x5c?: string[] | undefined;
|
|
1010
|
+
x5t?: string | undefined;
|
|
1011
|
+
"x5t#S256"?: string | undefined;
|
|
1012
|
+
x5u?: string | undefined;
|
|
1013
|
+
y?: string | undefined;
|
|
1014
|
+
} | undefined;
|
|
1015
|
+
|
|
1016
|
+
interface ParseJarmAuthorizationResponseOptions {
|
|
1017
|
+
/**
|
|
1018
|
+
* Parsed authorization request payload used to validate JARM claims.
|
|
1019
|
+
*/
|
|
1020
|
+
authorizationRequestPayload: Openid4vpAuthorizationRequestPayload;
|
|
1021
|
+
/**
|
|
1022
|
+
* Callbacks used to decrypt and verify JARM JWT/JWE responses.
|
|
1023
|
+
*/
|
|
1024
|
+
callbacks: Pick<CallbackContext, "decryptJwe" | "verifyJwt">;
|
|
1025
|
+
/**
|
|
1026
|
+
* Compact JARM authorization response (`response` parameter value).
|
|
1027
|
+
*/
|
|
1028
|
+
jarmResponseJwt: string;
|
|
1029
|
+
/**
|
|
1030
|
+
* Current time used for temporal claim validation (`exp`, `nbf`).
|
|
1031
|
+
* Defaults to current date-time when omitted.
|
|
1032
|
+
*/
|
|
1033
|
+
now?: Date;
|
|
1037
1034
|
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Parses and validates a JARM authorization response for OpenID4VP.
|
|
1037
|
+
*
|
|
1038
|
+
* This function validates compact format, decrypts and/or verifies the JARM token,
|
|
1039
|
+
* parses the resulting OpenID4VP authorization response, and validates it against
|
|
1040
|
+
* the originating authorization request.
|
|
1041
|
+
*
|
|
1042
|
+
* @param options {@link ParseJarmAuthorizationResponseOptions}
|
|
1043
|
+
* @returns Parsed authorization response enriched with JARM metadata.
|
|
1044
|
+
*/
|
|
1045
|
+
declare function parseJarmAuthorizationResponse(options: ParseJarmAuthorizationResponseOptions): Promise<ParseAuthorizationResponseResult>;
|
|
1038
1046
|
|
|
1039
1047
|
export { type AuthorizationRequestUrlParams, ClientIdPrefix, type CreateAuthorizationRequestOptions, type CreateAuthorizationRequestOptionsV1_0, type CreateAuthorizationRequestOptionsV1_3, type CreateAuthorizationRequestResult, type CreateAuthorizationRequestResultV1_0, type CreateAuthorizationRequestResultV1_3, CreateAuthorizationResponseError, type CreateAuthorizationResponseOptions, type CreateAuthorizationResponseResult, type EncryptedJarmHeader, type FetchAuthorizationRequestOptions, type FetchAuthorizationRequestResult, FetchAuthorizationResponseError, type FetchAuthorizationResponseOptions, InvalidRequestUriMethodError, type JarOptionsV1_0, type JarOptionsV1_3, type JarmAuthorizationResponse, type JarmAuthorizationResponseEncryptedOnly, type JarmHeader, JarmMode, Oid4vpError, type Openid4vpAuthorizationRequestHeader, type Openid4vpAuthorizationRequestHeaderV1_0, type Openid4vpAuthorizationRequestHeaderV1_3, type Openid4vpAuthorizationRequestPayload, type Openid4vpAuthorizationResponse, type Openid4vpAuthorizationResponseResult, type ParseAuthorizationResponseOptions, type ParseAuthorizationResponseResult, ParseAuthorizeRequestError, type ParseAuthorizeRequestOptions, type ParseJarmAuthorizationResponseOptions, type ParsedAuthorizeRequestResult, type ParsedQrCode, type ValidateOpenid4vpAuthorizationResponseOptions, type ValidateOpenid4vpAuthorizationResponseResult, type VerifyJarmAuthorizationResponseOptions, type VerifyJarmAuthorizationResponseResult, createAuthorizationRequest, createAuthorizationResponse, extractClientIdPrefix, extractEncryptionJwkFromJwks, fetchAuthorizationRequest, fetchAuthorizationResponse, fetchRequestObjectJwt, parseAuthorizationResponse, parseAuthorizeRequest, parseJarmAuthorizationResponse, parseVpToken, validateAuthorizationRequestParams, validateOpenid4vpAuthorizationResponsePayload, verifyJarmAuthorizationResponse, zAuthorizationRequestUrlParams, zEncryptedJarmHeader, zJarmAuthorizationResponse, zJarmAuthorizationResponseEncryptedOnly, zJarmHeader, zOpenid4vpAuthorizationRequestHeaderV1_0, zOpenid4vpAuthorizationRequestHeaderV1_3, zOpenid4vpAuthorizationRequestPayload, zOpenid4vpAuthorizationResponse, zOpenid4vpAuthorizationResponseResult, zVpToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -399,8 +399,6 @@ declare function validateAuthorizationRequestParams(params: AuthorizationRequest
|
|
|
399
399
|
request_uri_method?: never;
|
|
400
400
|
}) & typeof params;
|
|
401
401
|
|
|
402
|
-
declare function parseVpToken(vpToken: unknown): Record<string, string | string[]>;
|
|
403
|
-
|
|
404
402
|
declare const zVpToken: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
405
403
|
type VpToken = z.infer<typeof zVpToken>;
|
|
406
404
|
|
|
@@ -511,72 +509,6 @@ interface FetchAuthorizationResponseOptions {
|
|
|
511
509
|
*/
|
|
512
510
|
declare function fetchAuthorizationResponse(options: FetchAuthorizationResponseOptions): Promise<Openid4vpAuthorizationResponseResult>;
|
|
513
511
|
|
|
514
|
-
declare function extractEncryptionJwkFromJwks(jwks: JwkSet, { kid, supportedAlgValues, }: {
|
|
515
|
-
kid?: string;
|
|
516
|
-
supportedAlgValues?: string[];
|
|
517
|
-
}): {
|
|
518
|
-
[x: string]: unknown;
|
|
519
|
-
kty: string;
|
|
520
|
-
alg?: string | undefined;
|
|
521
|
-
crv?: string | undefined;
|
|
522
|
-
d?: string | undefined;
|
|
523
|
-
dp?: string | undefined;
|
|
524
|
-
dq?: string | undefined;
|
|
525
|
-
e?: string | undefined;
|
|
526
|
-
ext?: boolean | undefined;
|
|
527
|
-
k?: string | undefined;
|
|
528
|
-
key_ops?: string[] | undefined;
|
|
529
|
-
kid?: string | undefined;
|
|
530
|
-
n?: string | undefined;
|
|
531
|
-
oth?: {
|
|
532
|
-
[x: string]: unknown;
|
|
533
|
-
d?: string | undefined;
|
|
534
|
-
r?: string | undefined;
|
|
535
|
-
t?: string | undefined;
|
|
536
|
-
}[] | undefined;
|
|
537
|
-
p?: string | undefined;
|
|
538
|
-
q?: string | undefined;
|
|
539
|
-
qi?: string | undefined;
|
|
540
|
-
use?: string | undefined;
|
|
541
|
-
x?: string | undefined;
|
|
542
|
-
x5c?: string[] | undefined;
|
|
543
|
-
x5t?: string | undefined;
|
|
544
|
-
"x5t#S256"?: string | undefined;
|
|
545
|
-
x5u?: string | undefined;
|
|
546
|
-
y?: string | undefined;
|
|
547
|
-
} | undefined;
|
|
548
|
-
|
|
549
|
-
interface ParseJarmAuthorizationResponseOptions {
|
|
550
|
-
/**
|
|
551
|
-
* Parsed authorization request payload used to validate JARM claims.
|
|
552
|
-
*/
|
|
553
|
-
authorizationRequestPayload: Openid4vpAuthorizationRequestPayload;
|
|
554
|
-
/**
|
|
555
|
-
* Callbacks used to decrypt and verify JARM JWT/JWE responses.
|
|
556
|
-
*/
|
|
557
|
-
callbacks: Pick<CallbackContext, "decryptJwe" | "verifyJwt">;
|
|
558
|
-
/**
|
|
559
|
-
* Compact JARM authorization response (`response` parameter value).
|
|
560
|
-
*/
|
|
561
|
-
jarmResponseJwt: string;
|
|
562
|
-
/**
|
|
563
|
-
* Current time used for temporal claim validation (`exp`, `nbf`).
|
|
564
|
-
* Defaults to current date-time when omitted.
|
|
565
|
-
*/
|
|
566
|
-
now?: Date;
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
* Parses and validates a JARM authorization response for OpenID4VP.
|
|
570
|
-
*
|
|
571
|
-
* This function validates compact format, decrypts and/or verifies the JARM token,
|
|
572
|
-
* parses the resulting OpenID4VP authorization response, and validates it against
|
|
573
|
-
* the originating authorization request.
|
|
574
|
-
*
|
|
575
|
-
* @param options {@link ParseJarmAuthorizationResponseOptions}
|
|
576
|
-
* @returns Parsed authorization response enriched with JARM metadata.
|
|
577
|
-
*/
|
|
578
|
-
declare function parseJarmAuthorizationResponse(options: ParseJarmAuthorizationResponseOptions): Promise<ParseAuthorizationResponseResult>;
|
|
579
|
-
|
|
580
512
|
declare const zJarmHeader: z.ZodObject<{
|
|
581
513
|
apu: z.ZodOptional<z.ZodString>;
|
|
582
514
|
apv: z.ZodOptional<z.ZodString>;
|
|
@@ -936,6 +868,8 @@ declare function verifyJarmAuthorizationResponse(options: VerifyJarmAuthorizatio
|
|
|
936
868
|
type: JarmMode;
|
|
937
869
|
}>;
|
|
938
870
|
|
|
871
|
+
declare function parseVpToken(vpToken: unknown): Record<string, string | string[]>;
|
|
872
|
+
|
|
939
873
|
interface ValidateOpenid4vpAuthorizationResponseOptions {
|
|
940
874
|
/**
|
|
941
875
|
* Parsed request payload used as validation source.
|
|
@@ -1001,8 +935,10 @@ declare function parseAuthorizationResponse(options: ParseAuthorizationResponseO
|
|
|
1001
935
|
* Generic error thrown during Oid4vp operations
|
|
1002
936
|
*/
|
|
1003
937
|
declare class Oid4vpError extends Error {
|
|
1004
|
-
readonly statusCode?: number
|
|
1005
|
-
constructor(message: string,
|
|
938
|
+
readonly statusCode?: number;
|
|
939
|
+
constructor(message: string, options?: {
|
|
940
|
+
statusCode?: number;
|
|
941
|
+
} & ErrorOptions);
|
|
1006
942
|
}
|
|
1007
943
|
/**
|
|
1008
944
|
* Error thrown by {@link parseAuthorizeRequest} when the passed
|
|
@@ -1010,30 +946,102 @@ declare class Oid4vpError extends Error {
|
|
|
1010
946
|
* are thrown
|
|
1011
947
|
*/
|
|
1012
948
|
declare class ParseAuthorizeRequestError extends Oid4vpError {
|
|
1013
|
-
readonly statusCode?: number
|
|
1014
|
-
constructor(message: string,
|
|
949
|
+
readonly statusCode?: number;
|
|
950
|
+
constructor(message: string, options?: {
|
|
951
|
+
statusCode?: number;
|
|
952
|
+
} & ErrorOptions);
|
|
1015
953
|
}
|
|
1016
954
|
/**
|
|
1017
955
|
* Error thrown by {@link fetchAuthorizationResponse}
|
|
1018
956
|
*/
|
|
1019
957
|
declare class FetchAuthorizationResponseError extends Oid4vpError {
|
|
1020
|
-
readonly statusCode?: number
|
|
1021
|
-
constructor(message: string,
|
|
958
|
+
readonly statusCode?: number;
|
|
959
|
+
constructor(message: string, options?: {
|
|
960
|
+
statusCode?: number;
|
|
961
|
+
} & ErrorOptions);
|
|
1022
962
|
}
|
|
1023
963
|
/**
|
|
1024
964
|
* Error thrown by {@link createAuthorizationResponse} in case there
|
|
1025
965
|
* are unexpected errors.
|
|
1026
966
|
*/
|
|
1027
967
|
declare class CreateAuthorizationResponseError extends Oid4vpError {
|
|
1028
|
-
readonly statusCode?: number
|
|
1029
|
-
constructor(message: string,
|
|
968
|
+
readonly statusCode?: number;
|
|
969
|
+
constructor(message: string, options?: {
|
|
970
|
+
statusCode?: number;
|
|
971
|
+
} & ErrorOptions);
|
|
1030
972
|
}
|
|
1031
973
|
/**
|
|
1032
974
|
* Error thrown when request_uri_method parameter has an invalid value.
|
|
1033
975
|
* Valid values are "get" or "post" (case-insensitive).
|
|
1034
976
|
*/
|
|
1035
977
|
declare class InvalidRequestUriMethodError extends Oid4vpError {
|
|
1036
|
-
constructor(message: string);
|
|
978
|
+
constructor(message: string, options?: ErrorOptions);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
declare function extractEncryptionJwkFromJwks(jwks: JwkSet, { kid, supportedAlgValues, }: {
|
|
982
|
+
kid?: string;
|
|
983
|
+
supportedAlgValues?: string[];
|
|
984
|
+
}): {
|
|
985
|
+
[x: string]: unknown;
|
|
986
|
+
kty: string;
|
|
987
|
+
alg?: string | undefined;
|
|
988
|
+
crv?: string | undefined;
|
|
989
|
+
d?: string | undefined;
|
|
990
|
+
dp?: string | undefined;
|
|
991
|
+
dq?: string | undefined;
|
|
992
|
+
e?: string | undefined;
|
|
993
|
+
ext?: boolean | undefined;
|
|
994
|
+
k?: string | undefined;
|
|
995
|
+
key_ops?: string[] | undefined;
|
|
996
|
+
kid?: string | undefined;
|
|
997
|
+
n?: string | undefined;
|
|
998
|
+
oth?: {
|
|
999
|
+
[x: string]: unknown;
|
|
1000
|
+
d?: string | undefined;
|
|
1001
|
+
r?: string | undefined;
|
|
1002
|
+
t?: string | undefined;
|
|
1003
|
+
}[] | undefined;
|
|
1004
|
+
p?: string | undefined;
|
|
1005
|
+
q?: string | undefined;
|
|
1006
|
+
qi?: string | undefined;
|
|
1007
|
+
use?: string | undefined;
|
|
1008
|
+
x?: string | undefined;
|
|
1009
|
+
x5c?: string[] | undefined;
|
|
1010
|
+
x5t?: string | undefined;
|
|
1011
|
+
"x5t#S256"?: string | undefined;
|
|
1012
|
+
x5u?: string | undefined;
|
|
1013
|
+
y?: string | undefined;
|
|
1014
|
+
} | undefined;
|
|
1015
|
+
|
|
1016
|
+
interface ParseJarmAuthorizationResponseOptions {
|
|
1017
|
+
/**
|
|
1018
|
+
* Parsed authorization request payload used to validate JARM claims.
|
|
1019
|
+
*/
|
|
1020
|
+
authorizationRequestPayload: Openid4vpAuthorizationRequestPayload;
|
|
1021
|
+
/**
|
|
1022
|
+
* Callbacks used to decrypt and verify JARM JWT/JWE responses.
|
|
1023
|
+
*/
|
|
1024
|
+
callbacks: Pick<CallbackContext, "decryptJwe" | "verifyJwt">;
|
|
1025
|
+
/**
|
|
1026
|
+
* Compact JARM authorization response (`response` parameter value).
|
|
1027
|
+
*/
|
|
1028
|
+
jarmResponseJwt: string;
|
|
1029
|
+
/**
|
|
1030
|
+
* Current time used for temporal claim validation (`exp`, `nbf`).
|
|
1031
|
+
* Defaults to current date-time when omitted.
|
|
1032
|
+
*/
|
|
1033
|
+
now?: Date;
|
|
1037
1034
|
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Parses and validates a JARM authorization response for OpenID4VP.
|
|
1037
|
+
*
|
|
1038
|
+
* This function validates compact format, decrypts and/or verifies the JARM token,
|
|
1039
|
+
* parses the resulting OpenID4VP authorization response, and validates it against
|
|
1040
|
+
* the originating authorization request.
|
|
1041
|
+
*
|
|
1042
|
+
* @param options {@link ParseJarmAuthorizationResponseOptions}
|
|
1043
|
+
* @returns Parsed authorization response enriched with JARM metadata.
|
|
1044
|
+
*/
|
|
1045
|
+
declare function parseJarmAuthorizationResponse(options: ParseJarmAuthorizationResponseOptions): Promise<ParseAuthorizationResponseResult>;
|
|
1038
1046
|
|
|
1039
1047
|
export { type AuthorizationRequestUrlParams, ClientIdPrefix, type CreateAuthorizationRequestOptions, type CreateAuthorizationRequestOptionsV1_0, type CreateAuthorizationRequestOptionsV1_3, type CreateAuthorizationRequestResult, type CreateAuthorizationRequestResultV1_0, type CreateAuthorizationRequestResultV1_3, CreateAuthorizationResponseError, type CreateAuthorizationResponseOptions, type CreateAuthorizationResponseResult, type EncryptedJarmHeader, type FetchAuthorizationRequestOptions, type FetchAuthorizationRequestResult, FetchAuthorizationResponseError, type FetchAuthorizationResponseOptions, InvalidRequestUriMethodError, type JarOptionsV1_0, type JarOptionsV1_3, type JarmAuthorizationResponse, type JarmAuthorizationResponseEncryptedOnly, type JarmHeader, JarmMode, Oid4vpError, type Openid4vpAuthorizationRequestHeader, type Openid4vpAuthorizationRequestHeaderV1_0, type Openid4vpAuthorizationRequestHeaderV1_3, type Openid4vpAuthorizationRequestPayload, type Openid4vpAuthorizationResponse, type Openid4vpAuthorizationResponseResult, type ParseAuthorizationResponseOptions, type ParseAuthorizationResponseResult, ParseAuthorizeRequestError, type ParseAuthorizeRequestOptions, type ParseJarmAuthorizationResponseOptions, type ParsedAuthorizeRequestResult, type ParsedQrCode, type ValidateOpenid4vpAuthorizationResponseOptions, type ValidateOpenid4vpAuthorizationResponseResult, type VerifyJarmAuthorizationResponseOptions, type VerifyJarmAuthorizationResponseResult, createAuthorizationRequest, createAuthorizationResponse, extractClientIdPrefix, extractEncryptionJwkFromJwks, fetchAuthorizationRequest, fetchAuthorizationResponse, fetchRequestObjectJwt, parseAuthorizationResponse, parseAuthorizeRequest, parseJarmAuthorizationResponse, parseVpToken, validateAuthorizationRequestParams, validateOpenid4vpAuthorizationResponsePayload, verifyJarmAuthorizationResponse, zAuthorizationRequestUrlParams, zEncryptedJarmHeader, zJarmAuthorizationResponse, zJarmAuthorizationResponseEncryptedOnly, zJarmHeader, zOpenid4vpAuthorizationRequestHeaderV1_0, zOpenid4vpAuthorizationRequestHeaderV1_3, zOpenid4vpAuthorizationRequestPayload, zOpenid4vpAuthorizationResponse, zOpenid4vpAuthorizationResponseResult, zVpToken };
|