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: docs/auth_plugins.md
+77-1Lines changed: 77 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,30 @@ The maximum age (in seconds) allowed for timestamped requests. Only used when `t
82
82
83
83
A template for constructing the payload used in signature generation when timestamp validation is enabled. Use placeholders like `{version}`, `{timestamp}`, and `{body}`.
The format of the signature header content. Use "structured" for headers containing comma-separated key-value pairs.
90
+
91
+
**Default:** `simple`
92
+
**Valid values:**
93
+
- `simple`- Standard single-value headers like "sha256=abc123..." or "abc123..."
94
+
- `structured`- Comma-separated key-value pairs like "t=1663781880,v1=abc123..."
95
+
96
+
##### `signature_key` (optional)
97
+
98
+
When `header_format` is "structured", this specifies the key name for the signature value in the header.
99
+
100
+
**Default:** `v1`
101
+
**Example:** `signature`
102
+
103
+
##### `timestamp_key` (optional)
104
+
105
+
When `header_format` is "structured", this specifies the key name for the timestamp value in the header.
106
+
107
+
**Default:** `t`
108
+
**Example:** `timestamp`
86
109
87
110
#### HMAC Examples
88
111
@@ -218,6 +241,59 @@ curl -X POST "$WEBHOOK_URL" \
218
241
219
242
This approach provides strong security through timestamp validation while using a simpler format than the Slack-style implementation. The signing payload becomes `1609459200:{"event":"deployment","status":"success"}` and the resulting signature format is `sha256=computed_hmac_hash`.
220
243
244
+
**Tailscale-style HMAC with structured headers:**
245
+
246
+
This configuration supports providers like Tailscale that include both timestamp and signature in a single header using comma-separated key-value pairs.
247
+
248
+
```yaml
249
+
auth:
250
+
type: hmac
251
+
secret_env_key: TAILSCALE_WEBHOOK_SECRET
252
+
header: Tailscale-Webhook-Signature
253
+
algorithm: sha256
254
+
format: "signature_only" # produces "abc123..." (no prefix)
255
+
header_format: "structured" # enables parsing of "t=123,v1=abc" format
256
+
signature_key: "v1" # key for signature in structured header
257
+
timestamp_key: "t" # key for timestamp in structured header
258
+
payload_template: "{timestamp}.{body}" # dot-separated format
259
+
timestamp_tolerance: 300 # 5 minutes
260
+
```
261
+
262
+
**How it works:**
263
+
264
+
1. The signature header contains both timestamp and signature: `Tailscale-Webhook-Signature: t=1663781880,v1=0123456789abcdef`
265
+
2. The timestamp and signature are extracted from the structured header
266
+
3. The HMAC is calculated over the payload using the template: `{timestamp}.{body}`
267
+
4. For example, if timestamp is "1663781880" and body is `{"event":"test"}`, the signed payload becomes: `1663781880.{"event":"test"}`
268
+
5. The signature is validated as a raw hex string (no prefix)
This format is particularly useful for providers that want to include multiple pieces of metadata in a single header while maintaining strong security through timestamp validation.
296
+
221
297
### Shared Secret Authentication
222
298
223
299
The SharedSecret plugin provides simple secret-based authentication by comparing a secret value sent in an HTTP header. While simpler than HMAC, it provides less security since the secret is transmitted directly in the request header.
0 commit comments