How to read data from API, DB, external services, etc.? #89
-
Based on OPAL architecture, However, the docker compose demo seems I found a
this is only for initial fetching data or after long disconnection. So my question is how to read data from API, DB, external services, etc.? Thanks Question 1 In the demo, it is
But how does it know the policy filename is Question 2 What if we want to read data from different places like API, DB, external services, etc. that are different with policy in git repo?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi :) "seems opal-server read both data and policy from same repo" how to read data from API, DB, external services, etc.? OPAL currently comes with an HTTP based data fetcher (e.g. good for http API calls) To add more types of data fetchers you can implement them as detailed in this guide Question 1: In the updates themselves The clients will receive new sources to fetch data as part of the update - these don't (and probably shouldn't) have to be the same ones as in the static data provided in the repo. Question 2: |
Beta Was this translation helpful? Give feedback.
-
Hey @hongbo-miao, you asked a lot of important questions - i'll try to be detailed so that others reading this may also benefit. OPAL clients have two distinct types of data sources:
Q: What are
|
Beta Was this translation helpful? Give feedback.
Hi :)
"seems opal-server read both data and policy from same repo"
Just like with OPA bundles you can include data (aka static data)
how to read data from API, DB, external services, etc.?
By providing a DataSourceEntry as part of a DataUpdate (aka an update event) you can instruct OPAL-clients to use their data-fetchers to retrieve data from multiple sources.
You can trigger such an event using the CLI as shown here
And you can write your own code to create other DataUpdates of your choice.
OPAL currently comes with an HTTP based data fetcher (e.g. good for http API calls) To add more types of data fetchers you can implement them as detailed in this guide
Question 1:
The opal-server sea…