Skip to content

Commit

Permalink
[#484] allow notification configuration through
Browse files Browse the repository at this point in the history
django-setup-configuration
  • Loading branch information
SonnyBA committed Dec 13, 2024
1 parent 71fae22 commit beadd61
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 5 deletions.
19 changes: 18 additions & 1 deletion docker/setup_configuration/data.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
...
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
header_key: Authorization
header_value: Token ba9d233e95e04c4a8a661a27daffe7c9bd019067

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
29 changes: 29 additions & 0 deletions docs/installation/config_cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,35 @@ Mozilla-django-oidc-db
Sites configuration
-------------------

Notifications configuration
-------------------------

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
...
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
=========

Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ jsonschema
furl

# Common ground libraries
notifications-api-common
notifications-api-common[setup-configuration]
zgw-consumers[setup-configuration]
4 changes: 3 additions & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ django-sessionprofile==3.0.0
# via open-api-framework
django-setup-configuration==0.4.0
# via
# notifications-api-common
# open-api-framework
# zgw-consumers
django-simple-certmanager==1.4.1
Expand Down Expand Up @@ -206,6 +207,7 @@ furl==2.1.3
# via
# -r requirements/base.in
# ape-pie
# notifications-api-common
glom==23.5.0
# via
# -r requirements/base.in
Expand Down Expand Up @@ -242,7 +244,7 @@ mozilla-django-oidc==4.0.0
# via mozilla-django-oidc-db
mozilla-django-oidc-db==0.19.0
# via open-api-framework
notifications-api-common==0.3.1
notifications-api-common[setup-configuration]==0.4.0
# via
# -r requirements/base.in
# commonground-api-common
Expand Down
4 changes: 3 additions & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ django-sessionprofile==3.0.0
django-setup-configuration==0.4.0
# via
# -r requirements/base.txt
# notifications-api-common
# open-api-framework
# zgw-consumers
django-simple-certmanager==1.4.1
Expand Down Expand Up @@ -330,6 +331,7 @@ furl==2.1.3
# via
# -r requirements/base.txt
# ape-pie
# notifications-api-common
glom==23.5.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -404,7 +406,7 @@ multidict==6.0.5
# via yarl
mypy-extensions==1.0.0
# via black
notifications-api-common==0.3.1
notifications-api-common[setup-configuration]==0.4.0
# via
# -r requirements/base.txt
# commonground-api-common
Expand Down
4 changes: 3 additions & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ django-sessionprofile==3.0.0
django-setup-configuration==0.4.0
# via
# -r requirements/base.txt
# notifications-api-common
# open-api-framework
# zgw-consumers
django-simple-certmanager==1.4.1
Expand Down Expand Up @@ -351,6 +352,7 @@ furl==2.1.3
# via
# -r requirements/base.txt
# ape-pie
# notifications-api-common
glom==23.5.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -426,7 +428,7 @@ multidict==6.0.5
# via yarl
mypy-extensions==0.4.3
# via black
notifications-api-common==0.3.1
notifications-api-common[setup-configuration]==0.4.0
# via
# -r requirements/base.txt
# commonground-api-common
Expand Down
1 change: 1 addition & 0 deletions src/objects/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@
#
SETUP_CONFIGURATION_STEPS = (
"zgw_consumers.contrib.setup_configuration.steps.ServiceConfigurationStep",
"notifications_api_common.contrib.setup_configuration.steps.NotificationConfigurationStep",
)

0 comments on commit beadd61

Please sign in to comment.