1
- # Svix Bridge
1
+ <h1 align =" center " >
2
+ <a href =" https://www.svix.com " >
3
+ <img width="120" src="https://avatars.githubusercontent.com/u/80175132?s=200&v=4" />
4
+ <p align="center">Svix - Webhooks as a service</p>
5
+ </a >
6
+ </h1 >
2
7
3
- ` svix-bridge ` is organized in terms of ** senders** and ** receivers** .
8
+ ![ GitHub tag] ( https://img.shields.io/github/tag/svix/svix-webhooks.svg )
9
+ [ ![ Build Status] ( https://github.com/svix/svix-webhooks/workflows/Bridge%20CI/badge.svg )] ( https://github.com/svix/svix-webhooks/actions )
10
+ [ ![ Bridge Security] ( https://github.com/svix/svix-webhooks/actions/workflows/bridge-security.yml/badge.svg )] ( https://github.com/svix/svix-webhooks/actions/workflows/bridge-security.yml )
11
+ [ ![ License] ( https://img.shields.io/badge/license-MIT-brightgreen.svg )] ( LICENSE )
12
+ [ ![ Join our slack] ( https://img.shields.io/badge/Slack-join%20the%20community-blue?logo=slack&style=social )] ( https://www.svix.com/slack/ )
13
+
14
+ # Svix Bridge (beta)
15
+
16
+ Bridge is an agent to help integrate webhooks into your existing messaging infrastructure.
17
+
18
+ Bridge is organized in terms of ** senders** and ** receivers** .
4
19
5
20
** Senders** are useful when you have a data source (an "input") such as a
6
21
message queue and want to generate Svix webhooks from those messages.
7
22
8
23
** Receivers** act as HTTP endpoints which wait for Svix webhooks to arrive, then
9
24
publish the payload on to a specified "output."
10
25
26
+ ** Receivers** also (optionally) perform validation of the webhooks using Svix's signature verification.
27
+
28
+ Both ** senders** and ** receivers** are defined in terms of their input, and optional JavaScript transformation, and their output.
29
+
11
30
Currently the supported Sender inputs and Receiver outputs are the following
12
31
messaging systems:
13
32
@@ -16,13 +35,28 @@ messaging systems:
16
35
- Redis
17
36
- SQS
18
37
19
- ## Usage
38
+ > Important to note that queues, exchanges, topics, etc should be created and configured independently,
39
+ > prior to using launching Bridge. Bridge will not automatically attempt to create these resources, it will only try
40
+ > (and fail) to read from or publish to the stream/queue in this case.
41
+
42
+
43
+ ## Installation
44
+
45
+ Docker images are available on [ docker hub] ( https://registry.hub.docker.com/r/svix/svix-bridge )
20
46
21
47
```
22
- svix-bridge -c path/to/ svix-bridge.yaml
48
+ $ docker pull svix/ svix-bridge
23
49
```
24
50
25
- ## Configuration
51
+ If you don't want to use docker, see [ Building from Source] ( ../README.md#building-from-source ) .
52
+
53
+
54
+
55
+ # Usage and Configuration
56
+
57
+ ```
58
+ $ svix-bridge -c path/to/svix-bridge.yaml
59
+ ```
26
60
27
61
The CLI itself exposes only a single flag (` -c ` , ` --cfg ` ) used to set the path for the config file.
28
62
The location of the config file can also be set with the ` SVIX_BRIDGE_CFG ` env var.
@@ -34,7 +68,6 @@ Each sender and receiver can optionally specify a `transformation`.
34
68
Transformations should define a function called ` handler ` that accepts an object and returns an object.
35
69
36
70
Senders should produce JSON following an expected shape:
37
-
38
71
```
39
72
{
40
73
// This indicates which Svix application to send the message to
@@ -52,21 +85,36 @@ Senders should produce JSON following an expected shape:
52
85
> The comments in the above JSON are for illustrative purposes only ;)
53
86
> That's not valid JSON! Sorry!
54
87
55
-
56
88
For detail on the ` message ` field, see: < https://api.svix.com/docs#tag/Message/operation/v1.message.create >
57
89
58
- Important to note that queues, exchanges, topics, or what have you, should be created and configured independently,
59
- prior to using the plugin. There's nothing in place to automatically create these resources.
60
- The plugin will only try (and fail) to read from the stream in such a case.
90
+ See the example configs for how to configure each input and output in more detail:
91
+ - [ senders ] ( ./svix-bridge.example.senders.yaml )
92
+ - [ receivers ] ( ./svix-bridge.example.receivers.yaml )
61
93
62
- - GCP Pub/Sub
63
- - RabbitMQ
64
- - Redis
65
- - SQS
94
+ # Building from source
66
95
67
- The HTTP server also (optionally) performs validation of the webhooks using Svix's signature verification method.
96
+ You would need a working Rust compiler in order to build Svix Bridge.
97
+ The easiest way is to use [ rustup] ( https://rustup.rs/ ) .
68
98
69
- The ` verification ` section for each route can be set one of two ways:
70
- * ` none ` which accepts and forwards any JSON POST HTTP request.
71
- * ` svix ` that takes a Svix endpoint secret (starting with ` whsec_ ` ) and
72
- validating it using an official Svix library
99
+ ```
100
+ # Clone the repository
101
+ git clone https://github.com/svix/svix-webhooks
102
+ # Change to the source directory
103
+ cd svix-webhooks/bridge/
104
+ # Build
105
+ cargo install --path svix-bridge
106
+ ```
107
+
108
+ Some system dependencies are required for Bridge to build successfully.
109
+ Consult the [ Dockerfile] ( ./Dockerfile ) for a good reference of what's required at build time.
110
+
111
+ # Building with Docker
112
+
113
+ ```
114
+ # Clone the repository
115
+ git clone https://github.com/svix/svix-webhooks
116
+ # Change to the source directory
117
+ cd svix-webhooks/bridge/
118
+ # Build
119
+ docker build --tag svix-bridge:local .
120
+ ```
0 commit comments