Webhook
Overviewโ
The webhook backend allows you to trigger your own custom webhooks, for both self-service actions and automations.
The steps shown in the image above are as follows:
-
Port generates an invocation of an action/automation.
-
Port signs the payload + timestamp using
HMAC-SHA-256
and puts it in the request header.WEBHOOK SECURITYVerifying the webhook request using the request headers provides the following benefits:
-
Ensures that the request payload has not been tampered with.
-
Ensures that the sender of the message is Port.
-
Ensures that the received message is not a replay of an older message.
To learn how to verify the webhook request, refer to the Verifying Webhook Signature page.
-
-
Port publishes an invoked action/automation via a
POST
request to the customer definedURL
. -
A listener implemented on the Client side receives the
POST
request and runs custom logic provided by the user.
The listener can be anything that can read from a Kafka topic and run code based on the received message, for example:
- AWS Lambda.
- Python code that reads from the topic.
- Docker container running code.
You control how you interact with webhooks, in the way that best suits your organization and infrastructure.
An example flow would be:
- A developer asks to deploy a new version of an existing
Microservice
. - The
create
action is sent to the definedURL
. - An AWS Lambda function is triggered by this new action message.
- The Lambda function deploys a new version of the service.
- When the Lambda is done, it reports back to Port about the new Microservice
Deployment
.