Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
policy
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaia-X
Trust Services API
policy
Merge requests
!48
Draft: Creating a web hook endpoint to subscribe for policy change
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Draft: Creating a web hook endpoint to subscribe for policy change
48-creating-notifier-for-policy-change
into
main
Overview
0
Commits
1
Pipelines
3
Changes
29
Closed
Valentin Yordanov
requested to merge
48-creating-notifier-for-policy-change
into
main
1 year ago
Overview
0
Commits
1
Pipelines
3
Changes
29
Expand
Closes
#48 (closed)
0
0
Merge request reports
Compare
main
version 2
16a8fcd0
1 year ago
version 1
ab93741b
1 year ago
main (base)
and
latest version
latest version
7fc87b5a
1 commit,
1 year ago
version 2
16a8fcd0
1 commit,
1 year ago
version 1
ab93741b
1 commit,
1 year ago
29 files
+
1180
−
244
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
29
Search (e.g. *.vue) (Ctrl+P)
cmd/policy/main.go
+
3
−
3
Options
@@ -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