Skip to content

Commit

Permalink
Merge pull request #108 from wwWallet/verifier-conf-extensions
Browse files Browse the repository at this point in the history
Implement new functions of VerifierConfigurationInterface
  • Loading branch information
kkmanos authored Nov 22, 2024
2 parents 7ad1377 + 7a08da1 commit b157b65
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import { authorizationServerMetadataConfiguration } from "../../authorizationSer
import { config } from "../../../config";
import { VerifierConfigurationInterface } from "../../services/interfaces";
import "reflect-metadata";
import { PresentationParserChain } from "../../vp_token/PresentationParserChain";
import { PublicKeyResolverChain } from "../../vp_token/PublicKeyResolverChain";


const verifiableIdDescriptor = {


const verifiableIdDescriptor = {
"id": "VerifiableId",
"constraints": {
"fields": [
Expand Down Expand Up @@ -116,14 +120,23 @@ const customVerifiableIdSdJwtPresentationDefinition = {
"title": "Custom Verifiable ID",
"description": "Selectable Fields: personalIdentifier, firstName, familyName, birthdate",
"_selectable": true,
"format": { "vc+sd-jwt": { alg: ['ES256'] } },
"format": { "vc+sd-jwt": { alg: ['ES256'] } },
"input_descriptors": [
verifiableIdDescriptor
]
}

@injectable()
export class VerifierConfigurationService implements VerifierConfigurationInterface {


getPublicKeyResolverChain(): PublicKeyResolverChain {
return new PublicKeyResolverChain();
}

getPresentationParserChain(): PresentationParserChain {
return new PresentationParserChain();
}


getPresentationDefinitions(): any[] {
Expand All @@ -133,7 +146,7 @@ export class VerifierConfigurationService implements VerifierConfigurationInterf
"id": "VerifiableId",
"title": "Verifiable ID",
"description": "Required Fields: VC type, Given Name, Family Name & Birthdate",
"format": { "vc+sd-jwt": { alg: [ 'ES256' ] },jwt_vc_json: { alg: [ 'ES256' ] }, jwt_vp: { alg: [ 'ES256' ] } },
"format": { "vc+sd-jwt": { alg: ['ES256'] }, jwt_vc_json: { alg: ['ES256'] }, jwt_vp: { alg: ['ES256'] } },
"input_descriptors": [
verifiableIdDescriptor
]
Expand All @@ -142,7 +155,7 @@ export class VerifierConfigurationService implements VerifierConfigurationInterf
"id": "Bachelor",
"title": "Bachelor Diploma",
"description": "Required Fields: VC type, Grade, EQF Level & Diploma Title",
"format": { "vc+sd-jwt": { alg: [ 'ES256' ] },jwt_vc_json: { alg: [ 'ES256' ] }, jwt_vp: { alg: [ 'ES256' ] } },
"format": { "vc+sd-jwt": { alg: ['ES256'] }, jwt_vc_json: { alg: ['ES256'] }, jwt_vp: { alg: ['ES256'] } },
"input_descriptors": [
bachelorDescriptor
]
Expand All @@ -151,8 +164,18 @@ export class VerifierConfigurationService implements VerifierConfigurationInterf
"id": "EuropeanHealthInsuranceCard",
"title": "European HealthInsurance Card",
"description": "Required Fields: VC type, SSN, Family Name, Given Name & Birth Date",
"format": { "vc+sd-jwt": { alg: [ 'ES256' ] },jwt_vc_json: { alg: [ 'ES256' ] }, jwt_vp: { alg: [ 'ES256' ] } },
"format": { "vc+sd-jwt": { alg: ['ES256'] }, jwt_vc_json: { alg: ['ES256'] }, jwt_vp: { alg: ['ES256'] } },
"input_descriptors": [
europeanHealthInsuranceCardDescriptor
]
},
{
"id": "VIDAndEuropeanHealthInsuranceCard",
"title": "VID + EHIC",
"description": "",
"format": { "vc+sd-jwt": { alg: ['ES256'] }, jwt_vc_json: { alg: ['ES256'] }, jwt_vp: { alg: ['ES256'] } },
"input_descriptors": [
verifiableIdDescriptor,
europeanHealthInsuranceCardDescriptor
]
}
Expand All @@ -172,4 +195,3 @@ export class VerifierConfigurationService implements VerifierConfigurationInterf
}



Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ import { authorizationServerMetadataConfiguration } from "../../authorizationSer
import { config } from "../../../config";
import { VerifierConfigurationInterface } from "../../services/interfaces";
import "reflect-metadata";
import { PresentationParserChain } from "../../vp_token/PresentationParserChain";
import { PublicKeyResolverChain } from "../../vp_token/PublicKeyResolverChain";


@injectable()
export class VerifierConfigurationService implements VerifierConfigurationInterface {
getPublicKeyResolverChain(): PublicKeyResolverChain {
return new PublicKeyResolverChain();
}

getPresentationParserChain(): PresentationParserChain {
return new PresentationParserChain();
}


getPresentationDefinitions(): any[] {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@ import { authorizationServerMetadataConfiguration } from "../../authorizationSer
import { config } from "../../../config";
import { VerifierConfigurationInterface } from "../../services/interfaces";
import "reflect-metadata";
import { PresentationParserChain } from "../../vp_token/PresentationParserChain";
import { PublicKeyResolverChain } from "../../vp_token/PublicKeyResolverChain";

@injectable()
export class VerifierConfigurationService implements VerifierConfigurationInterface {
getPublicKeyResolverChain(): PublicKeyResolverChain {
return new PublicKeyResolverChain();
}

getPresentationParserChain(): PresentationParserChain {
return new PresentationParserChain();
}

getPresentationDefinitions(): any[] {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ import { authorizationServerMetadataConfiguration } from "../../authorizationSer
import { config } from "../../../config";
import { VerifierConfigurationInterface } from "../../services/interfaces";
import "reflect-metadata";

import { PublicKeyResolverChain } from "../../vp_token/PublicKeyResolverChain";
import { PresentationParserChain } from "../../vp_token/PresentationParserChain";


@injectable()
export class VerifierConfigurationService implements VerifierConfigurationInterface {

getPublicKeyResolverChain(): PublicKeyResolverChain {
return new PublicKeyResolverChain();
}

getPresentationParserChain(): PresentationParserChain {
return new PresentationParserChain();
}

getPresentationDefinitions(): any[] {
return []
}
Expand Down

0 comments on commit b157b65

Please sign in to comment.