-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JCL-299: verify method #403
Conversation
access-grant/src/main/java/com/inrupt/client/accessgrant/AccessGrantClient.java
Outdated
Show resolved
Hide resolved
access-grant/src/main/java/com/inrupt/client/accessgrant/AccessGrantClient.java
Outdated
Show resolved
Hide resolved
return v1Metadata().thenCompose(metadata -> { | ||
|
||
final Map<String, Object> presentation = new HashMap<>(); | ||
presentation.put(VERIFIABLE_CREDENTIAL, accessGrant); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The /verify
endpoint can also take a VerifiablePresentation
. Do you need this in this client?
if (isSuccess(status)) { | ||
return processVerificationResult(input); | ||
} | ||
throw new AccessGrantException("Unable to perform Access Grant verify: HTTP error " + status, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of an error the response will also contain an error
, errorDescription
and an optional reason
. These could be useful for a downstream client to know but they are getting dropped here and we are only giving them the status
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the VC-API spec, the verify endpoint will return a 200 in cases where the credential is invalid, but there is no defined response for, say, 4xx or 5xx category errors.
I think it would be great for the client to try to parse 4xx/5xx error bodies as if they contain those response, but that can be part of an overall improvement in how errors are processed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if (isSuccess(status)) { | ||
return processVerificationResult(input); | ||
} | ||
throw new AccessGrantException("Unable to perform Access Grant verify: HTTP error " + status, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the VC-API spec, the verify endpoint will return a 200 in cases where the credential is invalid, but there is no defined response for, say, 4xx or 5xx category errors.
I think it would be great for the client to try to parse 4xx/5xx error bodies as if they contain those response, but that can be part of an overall improvement in how errors are processed.
@jholleran Could you please take a look at the verify(...) method I added. I understand there are options in the call. What can they be? is it different from access grant to access request?
Any help is welcome.
Conclusion: we took out options from call.