Skip to content

Commit

Permalink
feat: allow did opts from default options to be populated in instance…
Browse files Browse the repository at this point in the history
… options
  • Loading branch information
nklomp committed Jun 23, 2023
1 parent bf871da commit 41deb99
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/siopv2-oid4vp-rp-auth/src/agent/SIOPv2RP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,25 @@ export class SIOPv2RP implements IAgentPlugin {
if (!options) {
throw Error(`Could not get specific nor default options for definition ${definitionId}`)
}
if (this.opts.defaultOpts) {
if (!options.didOpts) {
options.didOpts = this.opts.defaultOpts?.didOpts
} else {
if (!options.didOpts.identifierOpts) {
options.didOpts.identifierOpts = this.opts.defaultOpts.didOpts.identifierOpts
}
if (!options.didOpts.resolveOpts) {
options.didOpts.resolveOpts = this.opts.defaultOpts.didOpts.resolveOpts
}
if (!options.didOpts.supportedDIDMethods) {
options.didOpts.supportedDIDMethods = this.opts.defaultOpts.didOpts.supportedDIDMethods
}
if (!options.supportedVersions) {
options.supportedVersions = this.opts.defaultOpts.supportedVersions
}
}
}

return options
}

Expand Down

0 comments on commit 41deb99

Please sign in to comment.