@credo-ts/openid4vc 0.6.0-pr-2195-20250322195244 → 0.6.0-pr-2324-20250625125220
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/build/openid4vc-holder/OpenId4VcHolderApi.d.ts +10 -6
- package/build/openid4vc-holder/OpenId4VcHolderApi.js +2 -4
- package/build/openid4vc-holder/OpenId4VcHolderApi.js.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.d.ts +14 -19
- package/build/openid4vc-holder/OpenId4VciHolderService.js +425 -203
- package/build/openid4vc-holder/OpenId4VciHolderService.js.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts +117 -37
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js +1 -0
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js.map +1 -1
- package/build/openid4vc-holder/OpenId4vpHolderService.js +24 -15
- package/build/openid4vc-holder/OpenId4vpHolderService.js.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +21 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js +11 -0
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +7 -3
- package/build/openid4vc-issuer/OpenId4VcIssuerService.js +387 -167
- package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +67 -27
- package/build/openid4vc-issuer/index.d.ts +1 -1
- package/build/openid4vc-issuer/index.js +2 -1
- package/build/openid4vc-issuer/index.js.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +29 -5
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +2 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts +12 -7
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js +15 -3
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js.map +1 -1
- package/build/openid4vc-issuer/router/accessTokenEndpoint.js +41 -13
- package/build/openid4vc-issuer/router/accessTokenEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js +102 -33
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/credentialEndpoint.js +42 -10
- package/build/openid4vc-issuer/router/credentialEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/jwksEndpoint.js +2 -2
- package/build/openid4vc-issuer/router/jwksEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/util/txCode.d.ts +1 -1
- package/build/openid4vc-issuer/util/txCode.js +3 -1
- package/build/openid4vc-issuer/util/txCode.js.map +1 -1
- package/build/openid4vc-verifier/OpenId4VpVerifierService.d.ts +1 -1
- package/build/openid4vc-verifier/OpenId4VpVerifierService.js +70 -65
- package/build/openid4vc-verifier/OpenId4VpVerifierService.js.map +1 -1
- package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.ts +7 -1
- package/build/shared/callbacks.d.ts +6 -4
- package/build/shared/callbacks.js +212 -69
- package/build/shared/callbacks.js.map +1 -1
- package/build/shared/models/CredentialHolderBinding.d.ts +65 -11
- package/build/shared/models/OpenId4VcJwtIssuer.d.ts +10 -5
- package/build/shared/models/OpenId4VciCredentialFormatProfile.d.ts +1 -0
- package/build/shared/models/OpenId4VciCredentialFormatProfile.js +1 -0
- package/build/shared/models/OpenId4VciCredentialFormatProfile.js.map +1 -1
- package/build/shared/router/tenants.js +2 -2
- package/build/shared/router/tenants.js.map +1 -1
- package/build/shared/utils.d.ts +4 -9
- package/build/shared/utils.js +27 -44
- package/build/shared/utils.js.map +1 -1
- package/package.json +14 -14
|
@@ -182,15 +182,13 @@ export declare class OpenId4VcHolderApi {
|
|
|
182
182
|
* It will generate an authorization session based on the provided options.
|
|
183
183
|
*
|
|
184
184
|
* There are two possible flows:
|
|
185
|
-
* -
|
|
185
|
+
* - Oauth2Redirect: an authorization request URI is returend which can be used to obtain the authorization code.
|
|
186
186
|
* This needs to be done manually (e.g. by opening a browser window)
|
|
187
187
|
* - PresentationDuringIssuance: an openid4vp presentation request needs to be handled. A oid4vpRequestUri is returned
|
|
188
188
|
* which can be parsed using `resolveOpenId4VpAuthorizationRequest`. After the presentation session has been completed,
|
|
189
189
|
* the resulting `presentationDuringIssuanceSession` can be used to obtain an authorization code
|
|
190
190
|
*
|
|
191
|
-
* Authorization to request credentials can be requested
|
|
192
|
-
* This function automatically generates the authorization_details for all offered credentials.
|
|
193
|
-
* If scopes are provided, the provided scopes are sent alongside the authorization_details.
|
|
191
|
+
* Authorization to request credentials can only be requested through scopes.
|
|
194
192
|
*
|
|
195
193
|
* @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer
|
|
196
194
|
* @param authCodeFlowOptions
|
|
@@ -204,6 +202,12 @@ export declare class OpenId4VcHolderApi {
|
|
|
204
202
|
*/
|
|
205
203
|
retrieveAuthorizationCodeUsingPresentation(options: OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions): Promise<{
|
|
206
204
|
authorizationCode: string;
|
|
205
|
+
dpop: {
|
|
206
|
+
alg: import("@credo-ts/core/src/modules/kms").KnownJwaSignatureAlgorithm;
|
|
207
|
+
jwk: import("@credo-ts/core/src/modules/kms").PublicJwk<import("@credo-ts/core/src/modules/kms/jwk/PublicJwk").SupportedPublicJwk>;
|
|
208
|
+
nonce?: string | undefined;
|
|
209
|
+
signer?: import("@openid4vc/oauth2").JwtSignerJwk | undefined;
|
|
210
|
+
} | undefined;
|
|
207
211
|
}>;
|
|
208
212
|
/**
|
|
209
213
|
* Requests the token to be used for credential requests.
|
|
@@ -217,8 +221,8 @@ export declare class OpenId4VcHolderApi {
|
|
|
217
221
|
credentials: import("./OpenId4VciHolderServiceOptions").OpenId4VciCredentialResponse[];
|
|
218
222
|
dpop: {
|
|
219
223
|
nonce: string | undefined;
|
|
220
|
-
jwk: import("@credo-ts/core").
|
|
221
|
-
alg: import("@credo-ts/core").
|
|
224
|
+
jwk: import("@credo-ts/core/src/modules/kms").PublicJwk;
|
|
225
|
+
alg: import("@credo-ts/core/src/modules/kms").KnownJwaSignatureAlgorithm;
|
|
222
226
|
} | undefined;
|
|
223
227
|
cNonce: string | undefined;
|
|
224
228
|
}>;
|
|
@@ -93,15 +93,13 @@ let OpenId4VcHolderApi = class OpenId4VcHolderApi {
|
|
|
93
93
|
* It will generate an authorization session based on the provided options.
|
|
94
94
|
*
|
|
95
95
|
* There are two possible flows:
|
|
96
|
-
* -
|
|
96
|
+
* - Oauth2Redirect: an authorization request URI is returend which can be used to obtain the authorization code.
|
|
97
97
|
* This needs to be done manually (e.g. by opening a browser window)
|
|
98
98
|
* - PresentationDuringIssuance: an openid4vp presentation request needs to be handled. A oid4vpRequestUri is returned
|
|
99
99
|
* which can be parsed using `resolveOpenId4VpAuthorizationRequest`. After the presentation session has been completed,
|
|
100
100
|
* the resulting `presentationDuringIssuanceSession` can be used to obtain an authorization code
|
|
101
101
|
*
|
|
102
|
-
* Authorization to request credentials can be requested
|
|
103
|
-
* This function automatically generates the authorization_details for all offered credentials.
|
|
104
|
-
* If scopes are provided, the provided scopes are sent alongside the authorization_details.
|
|
102
|
+
* Authorization to request credentials can only be requested through scopes.
|
|
105
103
|
*
|
|
106
104
|
* @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer
|
|
107
105
|
* @param authCodeFlowOptions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VcHolderApi.js","sourceRoot":"","sources":["../../src/openid4vc-holder/OpenId4VcHolderApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,yCAOuB;AAIvB,uEAAmE;AACnE,qEAAiE;AAEjE;;GAEG;AAEI,IAAM,kBAAkB,GAAxB,MAA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W;YACX,MAAM;YACN,IAAI;YACJ,QAAQ;SACT,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,gBAAgB,CAAC,OAA0C;QACtE,OAAO,IAAI,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IAClF,CAAC;CACF,CAAA;AAjKY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,iBAAU,GAAE;qCAGa,mBAAY;QACD,iDAAuB;QACxB,+CAAsB;QACd,qCAA8B;QACjD,kBAAW;GANvB,kBAAkB,CAiK9B"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AgentContext } from '@credo-ts/core';
|
|
2
|
+
import { Kms, Logger, W3cCredentialService } from '@credo-ts/core';
|
|
2
3
|
import type { OpenId4VciMetadata } from '../shared';
|
|
3
|
-
import type { OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAuthCodeFlowOptions, OpenId4VciCredentialResponse, OpenId4VciDpopRequestOptions,
|
|
4
|
-
import { Jwk, Logger, W3cCredentialService } from '@credo-ts/core';
|
|
5
|
-
import { IssuerMetadataResult } from '@openid4vc/openid4vci';
|
|
4
|
+
import type { OpenId4VciAcceptCredentialOfferOptions, OpenId4VciAuthCodeFlowOptions, OpenId4VciCredentialResponse, OpenId4VciDpopRequestOptions, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions, OpenId4VciSendNotificationOptions, OpenId4VciTokenRequestOptions } from './OpenId4VciHolderServiceOptions';
|
|
6
5
|
export declare class OpenId4VciHolderService {
|
|
7
6
|
private logger;
|
|
8
7
|
private w3cCredentialService;
|
|
@@ -10,25 +9,21 @@ export declare class OpenId4VciHolderService {
|
|
|
10
9
|
resolveIssuerMetadata(agentContext: AgentContext, credentialIssuer: string): Promise<OpenId4VciMetadata>;
|
|
11
10
|
resolveCredentialOffer(agentContext: AgentContext, credentialOffer: string): Promise<OpenId4VciResolvedCredentialOffer>;
|
|
12
11
|
resolveAuthorizationRequest(agentContext: AgentContext, resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, authCodeFlowOptions: OpenId4VciAuthCodeFlowOptions): Promise<OpenId4VciResolvedAuthorizationRequest>;
|
|
13
|
-
sendNotification(agentContext: AgentContext, options:
|
|
14
|
-
metadata: IssuerMetadataResult;
|
|
15
|
-
notificationId: string;
|
|
16
|
-
notificationEvent: OpenId4VciNotificationEvent;
|
|
17
|
-
accessToken: string;
|
|
18
|
-
dpop?: {
|
|
19
|
-
jwk: Jwk;
|
|
20
|
-
alg: JwaSignatureAlgorithm;
|
|
21
|
-
nonce?: string;
|
|
22
|
-
};
|
|
23
|
-
}): Promise<void>;
|
|
12
|
+
sendNotification(agentContext: AgentContext, options: OpenId4VciSendNotificationOptions): Promise<void>;
|
|
24
13
|
private getDpopOptions;
|
|
25
14
|
retrieveAuthorizationCodeUsingPresentation(agentContext: AgentContext, options: OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions): Promise<{
|
|
26
15
|
authorizationCode: string;
|
|
16
|
+
dpop: {
|
|
17
|
+
alg: Kms.KnownJwaSignatureAlgorithm;
|
|
18
|
+
jwk: Kms.PublicJwk<import("@credo-ts/core/src/modules/kms/jwk/PublicJwk").SupportedPublicJwk>;
|
|
19
|
+
nonce?: string | undefined;
|
|
20
|
+
signer?: import("@openid4vc/oauth2").JwtSignerJwk | undefined;
|
|
21
|
+
} | undefined;
|
|
27
22
|
}>;
|
|
28
23
|
requestAccessToken(agentContext: AgentContext, options: OpenId4VciTokenRequestOptions): Promise<{
|
|
29
24
|
dpop: {
|
|
30
|
-
alg:
|
|
31
|
-
jwk:
|
|
25
|
+
alg: Kms.KnownJwaSignatureAlgorithm;
|
|
26
|
+
jwk: Kms.PublicJwk<import("@credo-ts/core/src/modules/kms/jwk/PublicJwk").SupportedPublicJwk>;
|
|
32
27
|
nonce?: string;
|
|
33
28
|
signer?: import("@openid4vc/oauth2").JwtSignerJwk | undefined;
|
|
34
29
|
} | undefined;
|
|
@@ -46,8 +41,8 @@ export declare class OpenId4VciHolderService {
|
|
|
46
41
|
credentials: OpenId4VciCredentialResponse[];
|
|
47
42
|
dpop: {
|
|
48
43
|
nonce: string | undefined;
|
|
49
|
-
jwk:
|
|
50
|
-
alg:
|
|
44
|
+
jwk: Kms.PublicJwk;
|
|
45
|
+
alg: Kms.KnownJwaSignatureAlgorithm;
|
|
51
46
|
} | undefined;
|
|
52
47
|
cNonce: string | undefined;
|
|
53
48
|
}>;
|