-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/keylist-webhooks
- Loading branch information
Showing
40 changed files
with
951 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
44 changes: 44 additions & 0 deletions
44
aries_cloudagent/protocols/revocation_notification/v2_0/handlers/revoke_handler.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""Handler for revoke message.""" | ||
|
||
from .....messaging.base_handler import BaseHandler | ||
from .....messaging.request_context import RequestContext | ||
from .....messaging.responder import BaseResponder | ||
|
||
from ..messages.revoke import Revoke | ||
|
||
|
||
class RevokeHandler(BaseHandler): | ||
"""Handler for revoke message.""" | ||
|
||
RECIEVED_TOPIC = "acapy::revocation-notification-v2::received" | ||
WEBHOOK_TOPIC = "acapy::webhook::revocation-notification-v2" | ||
|
||
async def handle(self, context: RequestContext, responder: BaseResponder): | ||
"""Handle revoke message.""" | ||
assert isinstance(context.message, Revoke) | ||
self._logger.debug( | ||
"Received notification of revocation for %s cred %s with comment: %s", | ||
context.message.revocation_format, | ||
context.message.credential_id, | ||
context.message.comment, | ||
) | ||
# Emit a webhook | ||
if context.settings.get("revocation.monitor_notification"): | ||
await context.profile.notify( | ||
self.WEBHOOK_TOPIC, | ||
{ | ||
"revocation_format": context.message.revocation_format, | ||
"credential_id": context.message.credential_id, | ||
"comment": context.message.comment, | ||
}, | ||
) | ||
|
||
# Emit an event | ||
await context.profile.notify( | ||
self.RECIEVED_TOPIC, | ||
{ | ||
"revocation_format": context.message.revocation_format, | ||
"credential_id": context.message.credential_id, | ||
"comment": context.message.comment, | ||
}, | ||
) |
Empty file.
Oops, something went wrong.