Skip to content
Snippets Groups Projects

Draft: Creating a web hook endpoint to subscribe for policy change

Closed Valentin Yordanov requested to merge 48-creating-notifier-for-policy-change into main
29 files
+ 1180
244
Compare changes
  • Side-by-side
  • Inline
Files
29
+ 3
3
@@ -86,9 +86,6 @@ func main() {
// create rego policy cache
regocache := regocache.New()
// create policy changes notifier
notifier := notify.New(events)
// connect to mongo db
db, err := mongo.Connect(
context.Background(),
@@ -109,6 +106,9 @@ func main() {
logger.Fatal("error connecting to database", zap.Error(err))
}
// create policy changes notifier
notifier := notify.New(events, httpClient, storage, logger)
// subscribe the cache for policy data changes
storage.AddPolicyChangeSubscribers(regocache, notifier)
Loading