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/resources/contact_point.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -524,6 +524,7 @@ Optional:
524
524
-`basic_auth_user` (String) The username to use in basic auth headers attached to the request. If omitted, basic auth will not be used.
525
525
-`disable_resolve_message` (Boolean) Whether to disable sending resolve messages. Defaults to `false`.
526
526
-`headers` (Map of String) Custom headers to attach to the request.
527
+
-`hmac_config` (Block Set, Max: 1) HMAC signature configuration options. (see [below for nested schema](#nestedblock--webhook--hmac_config))
527
528
-`http_config` (Block Set, Max: 1) Common HTTP client options. (see [below for nested schema](#nestedblock--webhook--http_config))
528
529
-`http_method` (String) The HTTP method to use in the request. Defaults to `POST`.
529
530
-`max_alerts` (Number) The maximum number of alerts to send in a single request. This can be helpful in limiting the size of the request body. The default is 0, which indicates no limit.
@@ -537,6 +538,19 @@ Read-Only:
537
538
538
539
-`uid` (String) The UID of the contact point.
539
540
541
+
<aid="nestedblock--webhook--hmac_config"></a>
542
+
### Nested Schema for `webhook.hmac_config`
543
+
544
+
Required:
545
+
546
+
-`secret` (String, Sensitive) The secret key used to generate the HMAC signature.
547
+
548
+
Optional:
549
+
550
+
-`header` (String) The header in which the HMAC signature will be included. Defaults to `X-Grafana-Alerting-Signature`.
551
+
-`timestamp_header` (String) If set, the timestamp will be included in the HMAC signature. The value should be the name of the header to use.
Copy file name to clipboardExpand all lines: internal/resources/grafana/resource_alerting_contact_point_notifiers.go
+34-6Lines changed: 34 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1133,12 +1133,14 @@ func (w webhookNotifier) meta() notifierMeta {
1133
1133
typeStr: "webhook",
1134
1134
desc: "A contact point that sends notifications to an arbitrary webhook, using the Prometheus webhook format defined here: https://prometheus.io/docs/alerting/latest/configuration/#webhook_config",
returnfmt.Errorf("hmacConfig was not present in the settings when it should have been. value: %#v", p.Settings)
593
+
}
594
+
if_, ok:=hmacConfig.(map[string]interface{})["timestampHeader"]; ok {
595
+
found=true
596
+
}
597
+
}
598
+
if!found {
599
+
returnfmt.Errorf("timestampHeader was not present in any hmacConfig when it should have been. Settings: [%v, %v]", points[0].Settings, points[1].Settings)
0 commit comments