Skip to content

Commit 34e007d

Browse files
authored
v2/webhooks: add event categories for webhook subscription type (#114)
Add missing event categories for webhook subscription types. These were missing in the initial pass, and imply groupings of events to subscribe to. Updates tailscale/terraform-provider-tailscale#433 Signed-off-by: Mario Minardi <[email protected]>
1 parent 5613d6b commit 34e007d

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

v2/webhooks.go

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,33 @@ const (
2323
)
2424

2525
const (
26-
WebhookNodeCreated WebhookSubscriptionType = "nodeCreated"
27-
WebhookNodeNeedsApproval WebhookSubscriptionType = "nodeNeedsApproval"
28-
WebhookNodeApproved WebhookSubscriptionType = "nodeApproved"
29-
WebhookNodeKeyExpiringInOneDay WebhookSubscriptionType = "nodeKeyExpiringInOneDay"
30-
WebhookNodeKeyExpired WebhookSubscriptionType = "nodeKeyExpired"
31-
WebhookNodeDeleted WebhookSubscriptionType = "nodeDeleted"
32-
WebhookPolicyUpdate WebhookSubscriptionType = "policyUpdate"
33-
WebhookUserCreated WebhookSubscriptionType = "userCreated"
34-
WebhookUserNeedsApproval WebhookSubscriptionType = "userNeedsApproval"
35-
WebhookUserSuspended WebhookSubscriptionType = "userSuspended"
36-
WebhookUserRestored WebhookSubscriptionType = "userRestored"
37-
WebhookUserDeleted WebhookSubscriptionType = "userDeleted"
38-
WebhookUserApproved WebhookSubscriptionType = "userApproved"
39-
WebhookUserRoleUpdated WebhookSubscriptionType = "userRoleUpdated"
40-
WebhookSubnetIPForwardingNotEnabled WebhookSubscriptionType = "subnetIPForwardingNotEnabled"
41-
WebhookExitNodeIPForwardingNotEnabled WebhookSubscriptionType = "exitNodeIPForwardingNotEnabled"
26+
// WebhookCategoryTailnetManagement implies the entire group of events below.
27+
// Note that subscribing to WebhookCategoryTailnetManagement will include any
28+
// future events added below.
29+
WebhookCategoryTailnetManagement WebhookSubscriptionType = "categoryTailnetManagement"
30+
WebhookNodeCreated WebhookSubscriptionType = "nodeCreated"
31+
WebhookNodeNeedsApproval WebhookSubscriptionType = "nodeNeedsApproval"
32+
WebhookNodeApproved WebhookSubscriptionType = "nodeApproved"
33+
WebhookNodeKeyExpiringInOneDay WebhookSubscriptionType = "nodeKeyExpiringInOneDay"
34+
WebhookNodeKeyExpired WebhookSubscriptionType = "nodeKeyExpired"
35+
WebhookNodeDeleted WebhookSubscriptionType = "nodeDeleted"
36+
WebhookPolicyUpdate WebhookSubscriptionType = "policyUpdate"
37+
WebhookUserCreated WebhookSubscriptionType = "userCreated"
38+
WebhookUserNeedsApproval WebhookSubscriptionType = "userNeedsApproval"
39+
WebhookUserSuspended WebhookSubscriptionType = "userSuspended"
40+
WebhookUserRestored WebhookSubscriptionType = "userRestored"
41+
WebhookUserDeleted WebhookSubscriptionType = "userDeleted"
42+
WebhookUserApproved WebhookSubscriptionType = "userApproved"
43+
WebhookUserRoleUpdated WebhookSubscriptionType = "userRoleUpdated"
44+
)
45+
46+
const (
47+
// WebhookCategoryDeviceMisconfigurations implies the entire group of events below.
48+
// Note that subscribing to WebhookCategoryDeviceMisconfigurations will include any
49+
// future events added below.
50+
WebhookCategoryDeviceMisconfigurations WebhookSubscriptionType = "categoryDeviceMisconfigurations"
51+
WebhookSubnetIPForwardingNotEnabled WebhookSubscriptionType = "subnetIPForwardingNotEnabled"
52+
WebhookExitNodeIPForwardingNotEnabled WebhookSubscriptionType = "exitNodeIPForwardingNotEnabled"
4253
)
4354

4455
type (

0 commit comments

Comments
 (0)