Skip to content

Commit

Permalink
Merge branch 'feature/467-objecttypes-setup-config' into feature/486-…
Browse files Browse the repository at this point in the history
…token-setup-config
  • Loading branch information
danielmursa-dev committed Dec 11, 2024
2 parents 9cda2c1 + 9615bcf commit c00257d
Show file tree
Hide file tree
Showing 18 changed files with 203 additions and 304 deletions.
45 changes: 12 additions & 33 deletions docs/installation/config_cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Create or update a (single) YAML configuration file with your settings:
.. code-block:: yaml
...
sites_config_enable: true
sites:
sites_config:
items:
- domain: example.com
name: Example site
Expand All @@ -51,44 +51,23 @@ Create or update a (single) YAML configuration file with your settings:
.. note:: The ``domain`` field will be used to lookup existing ``Site``'s.

Objecttypes configuration
Objecttypes connection configuration
-------------------------

Create or update a (single) YAML configuration file with your settings:

.. code-block:: yaml
objects_api_objecttypes_connection_config_enable: true
objects_api_objecttypes_connection":
identifier: objecttypen
label: ObjectTypen API
api_root: http://objecttypen.nl/api/v1/
api_connection_check_path: objecttypes
api_type: orc
auth_type: api_key
header_key: Authorization
header_value: Token foo
...
zgw_consumers_config_enable: true
zgw_consumers:
services:
- identifier: objecttypen-foo
label: Objecttypen API Foo
api_root: http://objecttypen.foo/api/v1/
api_type: orc
auth_type: api_key
- identifier: objecttypen-bar
label: Objecttypen API Bar
api_root: http://objecttypen.bar/api/v1/
api_type: orc
auth_type: api_key
objecttypes_config_enable: true
objecttypes:
items:
- uuid: b427ef84-189d-43aa-9efd-7bb2c459e281
name: Object Type 1
service_identifier: objecttypen-foo
- uuid: b0e8553f-8b1a-4d55-ab90-6d02f1bcf2c2
name: Object Type 2
service_identifier: objecttypen-bar
...
.. note:: The ``uuid`` field will be used to lookup existing ``ObjectType``'s.

Objecttypes require a corresponding ``Service`` to work correctly. Creating
these ``Service``'s can be done by defining these in the same yaml file. ``Service``
instances will be created before the ``ObjectType``'s are created.
Execution
Expand Down
2 changes: 1 addition & 1 deletion src/objects/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@
"zgw_consumers.contrib.setup_configuration.steps.ServiceConfigurationStep",
"objects.setup_configuration.steps.token_auth.TokenAuthConfigurationStep",
"objects.setup_configuration.steps.sites.SitesConfigurationStep",
"objects.setup_configuration.steps.objecttypes.ObjectTypesConfigurationStep",
"objects.setup_configuration.steps.objecttypes.ObjectTypesConnectionConfigurationStep",
)
16 changes: 16 additions & 0 deletions src/objects/core/tests/files/objecttypes_connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
objects_api_objecttypes_connection_config_enable: true
objects_api_objecttypes_connection:
identifier: objecttypes-api
label: Objecttypen API
api_root: https://objecttypes.nl/api/v1/
api_connection_check_path: objecttypes
api_type: orc
auth_type: zgw
header_key: Authorization
header_value: Token foo
client_id: client
secret: secret
nlx: http://some-outway-adress.local:8080/
user_id: objects-api
user_representation: Objects API
timeout: 60
16 changes: 16 additions & 0 deletions src/objects/core/tests/files/objecttypes_connection_invalid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
objects_api_objecttypes_connection_config_enable: true
objects_api_objecttypes_connection:
identifier: identifier with whitespace in between
label: Objecttypen API
api_root: https://objecttypes.nl/api/v1/
api_connection_check_path: objectttypes
api_type: orc
auth_type: zgw
header_key: Authorization
header_value: Token foo
client_id: client
secret: super-secret
nlx: http://some-outway-adress.local:8080/
user_id: objects-api
user_representation: Objects API
timeout: 60
10 changes: 0 additions & 10 deletions src/objects/core/tests/files/objecttypes_empty_database.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions src/objects/core/tests/files/objecttypes_existing_objecttype.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions src/objects/core/tests/files/objecttypes_idempotent.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions src/objects/core/tests/files/objecttypes_invalid_uuid.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions src/objects/core/tests/files/objecttypes_unknown_service.yaml

This file was deleted.

Loading

0 comments on commit c00257d

Please sign in to comment.