Skip to content

Commit

Permalink
webhook support
Browse files Browse the repository at this point in the history
  • Loading branch information
aachurin committed Feb 8, 2023
1 parent 6268aa3 commit db2d517
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions vulners/vulners.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,39 @@ def scanlist_report(self, limit=30, offset=0, filter=None, sort=''):

return self.__report("scanlist", offset, limit, filter or {}, sort)

get_webhooks = Endpoint(
method="post",
url="/api/v3/subscriptions/listWebhookSubscriptions/",
content_handler=lambda hooks, _: hooks["subscriptions"]
)

add_webhook = Endpoint(
method="post",
url="/api/v3/subscriptions/addWebhookSubscription/",
params=[
("query", String()),
("active", Boolean(default=True)),
],
content_handler=lambda hook, _: hook["subscription"]
)

enable_webhook = Endpoint(
method="post",
url="/api/v3/subscriptions/enableWebhookSubscription/",
params=[
("subscriptionid", String()),
("active", Boolean()),
]
)

delete_webhook = Endpoint(
method="post",
url="/api/v3/subscriptions/deleteWebhookSubscription/",
params=[
("subscriptionid", String()),
]
)


_Unset = object()

Expand Down

0 comments on commit db2d517

Please sign in to comment.