-
Notifications
You must be signed in to change notification settings - Fork 521
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
Send Problem report when CredEx not found #2577
Send Problem report when CredEx not found #2577
Conversation
Signed-off-by: Jason Sherman <[email protected]>
Signed-off-by: Jason Sherman <[email protected]>
Signed-off-by: Jason Sherman <[email protected]>
format_handlers = [] | ||
format_handlers_without_offer = [] | ||
for format in cred_request_message.formats: | ||
f = V20CredFormat.Format.get(format.format) | ||
if f: | ||
format_handlers.append(f) | ||
if f.handler(self.profile).can_receive_request_without_offer(): | ||
format_handlers_without_offer.append(f) |
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.
Good case for a list comprehension:
handlers = [
handler(self.profile)
for format in cred_request_message.formats
if (handler := V20CredFormat.Format.get(format.format))
]
handlers_without_offer = [
handler for handler in handlers
if handler.can_receive_request_without_offer()
]
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.
i like it; will do.
"debug.auto_respond_credential_request" | ||
), | ||
) | ||
if len(format_handlers_without_offer): |
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.
Nitpick but I'd say it's more idiomatic to just do if format_handlers_without_offer:
Signed-off-by: Jason Sherman <[email protected]>
Signed-off-by: Jason Sherman <[email protected]>
Signed-off-by: Jason Sherman <[email protected]>
Signed-off-by: Jason Sherman <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
@dbluhm - just bumping this for another review. added your suggestions and then put a similar exception handling in the v1 code. |
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!
See #2549
Address the situation when an issuer sends an offer and then deletes that offer (credential exchange) before the holder accepts it. When this is an
indy
credential exchange, a Problem Report is sent; when this is ajson-ld
exchange, the holder's accept actually becomes an unbound request for the credential and the flow carries on.A discussion is warranted to see if we want to implement something more global? Seems like at any point in any protocol one side may not find their record and the other side should be notified of the abandonment. Maybe it is already done and this was just a gap...
Added BDD tests to address the deletion and followup acceptance for
indy
andjson-ld
and also the holder sending a request for credential to issuer. Again,indy
is not allowed,json-ld
can flow into a credential issuance.