diff --git a/docs/_static/w2fm_mpro.svg b/docs/_static/w2fm_mpro.svg new file mode 100644 index 0000000..92cb058 --- /dev/null +++ b/docs/_static/w2fm_mpro.svg @@ -0,0 +1,3 @@ + + +
Seeking verification
Seeking verification
SUCCESS RESPONSE
HTTP 200
UUID and DIGEST
SUCCESS RESPONSE...
FAILURE RESPONSE
HTTP 400, HTTP 401, HTTP 403,
HTTP 409 and HTTP 500
ERROR MESSAGE
FAILURE RESPONSE...
API SERVICE
API SERVICE
Event Invocation Request
Event Invocation Request
WEBHOOK SERVICE
WEBHOOK SERVICE
Success
Success
Failure
Failure
VERIFICATION
VERIFICATION
Response to API service
Response to API service
Message shared
Message shared
MESSAGE PRODUCER
MESSAGE PRODUCER
Production bus response
Production bus response
FEDORA MESSAGING
PRODUCTION BUS
FEDORA MESSAGING...
Information required for verification
Information required for verification
DATABASE
DATABASE
Entry to the MESSAGE table
Entry to the MESSAGE table
\ No newline at end of file diff --git a/docs/webhook2fedmsg/diagrams/w2fm_mpro.drawio b/docs/webhook2fedmsg/diagrams/w2fm_mpro.drawio new file mode 100644 index 0000000..2ba4863 --- /dev/null +++ b/docs/webhook2fedmsg/diagrams/w2fm_mpro.drawio @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/webhook2fedmsg/mpro.rst b/docs/webhook2fedmsg/mpro.rst new file mode 100644 index 0000000..dc94180 --- /dev/null +++ b/docs/webhook2fedmsg/mpro.rst @@ -0,0 +1,56 @@ +.. _apis: + +Message producer +================ + +The following is an interaction diagram of the message producer. + +.. image:: ../_static/w2fm_mpro.svg + :target: ../_images/w2fm_mpro.svg + +Interactions detailed +--------------------- + +1. When an event invocation request is sent from the webhook service to the + API service, the validity of the request is verified using the information + available in the database by the API service. + + a. If the validity is accepted, the following steps take place - + + #. The event invocation request is forwarded to the message producer + where necessary templating is applied on the message topic and the + message body. + #. After the templating has been applied, the message is then shared + with the Fedora Messaging bus and the response from the production + bus is received. + #. An entry containing the datetime information of the message creation, + the digest signature of the message and associated service identifier + is stored. + #. A response containing the digest signature of the message and the + message identifier is then extended to the API service to be sent to + the requestor. + #. The API service sends a HTTP 200 response with body containing the + message identifier and the digest signature of the message to the + webhook service. + + b. If the validity is rejected or if any error happens, the following steps take place - + + #. If the service associated with the service UUID requested is not + found, an HTTP 400 response is shared by the API service with details + of the failure. + #. If the credentials of the user are provided incorrectly in the request + header, an HTTP 401 response is shared by the API service with details + of the failure. + #. If the requesting user is not allowed to invoke an event from the + service, an HTTP 403 response is shared by the API service with details + of the failure. + #. If the UUID associated with the conveyed message has been already been + used, an HTTP 409 response is shared by the API service with details + of the failure. + #. If an unexpected server-side error happens that cannot be recovered + from, an HTTP 500 response is shared by the API service with details + of the failure. + +2. Depending on the response received by the webhook service, it can decide + to either continue making event invocation requests or debug the reasons + why the service is not working as intended.