-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/485-tokenauth-setup-config
- Loading branch information
Showing
17 changed files
with
462 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,32 +26,56 @@ 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 configuration | ||
format, used by each step. | ||
format, use by each step. | ||
|
||
Objects API | ||
=========== | ||
|
||
Sites configuration | ||
------------------- | ||
Objecttypes configuration | ||
------------------------- | ||
|
||
Create or update a (single) YAML configuration file with your settings: | ||
To configure objecttypes the following configuration could be used: | ||
|
||
.. code-block:: yaml | ||
... | ||
sites_config_enable: true | ||
sites_config: | ||
items: | ||
- domain: example.com | ||
name: Example site | ||
- domain: test.example.com | ||
name: Test site | ||
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 | ||
header_key: Authorization | ||
header_value: Token ba9d233e95e04c4a8a661a27daffe7c9bd019067 | ||
- identifier: objecttypen-bar | ||
label: Objecttypen API Bar | ||
api_root: http://objecttypen.bar/api/v1/ | ||
api_type: orc | ||
auth_type: api_key | ||
header_key: Authorization | ||
header_value: Token b9f100590925b529664ed9d370f5f8da124b2c20 | ||
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. | ||
|
||
.. note:: The ``domain`` field will be used to lookup existing ``Site``'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. | ||
|
||
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: | ||
|
@@ -68,46 +92,86 @@ created. An example of a configuration could be seen below: | |
api_connection_check_path: objecttypes | ||
api_type: orc | ||
auth_type: api_key | ||
header_key: Authorization | ||
header_value: Token ba9d233e95e04c4a8a661a27daffe7c9bd019067 | ||
- 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 | ||
header_key: Authorization | ||
header_value: Token b9f100590925b529664ed9d370f5f8da124b2c20 | ||
.... | ||
TokenAuth configuration | ||
Tokens configuration | ||
-------------------- | ||
|
||
Mozilla-django-oidc-db | ||
---------------------- | ||
|
||
Create or update the (single) YAML configuration file with your settings: | ||
|
||
.. code-block:: yaml | ||
... | ||
oidc_db_config_enable: true | ||
oidc_db_config_admin_auth: | ||
items: | ||
- identifier: admin-oidc | ||
oidc_rp_client_id: client-id | ||
oidc_rp_client_secret: secret | ||
endpoint_config: | ||
oidc_op_authorization_endpoint: https://example.com/realms/test/protocol/openid-connect/auth | ||
oidc_op_token_endpoint: https://example.com/realms/test/protocol/openid-connect/token | ||
oidc_op_user_endpoint: https://example.com/realms/test/protocol/openid-connect/userinfo | ||
# workaround for https://github.com/maykinmedia/django-setup-configuration/issues/27 | ||
userinfo_claims_source: id_token | ||
... | ||
More details about configuring mozilla-django-oidc-db through ``setup_configuration`` | ||
can be found at the _`documentation`: https://mozilla-django-oidc-db.readthedocs.io/en/latest/setup_configuration.html. | ||
|
||
Sites configuration | ||
------------------- | ||
|
||
Notifications configuration | ||
------------------------- | ||
|
||
Create or update a (single) YAML configuration file with your settings: | ||
To configure sending notifications for the application ensure there is a ``services`` | ||
item present that matches the ``notifications_api_service_identifier`` in the | ||
``notifications_config`` namespace: | ||
|
||
.. code-block:: yaml | ||
token_tokenauth_config_enable: true | ||
token_tokenauth: | ||
items: | ||
- identifier: token-1 | ||
token: 18b2b74ef994314b84021d47b9422e82b685d82f | ||
contact_person: Person 1 | ||
email: [email protected] | ||
organization: Organization XYZ | ||
application: Application XYZ | ||
administration: Administration XYZ | ||
- identifier: token-2 | ||
token: e882642bd0ec2482adcdc97258c2e6f98cb06d85 | ||
contact_person: Person 2 | ||
email: [email protected] | ||
... | ||
zgw_consumers_config_enable: true | ||
zgw_consumers: | ||
services: | ||
- identifier: notifications-api | ||
label: Notificaties API | ||
api_root: http://notificaties.local/api/v1/ | ||
api_connection_check_path: notificaties | ||
api_type: nrc | ||
auth_type: api_key | ||
notifications_config_enable: true | ||
notifications_config: | ||
notifications_api_service_identifier: notifications-api | ||
notification_delivery_max_retries: 1 | ||
notification_delivery_retry_backoff: 2 | ||
notification_delivery_retry_backoff_max: 3 | ||
.... | ||
Execution | ||
========= | ||
|
||
|
||
With the full command invocation, everything is configured at once. | ||
Each configuration step is idempotent, so any manual changes made via the admin interface | ||
will be updated if the command is run afterwards. | ||
With the full command invocation, everything is configured at once and immediately | ||
tested. | ||
|
||
.. code-block:: bash | ||
python ./src/manage.py setup_configuration --yaml-file /path/to/config.yaml | ||
src/manage.py setup_configuration --yaml-file /path/to/config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/objects/core/tests/files/objecttypes_empty_database.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
objecttypes_config_enable: true | ||
objecttypes: | ||
items: | ||
- uuid: b427ef84-189d-43aa-9efd-7bb2c459e281 | ||
name: Object Type 1 | ||
service_identifier: service-1 | ||
|
||
- uuid: b0e8553f-8b1a-4d55-ab90-6d02f1bcf2c2 | ||
name: Object Type 2 | ||
service_identifier: service-2 |
Oops, something went wrong.