diff --git a/docs/conf.py b/docs/conf.py index 4247869c78..e9103bb4ac 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -42,6 +42,7 @@ "sphinx.ext.intersphinx", "sphinx_tabs.tabs", "sphinxcontrib.mermaid", + "django_setup_configuration.documentation.setup_config_example", ] # Add any paths that contain templates here, relative to this directory. @@ -82,6 +83,10 @@ "https://objects-and-objecttypes-api.readthedocs.io/en/stable/", None, ), + "django-setup-configuration": ( + "https://django-setup-configuration.readthedocs.io/en/stable/", + None, + ), } # -- Options for HTML output ------------------------------------------------- diff --git a/docs/installation/setup_configuration.rst b/docs/installation/setup_configuration.rst index 249c942aa2..69799711b9 100644 --- a/docs/installation/setup_configuration.rst +++ b/docs/installation/setup_configuration.rst @@ -5,48 +5,48 @@ Open Forms configuration (CLI) ============================== After deploying Open Forms, it needs to be configured to be fully functional. The -command line tool ``setup_configuration`` assist with this configuration by loading a +command line tool ``setup_configuration`` assists with this configuration by loading a YAML file in which the configuration information is specified. -You can get the full command documentation with: +For general information on how the command line tool works, refer to the +:external+django-setup-configuration:ref:`documentation `. -.. code-block:: bash +Below are example configurations for all the configuration steps this application provides. +They can be used as a starting point and combined into a single YAML to use as input for the command. - src/manage.py setup_configuration --help +.. warning:: + The values in the following YAML examples contain defaults and in some case dummy values, make sure to edit + values of i.e. identifiers, secrets and other fields that have dummy values! -.. warning:: This command is declarative - if configuration is manually changed after - running the command and you then run the exact same command again, the manual - changes will be reverted. +OpenID Connect configuration for admin authentication +----------------------------------------------------- -Preparation -=========== - -The command executes the list of pluggable configuration steps, and each step -requires specific configuration information, that should be prepared. -Here is the description of all available configuration steps and the shape of the data, -used by each step. +.. autoclass:: mozilla_django_oidc_db.setup_configuration.steps.AdminOIDCConfigurationStep + :noindex: +.. setup-config-example:: mozilla_django_oidc_db.setup_configuration.steps.AdminOIDCConfigurationStep Services configuration ---------------------- -TODO: add generated documentation for ``zgw_consumers.ServiceConfigurationStep`` +.. autoclass:: zgw_consumers.contrib.setup_configuration.steps.ServiceConfigurationStep + :noindex: + +.. setup-config-example:: zgw_consumers.contrib.setup_configuration.steps.ServiceConfigurationStep + Objects API registration configuration -------------------------------------- -TODO: add generated documentation for ``ObjectsAPIConfigurationStep`` - -Execution -========= +.. autoclass:: openforms.contrib.objects_api.setup_configuration.steps.ObjectsAPIConfigurationStep + :noindex: -Open Forms configuration ------------------------- +.. setup-config-example:: openforms.contrib.objects_api.setup_configuration.steps.ObjectsAPIConfigurationStep -With the full command invocation, all defined configuration steps are applied. Each step is idempotent, -so it's safe to run the command multiple times. The steps will overwrite any manual changes made in -the admin if you run the command after making these changes. +ZGW APIs registration configuration +----------------------------------- -.. code-block:: bash +.. autoclass:: openforms.registrations.contrib.zgw_apis.setup_configuration.steps.ZGWApiConfigurationStep + :noindex: - src/manage.py setup_configuration +.. setup-config-example:: openforms.registrations.contrib.zgw_apis.setup_configuration.steps.ZGWApiConfigurationStep diff --git a/requirements/base.txt b/requirements/base.txt index a3517dfea6..f378e5deba 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -199,7 +199,7 @@ django-sendfile2==0.7.1 # via django-privates django-sessionprofile==2.0.0 # via django-digid-eherkenning -django-setup-configuration==0.4.0 +django-setup-configuration==0.6.0 # via # mozilla-django-oidc-db # zgw-consumers @@ -235,6 +235,8 @@ djangorestframework==3.15.2 # drf-spectacular djangorestframework-camel-case==1.4.2 # via -r requirements/base.in +docutils==0.21.2 + # via django-setup-configuration drf-jsonschema-serializer==3.0.0 # via -r requirements/base.in drf-nested-routers==0.93.4 @@ -331,7 +333,7 @@ maykin-python3-saml==1.16.1 # via django-digid-eherkenning mozilla-django-oidc==4.0.0 # via mozilla-django-oidc-db -mozilla-django-oidc-db==0.21.1 +mozilla-django-oidc-db==0.22.0 # via # -r requirements/base.in # django-digid-eherkenning @@ -467,8 +469,12 @@ rpds-py==0.18.0 # referencing rstr==3.2.2 # via schwifty -ruamel-yaml==0.18.6 - # via prance +ruamel-yaml==0.18.10 + # via + # django-setup-configuration + # prance +ruamel-yaml-clib==0.2.12 + # via ruamel-yaml schwifty==2024.5.3 # via -r requirements/base.in self-certifi==1.0.0 @@ -565,7 +571,7 @@ xmltodict==0.12.0 # via -r requirements/base.in zeep==4.2.1 # via -r requirements/base.in -zgw-consumers==0.36.0 +zgw-consumers==0.37.0 # via -r requirements/base.in zopfli==0.2.3 # via fonttools diff --git a/requirements/ci.txt b/requirements/ci.txt index da94954007..db677d2470 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -344,7 +344,7 @@ django-sessionprofile==2.0.0 # -c requirements/base.txt # -r requirements/base.txt # django-digid-eherkenning -django-setup-configuration==0.4.0 +django-setup-configuration==0.6.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -399,8 +399,11 @@ djangorestframework-camel-case==1.4.2 # via # -c requirements/base.txt # -r requirements/base.txt -docutils==0.20.1 +docutils==0.21.2 # via + # -c requirements/base.txt + # -r requirements/base.txt + # django-setup-configuration # sphinx # sphinx-rtd-theme # sphinx-tabs @@ -607,7 +610,7 @@ mozilla-django-oidc==4.0.0 # -c requirements/base.txt # -r requirements/base.txt # mozilla-django-oidc-db -mozilla-django-oidc-db==0.21.1 +mozilla-django-oidc-db==0.22.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -898,11 +901,17 @@ rstr==3.2.2 # -c requirements/base.txt # -r requirements/base.txt # schwifty -ruamel-yaml==0.18.6 +ruamel-yaml==0.18.10 # via # -c requirements/base.txt # -r requirements/base.txt + # django-setup-configuration # prance +ruamel-yaml-clib==0.2.12 + # via + # -c requirements/base.txt + # -r requirements/base.txt + # ruamel-yaml schwifty==2024.5.3 # via # -c requirements/base.txt @@ -955,7 +964,7 @@ sphinx==7.3.0 # sphinx-rtd-theme # sphinx-tabs # sphinxcontrib-jquery -sphinx-rtd-theme==2.0.0 +sphinx-rtd-theme==3.0.2 # via -r requirements/docs.in sphinx-tabs==3.4.5 # via -r requirements/docs.in @@ -1119,7 +1128,7 @@ zeep==4.2.1 # via # -c requirements/base.txt # -r requirements/base.txt -zgw-consumers==0.36.0 +zgw-consumers==0.37.0 # via # -c requirements/base.txt # -r requirements/base.txt diff --git a/requirements/dev.txt b/requirements/dev.txt index beb7f6d8c2..4824440852 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -373,7 +373,7 @@ django-sessionprofile==2.0.0 # -c requirements/ci.txt # -r requirements/ci.txt # django-digid-eherkenning -django-setup-configuration==0.4.0 +django-setup-configuration==0.6.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -431,10 +431,11 @@ djangorestframework-camel-case==1.4.2 # via # -c requirements/ci.txt # -r requirements/ci.txt -docutils==0.20.1 +docutils==0.21.2 # via # -c requirements/ci.txt # -r requirements/ci.txt + # django-setup-configuration # sphinx # sphinx-rtd-theme # sphinx-tabs @@ -673,7 +674,7 @@ mozilla-django-oidc==4.0.0 # -c requirements/ci.txt # -r requirements/ci.txt # mozilla-django-oidc-db -mozilla-django-oidc-db==0.21.1 +mozilla-django-oidc-db==0.22.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -998,11 +999,17 @@ rstr==3.2.2 # -c requirements/ci.txt # -r requirements/ci.txt # schwifty -ruamel-yaml==0.18.6 +ruamel-yaml==0.18.10 # via # -c requirements/ci.txt # -r requirements/ci.txt + # django-setup-configuration # prance +ruamel-yaml-clib==0.2.12 + # via + # -c requirements/ci.txt + # -r requirements/ci.txt + # ruamel-yaml schwifty==2024.5.3 # via # -c requirements/ci.txt @@ -1064,7 +1071,7 @@ sphinx==7.3.0 # sphinx-rtd-theme # sphinx-tabs # sphinxcontrib-jquery -sphinx-rtd-theme==2.0.0 +sphinx-rtd-theme==3.0.2 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -1281,7 +1288,7 @@ zeep==4.2.1 # via # -c requirements/ci.txt # -r requirements/ci.txt -zgw-consumers==0.36.0 +zgw-consumers==0.37.0 # via # -c requirements/ci.txt # -r requirements/ci.txt diff --git a/requirements/extensions.txt b/requirements/extensions.txt index a62c53ecc0..b5eff2b9cc 100644 --- a/requirements/extensions.txt +++ b/requirements/extensions.txt @@ -330,7 +330,7 @@ django-sessionprofile==2.0.0 # -c requirements/base.txt # -r requirements/base.txt # django-digid-eherkenning -django-setup-configuration==0.4.0 +django-setup-configuration==0.6.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -382,6 +382,11 @@ djangorestframework-camel-case==1.4.2 # via # -c requirements/base.txt # -r requirements/base.txt +docutils==0.21.2 + # via + # -c requirements/base.txt + # -r requirements/base.txt + # django-setup-configuration drf-jsonschema-serializer==3.0.0 # via # -c requirements/base.txt @@ -555,7 +560,7 @@ mozilla-django-oidc==4.0.0 # -c requirements/base.txt # -r requirements/base.txt # mozilla-django-oidc-db -mozilla-django-oidc-db==0.21.1 +mozilla-django-oidc-db==0.22.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -809,11 +814,17 @@ rstr==3.2.2 # -c requirements/base.txt # -r requirements/base.txt # schwifty -ruamel-yaml==0.18.6 +ruamel-yaml==0.18.10 # via # -c requirements/base.txt # -r requirements/base.txt + # django-setup-configuration # prance +ruamel-yaml-clib==0.2.12 + # via + # -c requirements/base.txt + # -r requirements/base.txt + # ruamel-yaml schwifty==2024.5.3 # via # -c requirements/base.txt @@ -979,7 +990,7 @@ zeep==4.2.1 # via # -c requirements/base.txt # -r requirements/base.txt -zgw-consumers==0.36.0 +zgw-consumers==0.37.0 # via # -c requirements/base.txt # -r requirements/base.txt diff --git a/requirements/type-checking.txt b/requirements/type-checking.txt index 0d3beb380d..61646e6c6f 100644 --- a/requirements/type-checking.txt +++ b/requirements/type-checking.txt @@ -362,7 +362,7 @@ django-sessionprofile==2.0.0 # -c requirements/ci.txt # -r requirements/ci.txt # django-digid-eherkenning -django-setup-configuration==0.4.0 +django-setup-configuration==0.6.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -428,10 +428,11 @@ djangorestframework-camel-case==1.4.2 # -r requirements/ci.txt djangorestframework-stubs==3.15.0 # via -r requirements/type-checking.in -docutils==0.20.1 +docutils==0.21.2 # via # -c requirements/ci.txt # -r requirements/ci.txt + # django-setup-configuration # sphinx # sphinx-rtd-theme # sphinx-tabs @@ -664,7 +665,7 @@ mozilla-django-oidc==4.0.0 # -c requirements/ci.txt # -r requirements/ci.txt # mozilla-django-oidc-db -mozilla-django-oidc-db==0.21.1 +mozilla-django-oidc-db==0.22.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -986,11 +987,17 @@ rstr==3.2.2 # -c requirements/ci.txt # -r requirements/ci.txt # schwifty -ruamel-yaml==0.18.6 +ruamel-yaml==0.18.10 # via # -c requirements/ci.txt # -r requirements/ci.txt + # django-setup-configuration # prance +ruamel-yaml-clib==0.2.12 + # via + # -c requirements/ci.txt + # -r requirements/ci.txt + # ruamel-yaml schwifty==2024.5.3 # via # -c requirements/ci.txt @@ -1050,7 +1057,7 @@ sphinx==7.3.0 # sphinx-rtd-theme # sphinx-tabs # sphinxcontrib-jquery -sphinx-rtd-theme==2.0.0 +sphinx-rtd-theme==3.0.2 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -1285,7 +1292,7 @@ zeep==4.2.1 # via # -c requirements/ci.txt # -r requirements/ci.txt -zgw-consumers==0.36.0 +zgw-consumers==0.37.0 # via # -c requirements/ci.txt # -r requirements/ci.txt diff --git a/src/openapi.yaml b/src/openapi.yaml index 679fc52758..709ecb96bd 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -9729,6 +9729,8 @@ components: apiRoot: type: string title: Api root url + description: The root URL of the service that will be used to construct + the URLs when making requests. maxLength: 255 apiType: allOf: diff --git a/src/openforms/contrib/objects_api/setup_configuration/models.py b/src/openforms/contrib/objects_api/setup_configuration/models.py index 4b9eb76ff8..4bd4d1db6c 100644 --- a/src/openforms/contrib/objects_api/setup_configuration/models.py +++ b/src/openforms/contrib/objects_api/setup_configuration/models.py @@ -7,30 +7,33 @@ class SingleObjectsAPIGroupConfigModel(ConfigurationModel): objects_service_identifier: str = DjangoModelRef( - ObjectsAPIGroupConfig, "objects_service" + ObjectsAPIGroupConfig, "objects_service", examples=["objects-api"] ) objecttypes_service_identifier: str = DjangoModelRef( - ObjectsAPIGroupConfig, "objecttypes_service" + ObjectsAPIGroupConfig, "objecttypes_service", examples=["objecttypes-api"] ) documenten_service_identifier: str = DjangoModelRef( - ObjectsAPIGroupConfig, "drc_service", default="" + ObjectsAPIGroupConfig, "drc_service", default="", examples=["documenten-api"] ) catalogi_service_identifier: str = DjangoModelRef( - ObjectsAPIGroupConfig, "catalogi_service", default="" + ObjectsAPIGroupConfig, "catalogi_service", default="", examples=["catalogi-api"] ) # Renamed to be more descriptive document_type_submission_report: str = DjangoModelRef( ObjectsAPIGroupConfig, "iot_submission_report", + examples=["PDF Informatieobjecttype"], ) document_type_submission_csv: str = DjangoModelRef( ObjectsAPIGroupConfig, "iot_submission_csv", + examples=["CSV Informatieobjecttype"], ) document_type_attachment: str = DjangoModelRef( ObjectsAPIGroupConfig, "iot_attachment", + examples=["Attachment Informatieobjecttype"], ) class Meta: @@ -43,7 +46,14 @@ class Meta: "organisatie_rsin", ] } + extra_kwargs = { + "identifier": {"examples": ["objects-api-acceptance"]}, + "name": {"examples": ["Objecten acceptance environment"]}, + "catalogue_domain": {"examples": ["ABCD"]}, + "catalogue_rsin": {"examples": ["111222333"]}, + "organisatie_rsin": {"examples": ["123456782"]}, + } class ObjectsAPIGroupConfigModel(ConfigurationModel): - groups: list[SingleObjectsAPIGroupConfigModel] = Field(default_factory=list) + groups: list[SingleObjectsAPIGroupConfigModel] = Field() diff --git a/src/openforms/contrib/objects_api/setup_configuration/steps.py b/src/openforms/contrib/objects_api/setup_configuration/steps.py index 34e6baa667..09742d45a5 100644 --- a/src/openforms/contrib/objects_api/setup_configuration/steps.py +++ b/src/openforms/contrib/objects_api/setup_configuration/steps.py @@ -19,7 +19,8 @@ def get_service(slug: str) -> Service: class ObjectsAPIConfigurationStep(BaseConfigurationStep[ObjectsAPIGroupConfigModel]): """ - Configure configuration groups for the Objects API backend + Configure groups for the Objects API backend. This step uses identifiers to refer to + Services that should be loaded by the previous step that loads Services. """ verbose_name = "Configuration to set up Objects API registration backend services" diff --git a/src/openforms/registrations/contrib/zgw_apis/migrations/0019_alter_zgwapigroupconfig_auteur.py b/src/openforms/registrations/contrib/zgw_apis/migrations/0019_alter_zgwapigroupconfig_auteur.py new file mode 100644 index 0000000000..c5cfbc17f8 --- /dev/null +++ b/src/openforms/registrations/contrib/zgw_apis/migrations/0019_alter_zgwapigroupconfig_auteur.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.18 on 2025-01-27 15:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("zgw_apis", "0018_alter_zgwapigroupconfig_drc_service_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="zgwapigroupconfig", + name="auteur", + field=models.CharField( + default="Aanvrager", + help_text="The value of the `author` field for documents that will be created in Documenten API.", + max_length=200, + verbose_name="auteur", + ), + ), + ] diff --git a/src/openforms/registrations/contrib/zgw_apis/models.py b/src/openforms/registrations/contrib/zgw_apis/models.py index aa9f6f8f6d..6a866f7bf3 100644 --- a/src/openforms/registrations/contrib/zgw_apis/models.py +++ b/src/openforms/registrations/contrib/zgw_apis/models.py @@ -142,6 +142,9 @@ class ZGWApiGroupConfig(models.Model): ) auteur = models.CharField( _("auteur"), + help_text=_( + "The value of the `author` field for documents that will be created in Documenten API." + ), max_length=200, default="Aanvrager", ) diff --git a/src/openforms/registrations/contrib/zgw_apis/setup_configuration/models.py b/src/openforms/registrations/contrib/zgw_apis/setup_configuration/models.py index 83520aa272..090d132d2d 100644 --- a/src/openforms/registrations/contrib/zgw_apis/setup_configuration/models.py +++ b/src/openforms/registrations/contrib/zgw_apis/setup_configuration/models.py @@ -21,16 +21,6 @@ class SingleZGWApiGroupConfigModel(ConfigurationModel): ZGWApiGroupConfig, "content_json" ) - # FIXME choices and blank=True doesn't seem to be picked up properly - zaak_vertrouwelijkheidaanduiding: str = DjangoModelRef( - ZGWApiGroupConfig, - "zaak_vertrouwelijkheidaanduiding", - default="", - ) - doc_vertrouwelijkheidaanduiding: str = DjangoModelRef( - ZGWApiGroupConfig, "doc_vertrouwelijkheidaanduiding", default="" - ) - class Meta: django_model_refs = { ZGWApiGroupConfig: [ @@ -40,9 +30,18 @@ class Meta: "catalogue_rsin", "organisatie_rsin", "auteur", + "zaak_vertrouwelijkheidaanduiding", + "doc_vertrouwelijkheidaanduiding", ] } + extra_kwargs = { + "identifier": {"examples": ["open-zaak-acceptance"]}, + "name": {"examples": ["Open Zaak acceptance environment"]}, + "catalogue_domain": {"examples": ["ABCD"]}, + "catalogue_rsin": {"examples": ["111222333"]}, + "organisatie_rsin": {"examples": ["123456782"]}, + } class ZGWApiGroupConfigModel(ConfigurationModel): - groups: list[SingleZGWApiGroupConfigModel] = Field(default_factory=list) + groups: list[SingleZGWApiGroupConfigModel] = Field() diff --git a/src/openforms/registrations/contrib/zgw_apis/setup_configuration/steps.py b/src/openforms/registrations/contrib/zgw_apis/setup_configuration/steps.py index f803e0fb7b..dbdff4c40c 100644 --- a/src/openforms/registrations/contrib/zgw_apis/setup_configuration/steps.py +++ b/src/openforms/registrations/contrib/zgw_apis/setup_configuration/steps.py @@ -19,7 +19,8 @@ def get_service(slug: str) -> Service: class ZGWApiConfigurationStep(BaseConfigurationStep[ZGWApiGroupConfigModel]): """ - Configure configuration groups for the ZGW API backend + Configure groups for the ZGW APIs registration backend. This step uses identifiers to refer to + Services that should be loaded by the previous step that loads Services. """ verbose_name = "Configuration to set up ZGW API registration backend services" @@ -41,8 +42,8 @@ def execute(self, model: ZGWApiGroupConfigModel): "catalogue_domain": config.catalogue_domain, # type: ignore "catalogue_rsin": config.catalogue_rsin, # type: ignore "organisatie_rsin": config.organisatie_rsin, # type: ignore - "zaak_vertrouwelijkheidaanduiding": config.zaak_vertrouwelijkheidaanduiding, - "doc_vertrouwelijkheidaanduiding": config.doc_vertrouwelijkheidaanduiding, + "zaak_vertrouwelijkheidaanduiding": config.zaak_vertrouwelijkheidaanduiding, # type: ignore + "doc_vertrouwelijkheidaanduiding": config.doc_vertrouwelijkheidaanduiding, # type: ignore "auteur": config.auteur, # type: ignore "content_json": config.objects_api_json_content_template, }