-
Notifications
You must be signed in to change notification settings - Fork 1
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
AdminServer is now the only one to send_webhook #58
Conversation
Signed-off-by: Matthew Wright <matthew@smallhelm.com>
5dd7e05
to
ae32a16
Compare
I agree with this approach with the one suggestion that adding more "namespaces" could be nice. So |
Looking pretty good so far. Left some comments and thoughts. |
Signed-off-by: Matthew Wright <matthew@smallhelm.com>
Signed-off-by: Matthew Wright <matthew@smallhelm.com>
Made some changes:
Question: Is it ok to remove these?
|
Sounds good to me
I see, I didn't pick up on the |
Apologies, I've lost track of all the different conversations -- are there further changes needed after our discussion or is this ready for final review? |
@dbluhm I think it's ready for final review if we are ok removing Are there other implementations of BaseAdminServer running around out there? If so we'll just have to note that it's a breaking change to rely on |
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.
Nice work! Looking really good!
Looking through, I think we should generalize the send_webhook
method on BaseRecord
. At the moment, record updates (which as it turns out is one of the most useful and frequent types of webhook event sent out) are emitting an event specifically scoped to the webhook.
I recommend:
- Rename
BaseRecord.send_webhook
to something event oriented, perhapsemit_event
or similar. - Use
acapy::RECORD_TOPIC::STATE
as the topic.- This will require adding mappings as we have for the basic messages and pings.
This one might get a little messy but I think I would also recommend modifying the BaseRecord.save
and BaseRecord.post_save
(and any other relevant) methods to take a bool event
instead of webhook
or else keep webhook around for backwards compatibility and add the event but make sure they are the same and emit a deprecation warning on webhook usage. I'm not bent on this one but I think abstracting away the webhook as much as possible will make the system cleaner overall. If this ends up being a huge and/or brittle change, we'll likely need to regroup and come up with a different solution.
Signed-off-by: Matthew Wright <matthew@smallhelm.com>
Signed-off-by: Matthew Wright <matthew@smallhelm.com>
…ase_record Base record replace webhooks with events
First stab at the refactor. All the tests are passing and seems to be working fine with the toolbox.
Any event with a topic
acapy::webhook::(.*)
will get forwarded as a webhook. However, I'm thinking now might be a good time to improve the naming convention of these events, while still maintaining backwards compatibility with webhook topics.i.e. a mapping from event name to webhook topic might be: