Slackbot
04/25/2023, 11:37 AMFilip
04/25/2023, 11:39 AMAsaf Cohen
04/25/2023, 1:38 PMOPAL_REPO_WATCHER_ENABLED=false
That should display the policy tracking from opal serverThilak Reddy
04/25/2023, 1:57 PMOPAL_REPO_WATCHER_ENABLED
setting is only available for the server
The OPAL client still calls the server to fetch the policy bundle
Not sure if a similar setting exists for the client as wellAsaf Cohen
04/25/2023, 2:00 PMThilak Reddy
05/02/2023, 4:53 PMAsaf Cohen
05/03/2023, 8:33 AMAsaf Cohen
05/03/2023, 8:33 AMThilak Reddy
05/24/2023, 10:23 AMPolicyUpdater
based on an env variable, mentioned some points that i need help on
Can someone look at this pull request? https://github.com/permitio/opal/pull/470
Would appreciate help on how i can go about this 🙏Ro'e Katz
05/24/2023, 11:48 AMRo'e Katz
05/25/2023, 9:17 AMOPAL_DATA_SOURCES_CONFIG
?)
I think either way it’s possible to make the server not sync policy files to clients. For example:
1. Override OPAL_POLICY_REPO_POLICY_EXTENSIONS=[]
(How to detect policy files, [".rego"]
by default), or OPAL_FILTER_FILE_EXTENSIONS=[.json]
(general filter on the policy bundles, [.rego, .json]
by default).
a. If you don’t use a git repo for syncing data - you can point it to a dummy repo, or to our default OPAL_POLICY_REPO_URL=<https://github.com/permitio/opal-example-policy-repo.git>
.
b. You can set OPAL_POLICY_REPO_POLLING_INTERVAL=0
so server won’t even try to periodically check for updates.
2. Use OPAL_POLICY_SOURCE_TYPE=API
and point it to a server that serves empty bundles.
Even if those “workarounds” (though not really) aren’t enough, the right thing to do might be fixing the server to just serve empty bundles if OPAL_REPO_WATCHER_ENABLED=False
(instead of raising an error).
LMK what you think.Thilak Reddy
05/26/2023, 1:32 PMCan I ask how are you planning to sync data?I am using
OPAL_DATA_SOURCES_CONFIG
to load data and updates would be pushed to OPAL server through API
1. Workaround mentioned here are when i am tracking a git repo or loading bundles, which is not what i am trying to do, i don’t want to load or sync any policy files to clients
2. As i don’t want to fetch or load policies, doing this additional setup just to workaround the OPAL client health doesn’t sound like a good idea
might be fixing the server to just serve empty bundles ifIn any case when we are loading a bundle either empty or some dummy bundle, the policies loaded into OPAL client docker image during docker build are overridden by the loaded bundle from the server which is not the desired state, i would want the policies(a single policy file) i loaded into my OPAL client image to be the one being used So don’t serving empty bundles from any place solves the issue, it always overrides the policies present in the docker image(instead of raising an error).OPAL_REPO_WATCHER_ENABLED=False
But thinking about that again, I tend to prefer a solution that involves the server rather than the client -
after all it is the server where the user configures what should be trackedyup, but let’s consider a use case where the server is set to track a git repo for policy files but one or a subset of clients don’t want to receive those policy bundles/files, these clients are only interested in the data config sources and the data updates (git repo doesn’t have any data, contains only policies) and want to load policies during docker build instead of loading them from server In this scenario, not having an option on client to switch off policy loading/syncing would result in the OPAL client trying to fetch policy which will override the policies loaded into the docker image TLDR: server may or may not track a git repo, in any case the client should be able to choose to load/sync policies just like how it can choose to switch off data updates using
OPAL_DATA_UPDATER_ENABLED
I will reply on the PR with more details but i hope i made senseThilak Reddy
05/26/2023, 3:08 PMPolicyUpdater
is not initialised on client but server still broadcasts policy updates to the client even though i don’t see any log on client which subscribed to the policy topic policy:.
https://github.com/permitio/opal/pull/470#issuecomment-1564531702Ro'e Katz
05/28/2023, 10:16 AMRo'e Katz
05/28/2023, 3:51 PMThilak Reddy
05/28/2023, 6:20 PMOpaTransactionLogState.healthy
method
https://github.com/permitio/opal/pull/470#issuecomment-1566218232Ro'e Katz
05/29/2023, 10:25 AMThilak Reddy
05/29/2023, 11:47 AMRo'e Katz
05/29/2023, 2:53 PMThilak Reddy
05/29/2023, 2:53 PMThilak Reddy
05/29/2023, 2:57 PMRo'e Katz
05/30/2023, 8:08 AM