Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prism-agent): simple event mechanism using webhook (#575)
* feat(prism-agent): introduce webhook publisher config * feat(prism-agent): add necessary event notification interfaces * feat(prism-agent): add event notification service 'in-memory' implementation * feat(prism-agent): implement dummy webhook publisher consumer * feat(prism-agent): add notification service calls for issue credential flow (DIDComm sender side only) * feat(prism-agent): wire notification service and webhook publisher in app entry point * feat(prism-agent): add fake webhook URL config param * feat(prism-agent): notify when credential is generated * feat(prism-agent): notify issue credential steps occuring on the DIDComm receiver side * feat(prism-agent): extract event notification classes to a new shared project * feat(pollux): add credential service subclass that notifies of events * feat(pollux): use global ZIO http client layer in HttpURIDereferencerImpl * feat(prism-agent): implement real HTTP calls in Webhook publisher * feat(prism-agent): include WEBHOOK_API_KEY in request Authorization header when provided * chore(prism-agent): declare WALLET_SEED and WEBHOOK_API_KEY in docker compose config * chore(prism-agent): complete main branch merging * feature(prism-agent): refactor event notification and make it more generic * feature(prism-agent): add connect & presentation consumers in Webhook publisher * chore(prism-agent): use postgres secret storage implementation in default docker-compose config * feat(prism-agent): add event notification sending for connect flow * chore(pollux): use RecordIdNotFound in error channel instead of an Option return value, in presentation service methods * feat(prism-agent): implement event notifiation sending in presentation protocol * test(pollux): fix unit test related to presentation rejection * chore(prism-agent): get rid of event encoder/decoder (useless for now) * chore(pollux): rename event notification service implementation * test(prism-agent): make capacity of event queue configurable and add unit tests * chore(prism-agent): add event notification service dependency to wallet api * feat(prism-agent): add new 'DIDState' topic and notify of DID published events * feat(prism-agent): consume new 'DIDState' topic events (only DID published for now) * chore(prism-agent): run scalafmt * chore(prism-agent): scalafmtAll * test(connect): add unit tests for connection service with event notif * test(pollux): add unit tests for credential service with event notif * test(pollux): move presentation service spec utility methods to helper trait * chore(prism-agent): scalafmtAll * chore(pollux): fix method typo * test(pollux): add unit tests for presentation flow notifications, introducing ZIO Mock for PresentationService * test(connect): refactor notifier unit tests to use ZIO mock for ConnectionService * test(pollux): refactor credential service notifier unit tests to use ZIO mock for CredentialService * fix(pollux): fix presentation accepted/rejected event not being sent * chore(prism-agent): scalafmtAll * test(pollux): fix unit tests * feat: add Json serialization for events #1 * feat: add application/json header * doc(prism-agent): update protocol state enums in OAS * doc(prism-agent): add tutorial for simple event mechanism webhooks * doc(prism-agent): update webhook tutorial * doc(prism-agent): update Docusaurus sidebar for webhook * feat: add event type field to all events * chore(prism-agent): use ZIO ConcurrentMap to store notification queues * chore(prism-agent): fixing last PR comments * doc(prism-agent): document DID-related events in webhook.md * fix(prism-agent): use ZIO sliding queue (discarding old messages) instead of a bounded one * feat(prism-agent): use a 5 seconds request timeout in Webhook publisher * test(prism-agent): fix unit test for sliding queue * chore(prism-agent): fix URLs in webhook.md --------- Co-authored-by: Yurii Shynbuiev <[email protected]>
- Loading branch information