dump-things-service/dump_things_service/tests/assets/reference_config.yaml
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

103 lines
2.5 KiB
YAML

pid: dump_things:config
type: collections
version: 2
collections:
collection_1:
schema: http://example.com/schema
curated: curated/collection_1
incoming: incoming/collection_1
default_token: test_default_token
ignore_classes: []
use_classes: []
audit_backends:
- auto_flush_timeout: 2
path: /tmp/audit_store0
type: gitaudit
auth_sources:
- type: config
- type: forgejo
url: http://example.com/forgejo1/api/v1
organization: example_org
team: team_1
label_type: user
instance_id: forgejo-instance_1
- type: forgejo
url: http://example.com/forgejo2/api/v1
organization: example_org
team: team_2
label_type: user
instance_id: forgejo-instance_2
- type: config
backend:
mapping_method: digest-md5
type: record_dir+stl
policy_info_location: http://example.com/policy_location.json
submission_tags:
submission_time_tag: http://semanticscience.org/resource/SIO_001083
submitter_id_tag: http://purl.obolibrary.org/obo/NCIT_C54269
tokens:
Test 00000 (NOTHING):
collections:
collection_1:
incoming_label: modes
mode: NOTHING
hashed: false
representation: token_1_ooooo
user_id: test_user_1_nothing
Test 00X00 (SUBMIT_ONLY):
collections:
collection_1:
incoming_label: modes
mode: SUBMIT_ONLY
hashed: false
representation: token_1_ooxoo
user_id: test_user_1_submit_only
Test 0X000 (READ_SUBMISSIONS):
collections:
collection_1:
incoming_label: modes
mode: READ_SUBMISSIONS
hashed: false
representation: token_1_oxooo
user_id: test_user_1_read_submissions
Test 0XX00 (WRITE_SUBMISSIONS):
collections:
collection_1:
incoming_label: modes
mode: WRITE_SUBMISSIONS
hashed: false
representation: token_1_oxxoo
user_id: test_user_1_write_submissions
Test Curator Token:
collections:
collection_1:
incoming_label: admin_1
mode: CURATOR
hashed: false
representation: token_curator
user_id: test_curator
Test Hashed Token:
collections:
collection_1:
incoming_label: token-hashed-1
mode: WRITE_COLLECTION
hashed: false
representation: token-hashed
user_id: test_hashed
test_default_token:
collections:
collection_1:
incoming_label: ''
mode: READ_CURATED
hashed: false
representation: basic_access
user_id: basic_access_user
admin_tokens: {}