You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/HOWTO/write_your_own_fetch_provider.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,14 @@ The guide has 3 main parts:
6
6
1)[Background](#background) - explains why we need custom fetch providers, gives examples for use cases and explains what fetch providers are.
7
7
2)[Writing your own fetch provider](#writing-providers) - step-by-step explanation how to write your own fetch provider.
8
8
3)[Using a custom fetch provider](#using-providers) - given a custom fetch provider (either published by someone else or written by you), shows how to use the provider in your own OPAL setup.
9
+
10
+
## TL;DR
11
+
This tutorial is long and detailed, but the gist of it is:
12
+
* All Fetch Providers are simply python classes that derive from [BaseFetchProvider](https://github.com/authorizon/opal/blob/master/opal_common/fetcher/fetch_provider.py#L9).
13
+
* You need to implement the fetching logic in `_fetch_()` and optionally `_process_()`.
14
+
* Once you finish implementing your provider, you can publish it as a pip package. You can then tell OPAL to use it with the configuration env var `OPAL_FETCH_PROVIDER_MODULES`.
15
+
* We created a well-documented [example fetch provider for Postgres SQL](https://github.com/authorizon/opal-fetcher-postgres). If you prefer to learn from a real code example you can simply clone it and play with it.
16
+
9
17
## <aname="background"></a>Background
10
18
11
19
One of the core features of OPAL (besides realtime syncing of authorization state) is the ability to **aggregate state** from multiple data sources into OPA.
0 commit comments