@@ -100,21 +100,12 @@ describe('Verifiable Presentations', function() {
100
100
presentationWithHolder
101
101
) , 'Failed to verify a valid VP with holder.' ) ;
102
102
103
- // presentation.holder = {id: localIssuer};
104
103
const presentationWithHolderObject = await createLocalVp ( {
105
104
presentation : require ( './input/presentation-holder-object-ok.json' )
106
105
} ) ;
107
106
await assert . doesNotReject ( endpoints . verifyVp (
108
107
presentationWithHolderObject
109
108
) , 'Failed to verify a valid VP with holder object.' ) ;
110
-
111
- const presentationMissingHolderId = await createLocalVp ( {
112
- presentation : require ( './input/presentation-holder-object-fail.json' )
113
- } ) ;
114
- await assert . rejects ( endpoints . verifyVp (
115
- presentationMissingHolderId
116
- ) , 'Failed to reject a VP with an invalid holder.' ) ;
117
-
118
109
// TODO, how to create negative fixture (bad holder values)
119
110
} ) ;
120
111
} ) ;
@@ -135,14 +126,12 @@ describe('VP - Presentations Including Holder Claims', function() {
135
126
'verifiable presentation MUST include a holder property.' ,
136
127
async function ( ) {
137
128
this . test . link = `https://w3c.github.io/vc-data-model/#presentations-including-holder-claims:~:text=A%20verifiable%20presentation%20that%20includes%20a%20self%2Dasserted%20verifiable%20credential%20that%20is%20only%20secured%20using%20the%20same%20mechanism%20as%20the%20verifiable%20presentation%20MUST%20include%20a%20holder%20property.` ;
138
- const presentation = require ( './input/presentation-vc-ok.json' ) ;
139
-
140
- presentation . verifiableCredential [ 0 ] . issuer = localIssuer ;
141
- const presentationMissingHolder = await createLocalVp ( {
142
- presentation
129
+ const selfAssertedNoHolder = await createLocalVp ( {
130
+ presentation : require (
131
+ './input/presentation-self-asserted-vc-no-holder.json' )
143
132
} ) ;
144
133
await assert . rejects ( endpoints . verifyVp (
145
- presentationMissingHolder
134
+ selfAssertedNoHolder
146
135
) , 'Failed to reject a VP with self-asserted VC without holder.' ) ;
147
136
} ) ;
148
137
@@ -152,31 +141,26 @@ describe('VP - Presentations Including Holder Claims', function() {
152
141
'the holder property of the verifiable presentation.' ,
153
142
async function ( ) {
154
143
this . test . link = `https://w3c.github.io/vc-data-model/#presentations-including-holder-claims:~:text=When%20a%20self%2Dasserted%20verifiable%20credential%20is%20secured%20using%20the%20same%20mechanism%20as%20the%20verifiable%20presentation%2C%20the%20value%20of%20the%20issuer%20property%20of%20the%20verifiable%20credential%20MUST%20be%20identical%20to%20the%20holder%20property%20of%20the%20verifiable%20presentation.` ;
155
- const presentation = require ( './input/presentation-vc-ok.json' ) ;
156
-
157
- presentation . verifiableCredential [ 0 ] . issuer = localIssuer ;
158
- presentation . holder = localIssuer ;
159
144
const presentationHolderMatch = await createLocalVp ( {
160
- presentation
145
+ presentation : require (
146
+ './input/presentation-self-asserted-vc-ok.json' )
161
147
} ) ;
162
148
await assert . doesNotReject ( endpoints . verifyVp (
163
149
presentationHolderMatch
164
150
) , 'Failed to verify a VP containing a self-asserted VC.' ) ;
165
151
166
- presentation . verifiableCredential [ 0 ] . issuer = localIssuer ;
167
- presentation . holder = 'did:example:acme' ;
168
152
const presentationHolderMismatch = await createLocalVp ( {
169
- presentation
153
+ presentation : require (
154
+ './input/presentation-self-asserted-vc-holder-mismatch.json' )
170
155
} ) ;
171
156
await assert . rejects ( endpoints . verifyVp (
172
157
presentationHolderMismatch
173
158
) , 'Failed to reject a VP with self-asserted VC ' +
174
159
'with a holder/issuer mismatch.' ) ;
175
160
176
- presentation . verifiableCredential [ 0 ] . issuer = 'did:example:acme' ;
177
- presentation . holder = localIssuer ;
178
161
const presentationIssuerMismatch = await createLocalVp ( {
179
- presentation
162
+ presentation : require (
163
+ './input/presentation-self-asserted-vc-issuer-mismatch.json' )
180
164
} ) ;
181
165
await assert . rejects ( endpoints . verifyVp (
182
166
presentationIssuerMismatch
0 commit comments