Skip to content

Commit

Permalink
edit webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
WanYixian committed Nov 22, 2024
1 parent 671bb6c commit 8aae30c
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions integrations/sources/webhook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ sidebarTitle: Overview
description: Describes how to ingest data from Webhook to RisingWave
---

A webhook is a mechanism that allows one application to send real-time data to another application whenever a specific event occurs. Instead of continuously polling for updates, webhooks enable applications to receive immediate notifications, making data transfer more efficient and timely. They are commonly used for integrating different services, such as receiving updates from third-party platforms or triggering actions in response to specific events.
A webhook is a mechanism that enables real-time data transfer between applications by sending immediate notifications when specific events occur. Instead of continuously polling for updates, applications can receive data automatically, making it an efficient way to integrate with third-party services.

With the support of webhook source, RisingWave can act as a webhook destination. This means it can accept incoming HTTP requests from external services and store the data directly into its tables. When an event triggers a webhook from a source application, the data is sent to RisingWave, which then processes and ingests the information in real-time.
RisingWave can serve as a webhook destination, directly accepting HTTP requests from external services and storing the incoming data in its tables. When a webhook is triggered, RisingWave processes and ingests the data in real-time.

This capability eliminates the need for an intermediary message broker like Kafka. Instead of setting up and maintaining an extra Kafka cluster, you can directly send data to RisingWave, which is able to handle and process the data in real-time. This simplifies the architecture and reduces overhead, enabling efficient data ingestion and stream processing without additional infrastructure.

This direct integration eliminates the need for an intermediary message broker like Kafka. Instead of setting up and maintaining an extra Kafka cluster, you can directly send data to RisingWave to process it in real-time, which enables efficient data ingestion and stream processing without extra infrastructure.

<Tip>
**PREMIUM EDITION FEATURE**
Expand All @@ -22,7 +23,7 @@ This feature is only available in the premium edition of RisingWave. The premium
This feature is in the public preview stage, meaning it's nearing the final product but is not yet fully stable. If you encounter any issues or have feedback, please contact us through our [Slack channel](https://www.risingwave.com/slack). Your input is valuable in helping us improve the feature. For more information, see our [Public preview feature list](/product-lifecycle/#features-in-the-public-preview-stage).
</Note>

## Creating a Webhook Table in RisingWave
## Creating a Webhook table in RisingWave

To utilize webhook sources in RisingWave, you need to create a table configured to accept webhook requests. Below is a basic example of how to set up such a table:

Expand All @@ -39,29 +40,29 @@ CREATE TABLE wbhtable (
);
```

Explanation:

- `CREATE SECRET`: Securely stores a secret value (`'secret_value'`) in RisingWave, which can be used for validating incoming requests.
- `CREATE TABLE wbhtable`: Defines a new table named wbhtable with a single column data of type `JSONB` to store `JSON` payload from the webhook.
- `WITH (connector = 'webhook')`: Specifies that the table uses the webhook connector to accept incoming HTTP requests.
- `VALIDATE SECRET test_secret AS secure_compare(...)`: Uses the stored secret `test_secret` to authenticate incoming webhook requests by comparing the provided signature in the headers.
- - First Argument: `headers->>'signature header'` indicates the HTTP header key where the webhook sender places the generated signature. This retrieves the signature from the incoming request headers.
- - Second Argument: `signature_generation_expressions` should be an expression specified by the user to compute the expected signature based on the secret and payload data (and possibly other header values).
| Parameter or clause | Description |
| :---------- | :------------ |
| `CREATE SECRET` | Securely stores a secret value in RisingWave for request validation. |
| `CREATE TABLE` | Defines a table with a JSONB column to store webhook payload data. |
| `connector` | Configures the table to accept incoming HTTP webhook requests |
| `VALIDATE SECRET...AS...` | Authenticates requests using the stored secret and signature comparison. |
| `secure_compare()` | Validates requests by matching the header signature against the computed signature, ensuring only authenticated requests are processed. |
| `header_of_signature` | Specifies which HTTP header contains the incoming signature. |
| `signature_generation_expressions` | Expression to compute the expected signature using the secret and payload. |

The `secure_compare(...)` function compares the signature provided in the request header with the computed signature. If they match, the request is considered authentic and is accepted; otherwise, it is rejected. This mechanism ensures that only verified requests from trusted sources are processed by RisingWave.

## Supported Webhook Sources and Authentication Methods
## Supported Webhook sources and authentication methods
RisingWave has been verified to work with the following webhook sources and authentication methods:

|Webhook Source|Authentication Methods|
|---|---|
|Webhook source|Authentication methods|
| :-- | :-- |
|GitHub| SHA-1 HMAC, SHA-256 HMAC |
|Rudderstack| Bearer Token |
|Segment| SHA-1 HMAC |
|AWS EventBridge| Bearer Token |
|HubSpot| API Key, Signature V2 |

<Note>While only the above sources have been thoroughly tested, RisingWave's existing functions are capable of supporting additional webhook sources and authentication methods. You can integrate other services using similar configurations, although they may not have been officially verified yet.</Note>
<Note>While only the above sources have been thoroughly tested, RisingWave can support additional Webhook sources and authentication methods. You can integrate other services using similar configurations, though they haven't been officially verified.</Note>

## Further Guidance
Detailed instructions and guides are available for integrating RisingWave with the verified webhook sources mentioned above. These guides provide step-by-step processes to help you set up and configure your webhook sources effectively.
## See also
[Ingest from Github Webhook](/integrations/sources/github-webhook): Step-by-step guide to help you set up and configure your Webhook sources.

0 comments on commit 8aae30c

Please sign in to comment.