Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2/webhooks: add event categories for webhook subscription type #114

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading