You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
-
# Contributing to otoroshi-plugin-yousign-webhook-validator
1
+
# Contributing to otoroshi-plugin-webhook-validator
2
2
3
-
These guidelines apply to all projects living in the the `cloud-apim/otoroshi-plugin-yousign-webhook-validator` repository.
3
+
These guidelines apply to all projects living in the the `cloud-apim/otoroshi-plugin-webhook-validator` repository.
4
4
5
5
These guidelines are meant to be a living document that should be changed and adapted as needed.
6
6
We encourage changes that make it easier to achieve our goals in an efficient way.
7
7
8
8
## Codebase
9
9
10
-
*[src](https://github.com/cloud-apim/otoroshi-plugin-yousign-webhook-validator/src): contains the otoroshi-plugin-yousign-webhook-validator sources and tests
10
+
*[src](https://github.com/cloud-apim/otoroshi-plugin-webhook-validator/src): contains the otoroshi-plugin-webhook-validator sources and tests
11
11
12
12
## Workflow
13
13
14
14
The steps below describe how to get a patch into a main development branch (e.g. `maon`).
15
15
The steps are exactly the same for everyone involved in the project (be it core team, or first time contributor).
16
16
We follow the standard GitHub [fork & pull](https://help.github.com/articles/using-pull-requests/#fork--pull) approach to pull requests. Just fork the official repo, develop in a branch, and submit a PR!
17
17
18
-
1. To avoid duplicated effort, it might be good to check the [issue tracker](https://github.com/cloud-apim/otoroshi-plugin-yousign-webhook-validator/issues) and [existing pull requests](https://github.com/cloud-apim/otoroshi-plugin-yousign-webhook-validator/pulls) for existing work.
19
-
- If there is no ticket yet, feel free to [create one](https://github.com/cloud-apim/otoroshi-plugin-yousign-webhook-validator/issues/new) to discuss the problem and the approach you want to take to solve it.
20
-
1.[Fork the project](https://github.com/cloud-apim/otoroshi-plugin-yousign-webhook-validator#fork-destination-box) on GitHub. You'll need to create a feature-branch for your work on your fork, as this way you'll be able to submit a pull request against the mainline otoroshi-plugin-yousign-webhook-validator.
18
+
1. To avoid duplicated effort, it might be good to check the [issue tracker](https://github.com/cloud-apim/otoroshi-plugin-webhook-validator/issues) and [existing pull requests](https://github.com/cloud-apim/otoroshi-plugin-webhook-validator/pulls) for existing work.
19
+
- If there is no ticket yet, feel free to [create one](https://github.com/cloud-apim/otoroshi-plugin-webhook-validator/issues/new) to discuss the problem and the approach you want to take to solve it.
20
+
1.[Fork the project](https://github.com/cloud-apim/otoroshi-plugin-webhook-validator#fork-destination-box) on GitHub. You'll need to create a feature-branch for your work on your fork, as this way you'll be able to submit a pull request against the mainline otoroshi-plugin-webhook-validator.
21
21
1. Create a branch on your fork and work on the feature. For example: `git checkout -b wip-awesome-new-feature`
22
22
- Please make sure to follow the general quality guidelines (specified below) when developing your patch.
23
23
- Please write additional tests covering your feature and adjust existing ones if needed before submitting your pull request.
@@ -32,7 +32,7 @@ We follow the standard GitHub [fork & pull](https://help.github.com/articles/usi
32
32
33
33
The TL;DR; of the above very precise workflow version is:
We strongly advise you to update your otoroshi-plugin-yousign-webhook-validator usage as soon as a new version is released.
3
+
We strongly advise you to update your otoroshi-plugin-webhook-validator usage as soon as a new version is released.
4
4
5
5
## Supported Versions
6
6
7
7
Each version is supported until the next one is released
8
8
9
9
## Reporting a Vulnerability
10
10
11
-
We want to keep otoroshi-plugin-yousign-webhook-validator safe for everyone. If you've discovered a security vulnerability in otoroshi-plugin-yousign-webhook-validator, we appreciate your help in disclosing it to us in a responsible manner by using the dedicated [github form](https://github.com/cloud-apim/otoroshi-plugin-yousign-webhook-validator/security) or by sending an email to [security@cloud-apim.com](mailto:security@cloud-apim.com) containing your name, an email address, a description of the vulnerability, the impacted versions of otoroshi-plugin-yousign-webhook-validator. You can encrypt the email content using [this pgp key](https://mathieuancelin.keybase.pub/pgp_key.asc)
11
+
We want to keep otoroshi-plugin-webhook-validator safe for everyone. If you've discovered a security vulnerability in otoroshi-plugin-webhook-validator, we appreciate your help in disclosing it to us in a responsible manner by using the dedicated [github form](https://github.com/cloud-apim/otoroshi-plugin-webhook-validator/security) or by sending an email to [security@cloud-apim.com](mailto:security@cloud-apim.com) containing your name, an email address, a description of the vulnerability, the impacted versions of otoroshi-plugin-webhook-validator. You can encrypt the email content using [this pgp key](https://mathieuancelin.keybase.pub/pgp_key.asc)
An [Otoroshi](https://github.com/MAIF/otoroshi) plugin that validates [YouSign](https://developers.yousign.com/docs/use-webhooks-in-your-app)webhook payloads before they reach your backend.
3
+
An [Otoroshi](https://github.com/MAIF/otoroshi) plugin that validates webhook payloads before they reach your backend using body payload signature validation.
4
4
5
5
## How it works
6
6
7
-
The plugin is provider-agnostic: the signature header, HMAC algorithm and prefix are all configurable. Out of the box it is pre-configured for YouSign, whose webhooks include an `X-Yousign-Signature-256` header containing an HMAC-SHA256 hash of the raw request body prefixed with `sha256=`.
7
+
The plugin is provider-agnostic: the signature header, HMAC algorithm and prefix are all configurable.
8
8
9
9
The plugin:
10
10
@@ -50,10 +50,10 @@ $ curl -X POST 'http://otoroshi-api.oto.tools:8080/api/routes' \
50
50
51
51
## Plugin configuration
52
52
53
-
| Field | Type | Required | Default | Description |
|`prefix`|`string`| no | derived from `algorithm`| String prepended to the hex hash before comparison (e.g. `sha256=`). Defaults are derived automatically from the chosen algorithm. |
59
59
@@ -84,30 +84,17 @@ $ curl -X POST 'http://otoroshi-api.oto.tools:8080/api/routes' \
84
84
|`401 Unauthorized`|`{ "error": "invalid signature" }`| The computed HMAC does not match the header value. |
85
85
|`401 Unauthorized`|`{ "error": "webhook secret not configured" }`| The plugin `secret` field is empty. |
86
86
87
-
## YouSign webhook headers
88
-
89
-
The following headers are sent by YouSign on every webhook call:
90
-
91
-
| Header | Description |
92
-
|--------|-------------|
93
-
|`X-Yousign-Signature-256`|`sha256=<hmac-sha256 hex>` – used by this plugin for payload authentication |
94
-
|`X-Yousign-Retry`| Retry attempt counter (0 for the first delivery) |
95
-
|`X-Yousign-Issued-At`| Timestamp of webhook transmission |
96
-
|`Content-Type`| Always `application/json`|
97
-
|`User-Agent`| Always `Yousign Webhook Bot`|
98
87
99
88
## Security notes
100
89
101
90
- The plugin uses **constant-time byte comparison** (`MessageDigest.isEqual`) to prevent timing-based side-channel attacks.
102
-
- YouSign only delivers webhooks over **HTTPS**; make sure your Otoroshi route is exposed on a TLS-enabled domain.
103
-
- YouSign webhooks originate from the following CIDRs: `5.39.7.128/28`, `52.143.162.31`, `51.103.81.166`. You can add an Otoroshi IP allowlist plugin alongside this one for defence-in-depth.
104
91
105
92
## Build
106
93
107
94
```shell
108
95
sbt assembly
109
96
```
110
97
111
-
The resulting jar is placed in `target/scala-2.12/otoroshi-plugin-yousign-webhook-validator-assembly_2.12-dev.jar`.
98
+
The resulting jar is placed in `target/scala-2.12/otoroshi-plugin-webhook-validator-assembly_2.12-dev.jar`.
112
99
113
100
Copy it to your Otoroshi `plugins/` directory (or reference it via the classpath loader) and restart Otoroshi.
overridedefdescription:Option[String] =Some("This plugin validates webhook payloads by verifying an HMAC signature. The header name, algorithm and prefix are all configurable (defaults to YouSign's X-Yousign-Signature-256 / HmacSHA256 / sha256=).")
overridedefdescription:Option[String] =Some("This plugin validates webhook payloads by verifying an HMAC signature. The header name, algorithm and prefix are all configurable.")
0 commit comments