File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
main/java/com/inrupt/client/accessgrant
test/java/com/inrupt/client/accessgrant Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,6 @@ public CompletionStage<AccessGrant> grantAccess(final AccessRequest request) {
232232 }
233233 });
234234 });
235-
236235 }
237236
238237 /**
@@ -298,7 +297,8 @@ public CompletionStage<VerificationResponse> verify(final AccessCredential crede
298297 try (final InputStream is = new ByteArrayInputStream (credential .serialize ().getBytes (UTF_8 ))) {
299298 final Map <String , Object > data = jsonService .fromJson (is ,
300299 new HashMap <String , Object >(){}.getClass ().getGenericSuperclass ());
301- presentation .put (VERIFIABLE_CREDENTIAL , data );
300+ Utils .getCredentialsFromPresentation (data , credential .getTypes ()).stream ().findFirst ()
301+ .ifPresent (c -> presentation .put (VERIFIABLE_CREDENTIAL , c ));
302302 } catch (final IOException ex ) {
303303 throw new AccessGrantException ("Unable to serialize credential" , ex );
304304 }
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ private void setupMocks() {
207207 .atPriority (1 )
208208 .withHeader ("Authorization" , containing ("Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9." ))
209209 .withRequestBody (containing ("\" " + wireMockServer .baseUrl () + "/access-grant-1\" " ))
210+ .withRequestBody (containing ("\" verifiableCredential\" :{\" " ))
210211 .willReturn (aResponse ()
211212 .withStatus (200 )
212213 .withHeader ("Content-Type" , "application/json" )
@@ -216,6 +217,7 @@ private void setupMocks() {
216217 .atPriority (1 )
217218 .withHeader ("Authorization" , containing ("Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9." ))
218219 .withRequestBody (containing ("\" " + wireMockServer .baseUrl () + "/access-request-5\" " ))
220+ .withRequestBody (containing ("\" verifiableCredential\" :{\" " ))
219221 .willReturn (aResponse ()
220222 .withStatus (200 )
221223 .withHeader ("Content-Type" , "application/json" )
You can’t perform that action at this time.
0 commit comments