Skip to content

Commit

Permalink
reversed the order that IPublicKeyResolver(s) and IPresentationParser…
Browse files Browse the repository at this point in the history
…(s) are called to make sure that the VerifierConfigurationService has full control of the first parser or resolver
  • Loading branch information
kkmanos committed Nov 22, 2024
1 parent a159e78 commit 1112a29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vp_token/PresentationParserChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class PresentationParserChain {
}

async parse(rawPresentation: any): Promise<{ credentialImage: string, credentialPayload: any } | { error: "PARSE_ERROR" }> {
for (const p of this.parserList) {
for (const p of [...this.parserList].reverse()) {
const result = await p.parse(rawPresentation);
if ('error' in result) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/vp_token/PublicKeyResolverChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class PublicKeyResolverChain {
}

async resolve(rawPresentation: any, format: string): Promise<{ publicKey: KeyLike, isTrusted: boolean } | { error: "UNABLE_TO_RESOLVE_PUBKEY" }> {
for (const p of this.resolverList) {
for (const p of [...this.resolverList].reverse()) {
const result = await p.resolve(rawPresentation, format);
if ('error' in result) {
continue;
Expand Down

0 comments on commit 1112a29

Please sign in to comment.