Skip to content
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

Fix: stateless record webhooks #1124

Merged

Conversation

dbluhm
Copy link
Contributor

@dbluhm dbluhm commented Apr 28, 2021

This should hopefully address #1123.

Changes

fix: stateless records emit events

Error on the side of caution for BaseRecord.emit_event, using topic
without state when none is given, and inserting the serialized record as
the payload if no payload is given.

Events are only not emitted by records when no record topic is set.

fix: relax admin server record event pattern

Should now accept stateless record event topics

fix: add event namespace to base records to allow plugins to override

test: record topic parsing for webhook

Error on the side of caution for BaseRecord.emit_event, using topic
without state when none is given, and inserting the serialized record as
the payload if no payload is given.

Events are only not emitted by records when no record topic is set.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Should now accept stateless record event topics

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
@dbluhm dbluhm requested a review from TimoGlastra April 28, 2021 13:08
TimoGlastra
TimoGlastra previously approved these changes Apr 28, 2021
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for the quick fix :)

@@ -1,7 +1,9 @@
from aries_cloudagent.core.event_bus import Event
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: absolute import

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-import failed me 🙂 fixed

@codecov-commenter
Copy link

Codecov Report

Merging #1124 (88d8af1) into main (aa9a5c9) will increase coverage by 0.01%.
The diff coverage is 86.66%.

@@            Coverage Diff             @@
##             main    #1124      +/-   ##
==========================================
+ Coverage   99.19%   99.20%   +0.01%     
==========================================
  Files         383      383              
  Lines       22133    22139       +6     
==========================================
+ Hits        21954    21964      +10     
+ Misses        179      175       -4     

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
@ianco ianco merged commit 0b3de3f into openwallet-foundation:main Apr 28, 2021
@dbluhm dbluhm deleted the fix/stateless-record-webhooks branch April 28, 2021 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants