Skip to content

Commit 74b4d3e

Browse files
committed
debug
1 parent c21889a commit 74b4d3e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

lib/rp.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,41 @@ const verifyDidJWT = async(jwt: string, resolver: Resolvable, options: JWTVerify
105105
const resolver = getResolver('ethr');
106106

107107
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+
}
108143
return RP.builder()
109144
// return RP.builder({ requestVersion: SupportedVersion.SIOPv2_ID1 })
110145
.withClientId(identifier.did)
@@ -126,6 +161,7 @@ export const rp = (type:string, id:string) => {
126161
"id": "1",
127162
"name": type + " Verifiable Credential",
128163
"purpose": "We want a VC of this type to proof provider claim",
164+
"constraints": constraints,
129165
"schema": [
130166
{
131167
"uri": "https://www.w3.org/2018/credentials/v1"

0 commit comments

Comments
 (0)