Slackbot
02/01/2023, 8:46 PMTrey Lowerison
02/01/2023, 8:59 PMAsaf Cohen
02/01/2023, 9:00 PMOPAL_POLICY_SUBSCRIPTION_DIRS
You can also enforce what policy directories is a client allowed to ask for, by encoding it to the client JWTAsaf Cohen
02/01/2023, 9:00 PM.manifest
functionality controls the order of which you load files into OPA.Asaf Cohen
02/01/2023, 9:00 PMTrey Lowerison
02/01/2023, 9:01 PMAsaf Cohen
02/01/2023, 9:01 PMAsaf Cohen
02/01/2023, 9:02 PMpermitted_topics
JWT claimTrey Lowerison
02/01/2023, 9:03 PMcreate.rego
and test_create.rego
are in the same directory. is there a way to mark certain files as being included or excluded from a certain topic so i can recursively omit test files?Trey Lowerison
02/01/2023, 9:05 PMAsaf Cohen
02/01/2023, 9:06 PMAsaf Cohen
02/01/2023, 9:06 PMTrey Lowerison
02/01/2023, 9:07 PMTrey Lowerison
02/01/2023, 9:08 PMopa build
or omit files using the manifest?Asaf Cohen
02/01/2023, 9:09 PMTrey Lowerison
02/01/2023, 9:10 PMAsaf Cohen
02/01/2023, 9:12 PMwith CommitViewer(commit) as viewer:
filter = lambda f: self._has_extension(f) and self._is_under_directories(f)
explicit_manifest = self._get_explicit_manifest(viewer)
logger.debug(f"Explicit manifest to be used: {explicit_manifest}")
for source_file in viewer.files(filter):
You can see that the bundle maker serves files from git.
And it passes a filter function to the CommitViewer.files
method.
All you need to do is:
1) create another method, similar to self._has_extension
that filters based on a regex.
2) create another config var for OPAL, similar to OPAL_OPA_FILE_EXTENSIONS
and pipe it's value all the way to the bundle maker 🙂Asaf Cohen
02/01/2023, 9:12 PMAsaf Cohen
02/01/2023, 9:14 PMfilter = lambda f: self._has_extension(f) and self._is_under_directories(f) and not self._matches_regex(f, exclude_regex)
Trey Lowerison
02/01/2023, 9:32 PMTrey Lowerison
02/01/2023, 9:32 PMTrey Lowerison
02/01/2023, 11:10 PMTrey Lowerison
02/01/2023, 11:11 PMAsaf Cohen
02/01/2023, 11:11 PMAsaf Cohen
02/01/2023, 11:12 PMTrey Lowerison
02/01/2023, 11:53 PM