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
+96-1Lines changed: 96 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,49 @@ 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
+
94
+
- `simple`- Standard single-value headers like "sha256=abc123..." or "abc123..."
95
+
- `structured`- Comma-separated key-value pairs like "t=1663781880,v1=abc123..."
96
+
97
+
##### `signature_key` (optional)
98
+
99
+
When `header_format` is "structured", this specifies the key name for the signature value in the header.
100
+
101
+
**Default:** `v1`
102
+
**Example:** `signature`
103
+
104
+
##### `timestamp_key` (optional)
105
+
106
+
When `header_format` is "structured", this specifies the key name for the timestamp value in the header.
107
+
108
+
**Default:** `t`
109
+
**Example:** `timestamp`
110
+
111
+
##### `structured_header_separator` (optional)
112
+
113
+
When `header_format` is "structured", this specifies the separator used between the unique keys in the structured header.
114
+
115
+
For example, if the header is `t=1663781880,v1=abc123`, the `structured_header_separator` would be `,`. It defaults to `,` but can be changed if needed.
116
+
117
+
**Example:** `.`
118
+
**Default:** `,`
119
+
120
+
##### `key_value_separator` (optional)
121
+
122
+
When `header_format` is "structured", this specifies the separator used between the key and value in the structured header.
123
+
124
+
For example, in the header `t=1663781880,v1=abc123`, the `key_value_separator` would be `=`. It defaults to `=` but can be changed if needed.
125
+
126
+
**Example:** `:`
127
+
**Default:** `=`
86
128
87
129
#### HMAC Examples
88
130
@@ -218,6 +260,59 @@ curl -X POST "$WEBHOOK_URL" \
218
260
219
261
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
262
263
+
**Tailscale-style HMAC with structured headers:**
264
+
265
+
This configuration supports providers like Tailscale that include both timestamp and signature in a single header using comma-separated key-value pairs.
266
+
267
+
```yaml
268
+
auth:
269
+
type: hmac
270
+
secret_env_key: TAILSCALE_WEBHOOK_SECRET
271
+
header: Tailscale-Webhook-Signature
272
+
algorithm: sha256
273
+
format: "signature_only" # produces "abc123..." (no prefix)
274
+
header_format: "structured" # enables parsing of "t=123,v1=abc" format
275
+
signature_key: "v1" # key for signature in structured header
276
+
timestamp_key: "t" # key for timestamp in structured header
277
+
payload_template: "{timestamp}.{body}" # dot-separated format
278
+
timestamp_tolerance: 300 # 5 minutes
279
+
```
280
+
281
+
**How it works:**
282
+
283
+
1. The signature header contains both timestamp and signature: `Tailscale-Webhook-Signature: t=1663781880,v1=0123456789abcdef`
284
+
2. The timestamp and signature are extracted from the structured header
285
+
3. The HMAC is calculated over the payload using the template: `{timestamp}.{body}`
286
+
4. For example, if timestamp is "1663781880" and body is `{"event":"test"}`, the signed payload becomes: `1663781880.{"event":"test"}`
287
+
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.
315
+
221
316
### Shared Secret Authentication
222
317
223
318
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