@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.34.1-next.91 → 0.36.1-feat.SSISDK.83.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/dist/index.cjs +278 -178
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -10
- package/dist/index.d.ts +17 -10
- package/dist/index.js +271 -171
- package/dist/index.js.map +1 -1
- package/package.json +23 -22
- package/src/agent/DidAuthSiopOpAuthenticator.ts +5 -22
- package/src/machine/Siopv2Machine.ts +1 -1
- package/src/services/Siopv2MachineService.ts +98 -119
- package/src/session/OID4VP.ts +163 -315
- package/src/session/OpSession.ts +4 -20
- package/src/session/functions.ts +1 -8
- package/src/types/IDidAuthSiopOpAuthenticator.ts +1 -1
- package/src/types/machine/index.ts +1 -1
- package/src/types/siop-service/index.ts +11 -7
- package/src/utils/CredentialUtils.ts +1 -1
- package/src/utils/dcql.ts +7 -3
package/dist/index.d.cts
CHANGED
|
@@ -5,10 +5,10 @@ import { DIDDocument } from '@sphereon/did-uni-client';
|
|
|
5
5
|
import { ManagedIdentifierOptsOrResult, IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
6
6
|
import { JwsPayload, IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
7
7
|
import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.credential-store';
|
|
8
|
-
import { ICredentialLocaleBranding, Party, DidAuthConfig, Identity } from '@sphereon/ssi-sdk.data-store';
|
|
8
|
+
import { ICredentialLocaleBranding, Party, DidAuthConfig, Identity } from '@sphereon/ssi-sdk.data-store-types';
|
|
9
9
|
import { IPDManager } from '@sphereon/ssi-sdk.pd-manager';
|
|
10
10
|
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
|
|
11
|
-
import { HasherSync, PresentationSubmission, W3CVerifiablePresentation
|
|
11
|
+
import { HasherSync, WrappedVerifiableCredential, OriginalVerifiableCredential, PresentationSubmission, W3CVerifiablePresentation } from '@sphereon/ssi-types';
|
|
12
12
|
import { VerifyCallback } from '@sphereon/wellknown-dids-client';
|
|
13
13
|
import { EventEmitter } from 'events';
|
|
14
14
|
import { Interpreter, State, StateMachine, BaseActionObject, ServiceMap, ResolveTypegenMeta, TypegenDisabled } from 'xstate';
|
|
@@ -424,6 +424,19 @@ declare function createOP({ opOptions, idOpts, context, }: {
|
|
|
424
424
|
}): Promise<OP>;
|
|
425
425
|
declare function getSigningAlgo(type: TKeyType): SigningAlgo;
|
|
426
426
|
|
|
427
|
+
interface PresentationBuilderContext {
|
|
428
|
+
nonce: string;
|
|
429
|
+
audience: string;
|
|
430
|
+
agent: RequiredContext['agent'];
|
|
431
|
+
clockSkew?: number;
|
|
432
|
+
hasher?: HasherSync;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Creates a Verifiable Presentation for a given credential in the appropriate format
|
|
436
|
+
* Ensures nonce/aud (or challenge/domain) are set according to OID4VP draft 28
|
|
437
|
+
*/
|
|
438
|
+
declare function createVerifiablePresentationForFormat(credential: UniqueDigitalCredential | WrappedVerifiableCredential | OriginalVerifiableCredential, identifier: ManagedIdentifierOptsOrResult, context: PresentationBuilderContext): Promise<string | object>;
|
|
439
|
+
|
|
427
440
|
declare class OpSession {
|
|
428
441
|
readonly ts: number;
|
|
429
442
|
readonly id: string;
|
|
@@ -449,16 +462,10 @@ declare class OpSession {
|
|
|
449
462
|
}): Promise<IIdentifier[]>;
|
|
450
463
|
getSupportedDIDs(): Promise<string[]>;
|
|
451
464
|
getRedirectUri(): Promise<string>;
|
|
452
|
-
getOID4VP(args: IOpSessionGetOID4VPArgs): Promise<OID4VP>;
|
|
453
465
|
private createJarmResponseCallback;
|
|
454
466
|
sendAuthorizationResponse(args: IOpsSendSiopAuthorizationResponseArgs): Promise<Response>;
|
|
455
467
|
}
|
|
456
468
|
|
|
457
|
-
declare class OID4VP {
|
|
458
|
-
private constructor();
|
|
459
|
-
static init(session: OpSession, allIdentifiers: string[], hasher?: HasherSync): Promise<OID4VP>;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
469
|
type ErrorDetails = {
|
|
463
470
|
title: string;
|
|
464
471
|
message: string;
|
|
@@ -533,7 +540,7 @@ type OnContactIdentityCreatedArgs = {
|
|
|
533
540
|
type OnIdentifierCreatedArgs = {
|
|
534
541
|
identifier: IIdentifier;
|
|
535
542
|
};
|
|
536
|
-
type RequiredContext = IAgentContext<IContactManager & IDidAuthSiopOpAuthenticator & IDIDManager & IResolver & IIdentifierResolution & ICredentialStore & IIssuanceBranding>;
|
|
543
|
+
type RequiredContext = IAgentContext<IContactManager & IDidAuthSiopOpAuthenticator & IDIDManager & IResolver & IIdentifierResolution & ICredentialStore & IIssuanceBranding & ISDJwtPlugin>;
|
|
537
544
|
|
|
538
545
|
type Siopv2MachineContext = {
|
|
539
546
|
url: string;
|
|
@@ -1154,4 +1161,4 @@ declare class Siopv2OID4VPLinkHandler extends LinkHandlerAdapter {
|
|
|
1154
1161
|
|
|
1155
1162
|
declare function convertToDcqlCredentials(credential: UniqueDigitalCredential | OriginalVerifiableCredential, hasher?: HasherSync): DcqlCredential;
|
|
1156
1163
|
|
|
1157
|
-
export { type AddIdentityArgs, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateConfigResult, type CreateContactEvent, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOrGetIdentifierOpts, type CreateSiopv2MachineOpts, DEFAULT_JWT_PROOF_TYPE, DID_PREFIX, type DeclineEvent, type DidAgents, DidAuthSiopOpAuthenticator, type DidAuthSiopOpAuthenticatorOptions, type ErrorDetails, type GetAuthenticationKeyArgs, type GetIdentifierArgs, type GetMachineArgs, type GetSelectableCredentialsArgs, type GetSiopRequestArgs, type IAuthRequestDetails, type IDidAuthSiopOpAuthenticator, type IGetSiopSessionArgs, type IOID4VPArgs, type IOPOptions, type IOpSessionArgs, type IOpSessionGetOID4VPArgs, type IOpsSendSiopAuthorizationResponseArgs, type IRegisterCustomApprovalForSiopArgs, type IRemoveCustomApprovalForSiopArgs, type IRemoveSiopSessionArgs, type IRequiredContext, type IdentifierProviderOpts, type IdentifierWithKey, type KeyOpts, LOGGER_NAMESPACE, type NextEvent,
|
|
1164
|
+
export { type AddIdentityArgs, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateConfigResult, type CreateContactEvent, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOrGetIdentifierOpts, type CreateSiopv2MachineOpts, DEFAULT_JWT_PROOF_TYPE, DID_PREFIX, type DeclineEvent, type DidAgents, DidAuthSiopOpAuthenticator, type DidAuthSiopOpAuthenticatorOptions, type ErrorDetails, type GetAuthenticationKeyArgs, type GetIdentifierArgs, type GetMachineArgs, type GetSelectableCredentialsArgs, type GetSiopRequestArgs, type IAuthRequestDetails, type IDidAuthSiopOpAuthenticator, type IGetSiopSessionArgs, type IOID4VPArgs, type IOPOptions, type IOpSessionArgs, type IOpSessionGetOID4VPArgs, type IOpsSendSiopAuthorizationResponseArgs, type IRegisterCustomApprovalForSiopArgs, type IRemoveCustomApprovalForSiopArgs, type IRemoveSiopSessionArgs, type IRequiredContext, type IdentifierProviderOpts, type IdentifierWithKey, type KeyOpts, LOGGER_NAMESPACE, type NextEvent, OID4VPCallbackStateListener, type OnContactIdentityCreatedArgs, type OnIdentifierCreatedArgs, OpSession, type PresentationBuilderContext, type PreviousEvent, type RequiredContext, type RetrieveContactArgs, type SelectCredentialsEvent, type SelectableCredential, type SelectableCredentialsMap, type SendResponseArgs, type Siopv2AuthorizationRequestData, type Siopv2AuthorizationResponseData, Siopv2HolderEvent, Siopv2Machine, Siopv2MachineAddContactStates, type Siopv2MachineContext, type Siopv2MachineEventTypes, Siopv2MachineEvents, Siopv2MachineGuards, type Siopv2MachineInstanceOpts, type Siopv2MachineInterpreter, Siopv2MachineServices, type Siopv2MachineState, Siopv2MachineStates, Siopv2OID4VPLinkHandler, type Siopv2StateMachine, SupportedLanguage, convertToDcqlCredentials, createJwtCallbackWithIdOpts, createJwtCallbackWithOpOpts, createOID4VPPresentationSignCallback, createOP, createOPBuilder, createVerifiablePresentationForFormat, didAuthSiopOpAuthenticatorMethods, getSigningAlgo, plugin_schema as schema };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { DIDDocument } from '@sphereon/did-uni-client';
|
|
|
5
5
|
import { ManagedIdentifierOptsOrResult, IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
6
6
|
import { JwsPayload, IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
7
7
|
import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.credential-store';
|
|
8
|
-
import { ICredentialLocaleBranding, Party, DidAuthConfig, Identity } from '@sphereon/ssi-sdk.data-store';
|
|
8
|
+
import { ICredentialLocaleBranding, Party, DidAuthConfig, Identity } from '@sphereon/ssi-sdk.data-store-types';
|
|
9
9
|
import { IPDManager } from '@sphereon/ssi-sdk.pd-manager';
|
|
10
10
|
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
|
|
11
|
-
import { HasherSync, PresentationSubmission, W3CVerifiablePresentation
|
|
11
|
+
import { HasherSync, WrappedVerifiableCredential, OriginalVerifiableCredential, PresentationSubmission, W3CVerifiablePresentation } from '@sphereon/ssi-types';
|
|
12
12
|
import { VerifyCallback } from '@sphereon/wellknown-dids-client';
|
|
13
13
|
import { EventEmitter } from 'events';
|
|
14
14
|
import { Interpreter, State, StateMachine, BaseActionObject, ServiceMap, ResolveTypegenMeta, TypegenDisabled } from 'xstate';
|
|
@@ -424,6 +424,19 @@ declare function createOP({ opOptions, idOpts, context, }: {
|
|
|
424
424
|
}): Promise<OP>;
|
|
425
425
|
declare function getSigningAlgo(type: TKeyType): SigningAlgo;
|
|
426
426
|
|
|
427
|
+
interface PresentationBuilderContext {
|
|
428
|
+
nonce: string;
|
|
429
|
+
audience: string;
|
|
430
|
+
agent: RequiredContext['agent'];
|
|
431
|
+
clockSkew?: number;
|
|
432
|
+
hasher?: HasherSync;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Creates a Verifiable Presentation for a given credential in the appropriate format
|
|
436
|
+
* Ensures nonce/aud (or challenge/domain) are set according to OID4VP draft 28
|
|
437
|
+
*/
|
|
438
|
+
declare function createVerifiablePresentationForFormat(credential: UniqueDigitalCredential | WrappedVerifiableCredential | OriginalVerifiableCredential, identifier: ManagedIdentifierOptsOrResult, context: PresentationBuilderContext): Promise<string | object>;
|
|
439
|
+
|
|
427
440
|
declare class OpSession {
|
|
428
441
|
readonly ts: number;
|
|
429
442
|
readonly id: string;
|
|
@@ -449,16 +462,10 @@ declare class OpSession {
|
|
|
449
462
|
}): Promise<IIdentifier[]>;
|
|
450
463
|
getSupportedDIDs(): Promise<string[]>;
|
|
451
464
|
getRedirectUri(): Promise<string>;
|
|
452
|
-
getOID4VP(args: IOpSessionGetOID4VPArgs): Promise<OID4VP>;
|
|
453
465
|
private createJarmResponseCallback;
|
|
454
466
|
sendAuthorizationResponse(args: IOpsSendSiopAuthorizationResponseArgs): Promise<Response>;
|
|
455
467
|
}
|
|
456
468
|
|
|
457
|
-
declare class OID4VP {
|
|
458
|
-
private constructor();
|
|
459
|
-
static init(session: OpSession, allIdentifiers: string[], hasher?: HasherSync): Promise<OID4VP>;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
469
|
type ErrorDetails = {
|
|
463
470
|
title: string;
|
|
464
471
|
message: string;
|
|
@@ -533,7 +540,7 @@ type OnContactIdentityCreatedArgs = {
|
|
|
533
540
|
type OnIdentifierCreatedArgs = {
|
|
534
541
|
identifier: IIdentifier;
|
|
535
542
|
};
|
|
536
|
-
type RequiredContext = IAgentContext<IContactManager & IDidAuthSiopOpAuthenticator & IDIDManager & IResolver & IIdentifierResolution & ICredentialStore & IIssuanceBranding>;
|
|
543
|
+
type RequiredContext = IAgentContext<IContactManager & IDidAuthSiopOpAuthenticator & IDIDManager & IResolver & IIdentifierResolution & ICredentialStore & IIssuanceBranding & ISDJwtPlugin>;
|
|
537
544
|
|
|
538
545
|
type Siopv2MachineContext = {
|
|
539
546
|
url: string;
|
|
@@ -1154,4 +1161,4 @@ declare class Siopv2OID4VPLinkHandler extends LinkHandlerAdapter {
|
|
|
1154
1161
|
|
|
1155
1162
|
declare function convertToDcqlCredentials(credential: UniqueDigitalCredential | OriginalVerifiableCredential, hasher?: HasherSync): DcqlCredential;
|
|
1156
1163
|
|
|
1157
|
-
export { type AddIdentityArgs, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateConfigResult, type CreateContactEvent, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOrGetIdentifierOpts, type CreateSiopv2MachineOpts, DEFAULT_JWT_PROOF_TYPE, DID_PREFIX, type DeclineEvent, type DidAgents, DidAuthSiopOpAuthenticator, type DidAuthSiopOpAuthenticatorOptions, type ErrorDetails, type GetAuthenticationKeyArgs, type GetIdentifierArgs, type GetMachineArgs, type GetSelectableCredentialsArgs, type GetSiopRequestArgs, type IAuthRequestDetails, type IDidAuthSiopOpAuthenticator, type IGetSiopSessionArgs, type IOID4VPArgs, type IOPOptions, type IOpSessionArgs, type IOpSessionGetOID4VPArgs, type IOpsSendSiopAuthorizationResponseArgs, type IRegisterCustomApprovalForSiopArgs, type IRemoveCustomApprovalForSiopArgs, type IRemoveSiopSessionArgs, type IRequiredContext, type IdentifierProviderOpts, type IdentifierWithKey, type KeyOpts, LOGGER_NAMESPACE, type NextEvent,
|
|
1164
|
+
export { type AddIdentityArgs, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateConfigResult, type CreateContactEvent, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOrGetIdentifierOpts, type CreateSiopv2MachineOpts, DEFAULT_JWT_PROOF_TYPE, DID_PREFIX, type DeclineEvent, type DidAgents, DidAuthSiopOpAuthenticator, type DidAuthSiopOpAuthenticatorOptions, type ErrorDetails, type GetAuthenticationKeyArgs, type GetIdentifierArgs, type GetMachineArgs, type GetSelectableCredentialsArgs, type GetSiopRequestArgs, type IAuthRequestDetails, type IDidAuthSiopOpAuthenticator, type IGetSiopSessionArgs, type IOID4VPArgs, type IOPOptions, type IOpSessionArgs, type IOpSessionGetOID4VPArgs, type IOpsSendSiopAuthorizationResponseArgs, type IRegisterCustomApprovalForSiopArgs, type IRemoveCustomApprovalForSiopArgs, type IRemoveSiopSessionArgs, type IRequiredContext, type IdentifierProviderOpts, type IdentifierWithKey, type KeyOpts, LOGGER_NAMESPACE, type NextEvent, OID4VPCallbackStateListener, type OnContactIdentityCreatedArgs, type OnIdentifierCreatedArgs, OpSession, type PresentationBuilderContext, type PreviousEvent, type RequiredContext, type RetrieveContactArgs, type SelectCredentialsEvent, type SelectableCredential, type SelectableCredentialsMap, type SendResponseArgs, type Siopv2AuthorizationRequestData, type Siopv2AuthorizationResponseData, Siopv2HolderEvent, Siopv2Machine, Siopv2MachineAddContactStates, type Siopv2MachineContext, type Siopv2MachineEventTypes, Siopv2MachineEvents, Siopv2MachineGuards, type Siopv2MachineInstanceOpts, type Siopv2MachineInterpreter, Siopv2MachineServices, type Siopv2MachineState, Siopv2MachineStates, Siopv2OID4VPLinkHandler, type Siopv2StateMachine, SupportedLanguage, convertToDcqlCredentials, createJwtCallbackWithIdOpts, createJwtCallbackWithOpOpts, createOID4VPPresentationSignCallback, createOP, createOPBuilder, createVerifiablePresentationForFormat, didAuthSiopOpAuthenticatorMethods, getSigningAlgo, plugin_schema as schema };
|