-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c282fd
commit 136b907
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Notifications | ||
|
||
Notifications are a way for Clair to inform an endpoint that changes to tracked vulnerabilities have occurred. | ||
Notifications should contain only the name of a notification. | ||
Because notification data can require pagination, it is expected that the receiving endpoint calls the Clair API for reading notifications and marking them as read after being notified. | ||
|
||
## Webhook | ||
|
||
Webhook is an out-of-the-box notifier that sends the following JSON object via an HTTP POST: | ||
|
||
```json | ||
{ | ||
"Notification": { | ||
"Name": "6e4ad270-4957-4242-b5ad-dad851379573" | ||
} | ||
} | ||
``` | ||
|
||
## Custom Notifiers | ||
|
||
Clair can also be compiled with custom notifiers by importing them in `main.go`. | ||
Custom notifiers are any Go package that implements the `Notifier` interface and registers themselves with the `notifier` package. | ||
Notifiers are registered in [init()] similar to drivers for Go's standard [database/sql] package. | ||
|
||
[init()]: https://golang.org/doc/effective_go.html#init | ||
[database/sql]: https://godoc.org/database/sql |