dump-things-service/dump_things_service/tests/assets/policy_info.json
Christian Monch 95594660fd feat: move policy info out of configuration
This commit removes the configuration keys:

- default_policy
- policy_annotation_tag
- policy_mapping

and adds the key:

- policy_info_location

The key `policy_info_location` optionally contain
a URL from which policy information is read.

The commit also adds the endpoint

GET /management/reload/policy_info/{collection}

The endpoint allows to reload policy information
from either the configured location of from a
location given in the query-parameter `url`.

The endpoint requires a CURATOR-token.

Policy information is a JSON-representation
of a `dump-things-service.abstract_config.PolicyInfo`
object. For example:

{
  "default_policy": "abc:policy_abc",
  "policy_annotation_tag": "https://example.org/dumpthings/policy_set",
  "policy_mapping": [
    {
      "auth_source": "config",
      "user_id": "user_all",
      "authorized_by": [
        "abc:policy_abc",
        "policy_1"
      ]
    },
    {
      "auth_source": "some_other_source",
      "user_id": "test_user_2",
      "authorized_by": [
        "https://examples.com/policy_example_2",
        "abc:policy_def"
      ]
    }
  ]
}
2026-10-02 13:30:43 +02:00

52 lines
1.1 KiB
JSON

{
"default_policy": "abc:policy_abc",
"policy_annotation_tag": "https://example.org/dumpthings/policy_set",
"policy_mapping": [
{
"auth_source": "config",
"user_id": "basic_access_user",
"authorized_by": [
"abc:policy_abc",
"policy_1"
]
},
{
"auth_source": "config",
"user_id": "user_all",
"authorized_by": [
"abc:policy_abc",
"policy_1"
]
},
{
"auth_source": "config",
"user_id": "test_user_1",
"authorized_by": [
"https://examples.com/policy_example_1",
"abc:policy_abc"
]
},
{
"auth_source": "some_other_source",
"user_id": "test_user_2",
"authorized_by": [
"https://examples.com/policy_example_2",
"abc:policy_def"
]
},
{
"auth_source": "config",
"user_id": "test_user_8_default_policy",
"authorized_by": [
"abc:policy_abc"
]
},
{
"auth_source": "config",
"user_id": "test_user_8_policy_1",
"authorized_by": [
"policy_1"
]
}
]
}