Skip to content

Commit

Permalink
Merge pull request #458 from permitio/rk/doc-periodic-update-interval
Browse files Browse the repository at this point in the history
Docs: Add periodic_update_interval to data-sources.mdx
  • Loading branch information
roekatz committed May 9, 2023
2 parents 9d137b3 + 959381e commit 6bb42e4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Let's break down this example value (check the [schema](https://github.com/permi
Each object in `entries` (schema: [DataSourceEntry](https://github.com/permitio/opal/blob/master/packages/opal-common/opal_common/schemas/data.py#L8)) is a **directive** that tells OPAL client to fetch the data and place it in OPA cache using the [Data API](https://www.openpolicyagent.org/docs/latest/rest-api/#data-api).

- **From where to fetch:** we tell OPAL client to fetch data from the [Permit.io API](https://api.permit.io/redoc) (specifically, from the `policy-config` endpoint).
- **how to fetch (optional):** we can direct the client to use a specific configuration when fetching the data, for example here we tell the client to use a specific HTTP Authorization header with a bearer token in order to authenticate to the API.
- **How to fetch (optional):** we can direct the client to use a specific configuration when fetching the data, for example here we tell the client to use a specific HTTP Authorization header with a bearer token in order to authenticate to the API.
- **Where to place the data in OPA cache:** although not specified, this entry uses the default of `/` which means at the root of OPA document hierarchy. You can specify another path with `dst_path` (check the [schema](https://github.com/permitio/opal/blob/master/packages/opal-common/opal_common/schemas/data.py#L8)).
- **Which clients should fetch:** the entry would be processed only by clients subscribed to one of the specified topics. (If unspecified, the default `policy_data` topic would be used).

- **How often to fetch:** entry that has the `periodic_update_interval` value would be periodically pushed to clients with that interval (in secs), so they can keep refetching the most updated data from specified source.
#### Encoding this value in an environment variable:

You can use the python method of `json.dumps()` to get a one line string:
Expand Down

0 comments on commit 6bb42e4

Please sign in to comment.