From 318c5a7b686d167b84fec55c1621bb88a4b71dc2 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Thu, 12 Dec 2024 17:13:51 +0100 Subject: [PATCH] [#467] add `ServiceConfigurationStep` step --- docker/setup_configuration/data.yaml | 10 +++++++++- docs/installation/config_cli.rst | 23 +++++++++++++++++++++++ requirements/base.in | 1 + requirements/base.txt | 7 +++++-- requirements/ci.txt | 3 ++- requirements/dev.txt | 3 ++- src/objects/conf/base.py | 4 +++- 7 files changed, 45 insertions(+), 6 deletions(-) diff --git a/docker/setup_configuration/data.yaml b/docker/setup_configuration/data.yaml index eb1ae458..c2305559 100644 --- a/docker/setup_configuration/data.yaml +++ b/docker/setup_configuration/data.yaml @@ -1 +1,9 @@ -... +zgw_consumers_config_enable: true +zgw_consumers: + services: + - identifier: objecttypes-api + label: Objecttypes API + api_root: http://objecttypes.local/api/v1/ + api_connection_check_path: objecttypes + api_type: orc + auth_type: api_key diff --git a/docs/installation/config_cli.rst b/docs/installation/config_cli.rst index ac0dfcc1..910ef9e6 100644 --- a/docs/installation/config_cli.rst +++ b/docs/installation/config_cli.rst @@ -34,6 +34,29 @@ Objects API Objecttypes connection configuration ------------------------------------ +In order to be able to retrieve objecttypes, a corresponding ``Service`` should be +created. An example of a configuration could be seen below: + +.. code-block:: yaml + ... + + zgw_consumers_config_enable: true + zgw_consumers: + services: + - identifier: objecttypes-api-1 + label: Objecttypes API 1 + api_root: http://objecttypes-1.local/api/v1/ + api_connection_check_path: objecttypes + api_type: orc + auth_type: api_key + - identifier: objecttypes-api-2 + label: Objecttypes API 2 + api_root: http://objecttypes-2.local/api/v1/ + api_connection_check_path: objecttypes + api_type: orc + auth_type: api_key + .... + Tokens configuration ------------------- diff --git a/requirements/base.in b/requirements/base.in index 1912e5b4..8621c029 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -7,3 +7,4 @@ furl # Common ground libraries notifications-api-common +zgw-consumers[setup-configuration] diff --git a/requirements/base.txt b/requirements/base.txt index e6719118..716ada15 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -154,7 +154,9 @@ django-sendfile2==0.7.0 django-sessionprofile==3.0.0 # via open-api-framework django-setup-configuration==0.4.0 - # via open-api-framework + # via + # open-api-framework + # zgw-consumers django-simple-certmanager==1.4.1 # via zgw-consumers django-solo==2.2.0 @@ -364,8 +366,9 @@ webencodings==0.5.1 # via bleach wrapt==1.14.1 # via elastic-apm -zgw-consumers==0.35.1 +zgw-consumers[setup-configuration]==0.36.1 # via + # -r requirements/base.in # commonground-api-common # notifications-api-common # open-api-framework diff --git a/requirements/ci.txt b/requirements/ci.txt index 61b94b65..f7f994b2 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -243,6 +243,7 @@ django-setup-configuration==0.4.0 # via # -r requirements/base.txt # open-api-framework + # zgw-consumers django-simple-certmanager==1.4.1 # via # -r requirements/base.txt @@ -627,7 +628,7 @@ wrapt==1.14.1 # vcrpy yarl==1.9.4 # via vcrpy -zgw-consumers==0.35.1 +zgw-consumers[setup-configuration]==0.36.1 # via # -r requirements/base.txt # commonground-api-common diff --git a/requirements/dev.txt b/requirements/dev.txt index d065a802..6d358b47 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -258,6 +258,7 @@ django-setup-configuration==0.4.0 # via # -r requirements/base.txt # open-api-framework + # zgw-consumers django-simple-certmanager==1.4.1 # via # -r requirements/base.txt @@ -689,7 +690,7 @@ wrapt==1.14.1 # vcrpy yarl==1.9.4 # via vcrpy -zgw-consumers==0.35.1 +zgw-consumers[setup-configuration]==0.36.1 # via # -r requirements/base.txt # commonground-api-common diff --git a/src/objects/conf/base.py b/src/objects/conf/base.py index 3848b24f..8851e479 100644 --- a/src/objects/conf/base.py +++ b/src/objects/conf/base.py @@ -82,4 +82,6 @@ # # Django setup configuration # -SETUP_CONFIGURATION_STEPS = tuple() +SETUP_CONFIGURATION_STEPS = ( + "zgw_consumers.contrib.setup_configuration.steps.ServiceConfigurationStep", +)