Skip to content

Commit

Permalink
v2/webhooks: add event categories for webhook subscription type
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mpminardi committed Sep 16, 2024
1 parent 5613d6b commit af8a93c
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions v2/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,33 @@ const (
)

const (
WebhookNodeCreated WebhookSubscriptionType = "nodeCreated"
WebhookNodeNeedsApproval WebhookSubscriptionType = "nodeNeedsApproval"
WebhookNodeApproved WebhookSubscriptionType = "nodeApproved"
WebhookNodeKeyExpiringInOneDay WebhookSubscriptionType = "nodeKeyExpiringInOneDay"
WebhookNodeKeyExpired WebhookSubscriptionType = "nodeKeyExpired"
WebhookNodeDeleted WebhookSubscriptionType = "nodeDeleted"
WebhookPolicyUpdate WebhookSubscriptionType = "policyUpdate"
WebhookUserCreated WebhookSubscriptionType = "userCreated"
WebhookUserNeedsApproval WebhookSubscriptionType = "userNeedsApproval"
WebhookUserSuspended WebhookSubscriptionType = "userSuspended"
WebhookUserRestored WebhookSubscriptionType = "userRestored"
WebhookUserDeleted WebhookSubscriptionType = "userDeleted"
WebhookUserApproved WebhookSubscriptionType = "userApproved"
WebhookUserRoleUpdated WebhookSubscriptionType = "userRoleUpdated"
WebhookSubnetIPForwardingNotEnabled WebhookSubscriptionType = "subnetIPForwardingNotEnabled"
WebhookExitNodeIPForwardingNotEnabled WebhookSubscriptionType = "exitNodeIPForwardingNotEnabled"
// WebhookCategoryTailnetManagement implies the entire group of events below.
// Note that subscribing to WebhookCategoryTailnetManagement will include any
// future events added below.
WebhookCategoryTailnetManagement WebhookSubscriptionType = "categoryTailnetManagement"
WebhookNodeCreated WebhookSubscriptionType = "nodeCreated"
WebhookNodeNeedsApproval WebhookSubscriptionType = "nodeNeedsApproval"
WebhookNodeApproved WebhookSubscriptionType = "nodeApproved"
WebhookNodeKeyExpiringInOneDay WebhookSubscriptionType = "nodeKeyExpiringInOneDay"
WebhookNodeKeyExpired WebhookSubscriptionType = "nodeKeyExpired"
WebhookNodeDeleted WebhookSubscriptionType = "nodeDeleted"
WebhookPolicyUpdate WebhookSubscriptionType = "policyUpdate"
WebhookUserCreated WebhookSubscriptionType = "userCreated"
WebhookUserNeedsApproval WebhookSubscriptionType = "userNeedsApproval"
WebhookUserSuspended WebhookSubscriptionType = "userSuspended"
WebhookUserRestored WebhookSubscriptionType = "userRestored"
WebhookUserDeleted WebhookSubscriptionType = "userDeleted"
WebhookUserApproved WebhookSubscriptionType = "userApproved"
WebhookUserRoleUpdated WebhookSubscriptionType = "userRoleUpdated"
)

const (
// WebhookCategoryDeviceMisconfigurations implies the entire group of events below.
// Note that subscribing to WebhookCategoryDeviceMisconfigurations will include any
// future events added below.
WebhookCategoryDeviceMisconfigurations WebhookSubscriptionType = "categoryDeviceMisconfigurations"
WebhookSubnetIPForwardingNotEnabled WebhookSubscriptionType = "subnetIPForwardingNotEnabled"
WebhookExitNodeIPForwardingNotEnabled WebhookSubscriptionType = "exitNodeIPForwardingNotEnabled"
)

type (
Expand Down

0 comments on commit af8a93c

Please sign in to comment.