@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth 0.33.1-next.3 → 0.33.1-next.73

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.ts CHANGED
@@ -1,8 +1,218 @@
1
+ import { IPluginMethodMap, IAgentContext, IResolver, IDIDManager, IKeyManager, ICredentialIssuer, ICredentialVerifier, IAgentPlugin } from '@veramo/core';
2
+ import { ResponseURIType, ClaimPayloadCommonOpts, AuthorizationRequestPayload, RequestObjectPayload, AuthorizationRequestState, AuthorizationResponseState, AuthorizationResponsePayload, PresentationDefinitionWithLocation, VerifiedAuthorizationResponse, ResponseMode, SupportedVersion, IRPSessionManager, ClientMetadataOpts, VerifyJwtCallback, PresentationVerificationCallback, VPTokenLocation, VerifiablePresentationTypeFormat, RP, URI, AuthorizationRequest } from '@sphereon/did-auth-siop';
3
+ import { IIdentifierResolution, ManagedIdentifierOptsOrResult, ExternalIdentifierOIDFEntityIdOpts } from '@sphereon/ssi-sdk-ext.identifier-resolution';
4
+ import { AdditionalClaims, DcqlQueryREST, HasherSync, W3CVerifiablePresentation } from '@sphereon/ssi-types';
5
+ import { Resolvable } from 'did-resolver';
6
+ import { DIDDocument } from '@sphereon/did-uni-client';
7
+ import { EventEmitter } from 'events';
8
+ import { IPresentationDefinition } from '@sphereon/pex';
9
+ import { IDIDOptions } from '@sphereon/ssi-sdk-ext.did-utils';
10
+ import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange';
11
+ import { VerifyCallback } from '@sphereon/wellknown-dids-client';
12
+ import { AuthorizationRequestStateStatus } from '@sphereon/ssi-sdk.siopv2-oid4vp-common';
13
+ import { IPDManager, VersionControlMode } from '@sphereon/ssi-sdk.pd-manager';
14
+ import { CheckLinkedDomain } from '@sphereon/did-auth-siop-adapter';
15
+ import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
16
+ import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
17
+ import { JwtIssuer } from '@sphereon/oid4vc-common';
18
+ import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
19
+ import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation';
20
+
21
+ declare enum VerifiedDataMode {
22
+ NONE = "none",
23
+ VERIFIED_PRESENTATION = "vp",
24
+ CREDENTIAL_SUBJECT_FLATTENED = "cs-flat"
25
+ }
26
+ interface ISIOPv2RP extends IPluginMethodMap {
27
+ siopCreateAuthRequestURI(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<string>;
28
+ siopCreateAuthRequestPayloads(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<IAuthorizationRequestPayloads>;
29
+ siopGetAuthRequestState(args: IGetAuthRequestStateArgs, context: IRequiredContext): Promise<AuthorizationRequestState | undefined>;
30
+ siopGetAuthResponseState(args: IGetAuthResponseStateArgs, context: IRequiredContext): Promise<AuthorizationResponseStateWithVerifiedData | undefined>;
31
+ siopUpdateAuthRequestState(args: IUpdateRequestStateArgs, context: IRequiredContext): Promise<AuthorizationRequestState>;
32
+ siopDeleteAuthState(args: IDeleteAuthStateArgs, context: IRequiredContext): Promise<boolean>;
33
+ siopVerifyAuthResponse(args: IVerifyAuthResponseStateArgs, context: IRequiredContext): Promise<VerifiedAuthorizationResponse>;
34
+ siopImportDefinitions(args: ImportDefinitionsArgs, context: IRequiredContext): Promise<void>;
35
+ siopGetRedirectURI(args: IGetRedirectUriArgs, context: IRequiredContext): Promise<string | undefined>;
36
+ }
37
+ interface ISiopv2RPOpts {
38
+ defaultOpts?: IRPDefaultOpts;
39
+ instanceOpts?: IPEXInstanceOptions[];
40
+ }
41
+ interface IRPDefaultOpts extends IRPOptions {
42
+ }
43
+ interface ICreateAuthRequestArgs {
44
+ definitionId: string;
45
+ correlationId: string;
46
+ responseURIType: ResponseURIType;
47
+ responseURI: string;
48
+ responseRedirectURI?: string;
49
+ jwtIssuer?: JwtIssuer;
50
+ requestByReferenceURI?: string;
51
+ nonce?: string;
52
+ state?: string;
53
+ claims?: ClaimPayloadCommonOpts;
54
+ }
55
+ interface IGetAuthRequestStateArgs {
56
+ correlationId: string;
57
+ definitionId: string;
58
+ errorOnNotFound?: boolean;
59
+ }
60
+ interface IGetAuthResponseStateArgs {
61
+ correlationId: string;
62
+ definitionId: string;
63
+ errorOnNotFound?: boolean;
64
+ progressRequestStateTo?: AuthorizationRequestStateStatus;
65
+ includeVerifiedData?: VerifiedDataMode;
66
+ }
67
+ interface IUpdateRequestStateArgs {
68
+ definitionId: string;
69
+ correlationId: string;
70
+ state: AuthorizationRequestStateStatus;
71
+ error?: string;
72
+ }
73
+ interface IDeleteAuthStateArgs {
74
+ correlationId: string;
75
+ definitionId: string;
76
+ }
77
+ interface IVerifyAuthResponseStateArgs {
78
+ authorizationResponse: string | AuthorizationResponsePayload;
79
+ definitionId?: string;
80
+ correlationId: string;
81
+ audience?: string;
82
+ presentationDefinitions?: PresentationDefinitionWithLocation | PresentationDefinitionWithLocation[];
83
+ dcqlQuery?: DcqlQueryREST;
84
+ }
85
+ interface IDefinitionPair {
86
+ definitionPayload: IPresentationDefinition;
87
+ dcqlPayload?: DcqlQueryREST;
88
+ }
89
+ interface ImportDefinitionsArgs {
90
+ definitions: Array<IDefinitionPair>;
91
+ tenantId?: string;
92
+ version?: string;
93
+ versionControlMode?: VersionControlMode;
94
+ }
95
+ interface IGetRedirectUriArgs {
96
+ correlationId: string;
97
+ definitionId?: string;
98
+ state?: string;
99
+ }
100
+ interface IAuthorizationRequestPayloads {
101
+ authorizationRequest: AuthorizationRequestPayload;
102
+ requestObject?: string;
103
+ requestObjectDecoded?: RequestObjectPayload;
104
+ }
105
+ interface IPEXDefinitionPersistArgs extends IPEXInstanceOptions {
106
+ definition: IPresentationDefinition;
107
+ ttl?: number;
108
+ }
109
+ interface ISiopRPInstanceArgs {
110
+ definitionId?: string;
111
+ responseRedirectURI?: string;
112
+ }
113
+ interface IPEXInstanceOptions extends IPEXOptions {
114
+ rpOpts?: IRPOptions;
115
+ }
116
+ interface IRPOptions {
117
+ responseMode?: ResponseMode;
118
+ supportedVersions?: SupportedVersion[];
119
+ sessionManager?: IRPSessionManager;
120
+ clientMetadataOpts?: ClientMetadataOpts;
121
+ expiresIn?: number;
122
+ eventEmitter?: EventEmitter;
123
+ credentialOpts?: CredentialOpts;
124
+ verificationPolicies?: VerificationPolicies;
125
+ identifierOpts: ISIOPIdentifierOptions;
126
+ verifyJwtCallback?: VerifyJwtCallback;
127
+ responseRedirectUri?: string;
128
+ }
129
+ interface IPEXOptions {
130
+ presentationVerifyCallback?: PresentationVerificationCallback;
131
+ definitionId: string;
132
+ version?: string;
133
+ tenantId?: string;
134
+ }
135
+ type VerificationPolicies = {
136
+ schemaValidation: SchemaValidation;
137
+ };
138
+ interface PerDidResolver {
139
+ didMethod: string;
140
+ resolver: Resolvable;
141
+ }
142
+ interface IAuthRequestDetails {
143
+ rpDIDDocument?: DIDDocument;
144
+ id: string;
145
+ verifiablePresentationMatches: IPresentationWithDefinition[];
146
+ alsoKnownAs?: string[];
147
+ }
148
+ interface IPresentationWithDefinition {
149
+ location: VPTokenLocation;
150
+ definition: PresentationDefinitionWithLocation;
151
+ format: VerifiablePresentationTypeFormat;
152
+ presentation: W3CVerifiablePresentation;
153
+ }
154
+ interface ISIOPIdentifierOptions extends Omit<IDIDOptions, 'idOpts'> {
155
+ idOpts: ManagedIdentifierOptsOrResult;
156
+ oidfOpts?: ExternalIdentifierOIDFEntityIdOpts;
157
+ checkLinkedDomains?: CheckLinkedDomain;
158
+ wellknownDIDVerifyCallback?: VerifyCallback;
159
+ }
160
+ type CredentialOpts = {
161
+ hasher?: HasherSync;
162
+ };
163
+ interface AuthorizationResponseStateWithVerifiedData extends AuthorizationResponseState {
164
+ verifiedData?: AdditionalClaims;
165
+ }
166
+ type IRequiredContext = IAgentContext<IResolver & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialValidation & ICredentialVerifier & IPresentationExchange & IPDManager & ISDJwtPlugin & IJwtService & ImDLMdoc>;
167
+
168
+ declare class RPInstance {
169
+ private _rp;
170
+ private readonly _pexOptions;
171
+ private readonly _rpOptions;
172
+ constructor({ rpOpts, pexOpts }: {
173
+ rpOpts: IRPOptions;
174
+ pexOpts?: IPEXOptions;
175
+ });
176
+ get(context: IRequiredContext): Promise<RP>;
177
+ get rpOptions(): IRPOptions;
178
+ get pexOptions(): IPEXOptions | undefined;
179
+ hasDefinition(): boolean;
180
+ get definitionId(): string | undefined;
181
+ getPresentationDefinition(context: IRequiredContext): Promise<IPresentationDefinition | undefined>;
182
+ createAuthorizationRequestURI(createArgs: Omit<ICreateAuthRequestArgs, 'definitionId'>, context: IRequiredContext): Promise<URI>;
183
+ createAuthorizationRequest(createArgs: Omit<ICreateAuthRequestArgs, 'definitionId'>, context: IRequiredContext): Promise<AuthorizationRequest>;
184
+ }
185
+
186
+ declare class SIOPv2RP implements IAgentPlugin {
187
+ private readonly opts;
188
+ private static readonly _DEFAULT_OPTS_KEY;
189
+ private readonly instances;
190
+ readonly schema: any;
191
+ readonly methods: ISIOPv2RP;
192
+ constructor(opts: ISiopv2RPOpts);
193
+ setDefaultOpts(rpDefaultOpts: IRPDefaultOpts, context: IRequiredContext): void;
194
+ private createAuthorizationRequestURI;
195
+ private createAuthorizationRequestPayloads;
196
+ private siopGetRequestState;
197
+ private siopGetResponseState;
198
+ private presentationOrClaimsFrom;
199
+ private siopUpdateRequestState;
200
+ private siopDeleteState;
201
+ private siopVerifyAuthResponse;
202
+ private siopImportDefinitions;
203
+ private siopGetRedirectURI;
204
+ getRPInstance({ definitionId, responseRedirectURI }: ISiopRPInstanceArgs, context: IRequiredContext): Promise<RPInstance>;
205
+ getRPOptions(context: IRequiredContext, opts: {
206
+ definitionId?: string;
207
+ responseRedirectURI?: string;
208
+ }): Promise<IRPOptions>;
209
+ getInstanceOpts(definitionId?: string): IPEXInstanceOptions | undefined;
210
+ private getDefaultOptions;
211
+ }
212
+
1
213
  /**
2
214
  * @public
3
215
  */
4
216
  declare const schema: any;
5
- export { schema };
6
- export { SIOPv2RP } from './agent/SIOPv2RP';
7
- export * from './types/ISIOPv2RP';
8
- //# sourceMappingURL=index.d.ts.map
217
+
218
+ export { type AuthorizationResponseStateWithVerifiedData, type CredentialOpts, type IAuthRequestDetails, type IAuthorizationRequestPayloads, type ICreateAuthRequestArgs, type IDefinitionPair, type IDeleteAuthStateArgs, type IGetAuthRequestStateArgs, type IGetAuthResponseStateArgs, type IGetRedirectUriArgs, type IPEXDefinitionPersistArgs, type IPEXInstanceOptions, type IPEXOptions, type IPresentationWithDefinition, type IRPDefaultOpts, type IRPOptions, type IRequiredContext, type ISIOPIdentifierOptions, type ISIOPv2RP, type ISiopRPInstanceArgs, type ISiopv2RPOpts, type IUpdateRequestStateArgs, type IVerifyAuthResponseStateArgs, type ImportDefinitionsArgs, type PerDidResolver, SIOPv2RP, type VerificationPolicies, VerifiedDataMode, schema };