@@ -105,6 +105,41 @@ const verifyDidJWT = async(jwt: string, resolver: Resolvable, options: JWTVerify
105
105
const resolver = getResolver ( 'ethr' ) ;
106
106
107
107
export const rp = ( type :string , id :string ) => {
108
+ let constraints = { } ;
109
+ if ( type === 'NPI' ) {
110
+ constraints = {
111
+ "fields" : [
112
+ {
113
+ "path" : [
114
+ "$.vc.credentialSubject.npi" ,
115
+ "$.vc.credentialSubject.name" ,
116
+ "$.vc.credentialSubject.description" ,
117
+ "$.vc.credentialSubject.gender" ,
118
+ "$.vc.credentialSubject.city" ,
119
+ "$.vc.credentialSubject.state" ,
120
+ "$.vc.credentialSubject.zip" ,
121
+ "$.vc.credentialSubject.credentials" ,
122
+ "$.vc.credentialSubject.specialty" ,
123
+ "$.vc.credentialSubject.medicalSchools" ,
124
+ "$.vc.credentialSubject.residencies" ,
125
+ "$.vc.credentialSubject.profilePhoto" ,
126
+ ]
127
+ }
128
+ ]
129
+ }
130
+ } else {
131
+ constraints = {
132
+ "fields" : [
133
+ {
134
+ "path" : [
135
+ "$.vc.credentialSubject.name" ,
136
+ "$.vc.credentialSubject.email" ,
137
+ "$.vc.credentialSubject.dob"
138
+ ]
139
+ }
140
+ ]
141
+ }
142
+ }
108
143
return RP . builder ( )
109
144
// return RP.builder({ requestVersion: SupportedVersion.SIOPv2_ID1 })
110
145
. withClientId ( identifier . did )
@@ -126,6 +161,7 @@ export const rp = (type:string, id:string) => {
126
161
"id" : "1" ,
127
162
"name" : type + " Verifiable Credential" ,
128
163
"purpose" : "We want a VC of this type to proof provider claim" ,
164
+ "constraints" : constraints ,
129
165
"schema" : [
130
166
{
131
167
"uri" : "https://www.w3.org/2018/credentials/v1"
0 commit comments