This message was deleted.
# opal
s
This message was deleted.
o
Hi @Oscar, yes you can have opal update different values in OPA's data from different sources. Just map out the sub keys so you don't have data merge conflicts
o
We are using
OPAL_POLICY_REPO_URL
to load data and policy. How to connect database?
o
E.g. you could have
data.roles
come from git (i.e.
/roles/data.json
) but
data.users
come from a DB.
o
As for the example of RBAC, we may define the data in DB, both users and roles. Now we want to OPAL can connect to the DB and load the data.
Copy code
{
    "user_roles": {
        "alice": [
            "admin"
        ],
        "bob": [
            "employee",
            "billing"
        ],......
    "role_grants": {
        "customer": [
            {
                "action": "read",
                "type": "dog"
            },......
        ],
        "employee": [
            {
                "action": "read",
                "type": "dog"
            },......
        ],
        "billing": [
            {
                "action": "read",
                "type": "finance"
            },.....
        ]
    }
}
🤘 1
I don't know how to load the data from DB and put them into OPAL. Shall I configure
OPAL_POLICY_REPO_URL
or
OPAL_DATA_CONFIG_SOURCES
? Or something like data source?
o
o
Thanks. Let me have a look.