Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 [maykinmedia/django-setup-configuration#16] Setup config fixes #193

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/installation/configuration/opennotifs_config_cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Open Notificaties uses Open Zaak Authorisaties API to check authorizations
of its consumers, therefore Open Notificaties should be able to request Open Zaak.
Make sure that the correct permissions are configured in Open Zaak Autorisaties API.

* ``OPENNOTIFICATIES_DOMAIN``: a ``[host]:[port]`` or ``[host]`` value. Required.
* ``AUTHORIZATION_CONFIG_ENABLE``: enable Authorization configuration. Defaults
to ``False``.
* ``AUTORISATIES_API_ROOT``: full URL to the Authorisaties API root, for example
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ self-certifi
furl

# API libraries
gemma-zds-client
git+https://github.com/maykinmedia/commonground-api-common@feature/update-notifs-client
30 changes: 12 additions & 18 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# ./bin/compile_dependencies.sh
#
amqp==5.2.0
# via kombu
ape-pie==0.2.0
# via zgw-consumers
# via
# commonground-api-common
# notifications-api-common
# zgw-consumers
asgiref==3.8.1
# via
# django
# django-axes
# django-cors-headers
asn1crypto==1.5.1
# via webauthn
async-timeout==4.0.3
# via redis
attrs==24.2.0
# via
# glom
Expand Down Expand Up @@ -59,8 +60,10 @@ click-plugins==1.1.1
# via celery
click-repl==0.3.0
# via celery
commonground-api-common==1.13.2
# via open-api-framework
commonground-api-common @ git+https://github.com/maykinmedia/commonground-api-common@feature/update-notifs-client
# via
# -r requirements/base.in
# open-api-framework
coreapi==2.3.3
# via commonground-api-common
coreschema==0.0.4
Expand Down Expand Up @@ -201,11 +204,6 @@ furl==2.1.3
# via
# -r requirements/base.in
# ape-pie
gemma-zds-client==1.0.1
# via
# -r requirements/base.in
# commonground-api-common
# notifications-api-common
glom==23.5.0
# via mozilla-django-oidc-db
humanize==4.10.0
Expand Down Expand Up @@ -242,7 +240,7 @@ mozilla-django-oidc==4.0.1
# via mozilla-django-oidc-db
mozilla-django-oidc-db==0.19.0
# via open-api-framework
notifications-api-common==0.2.2
notifications-api-common==0.3.0
# via commonground-api-common
open-api-framework==0.8.1
# via -r requirements/base.in
Expand All @@ -265,7 +263,6 @@ pycparser==2.22
pyjwt==2.9.0
# via
# commonground-api-common
# gemma-zds-client
# zgw-consumers
pyopenssl==24.2.1
# via
Expand All @@ -289,7 +286,6 @@ pyyaml==6.0.2
# via
# drf-spectacular
# drf-yasg
# gemma-zds-client
# oyaml
qrcode==7.4.2
# via django-two-factor-auth
Expand All @@ -305,7 +301,6 @@ requests==2.32.3
# commonground-api-common
# coreapi
# django-log-outgoing-requests
# gemma-zds-client
# mozilla-django-oidc
# open-api-framework
# zgw-consumers
Expand All @@ -330,8 +325,6 @@ tornado==6.4.1
# via flower
typing-extensions==4.12.2
# via
# asgiref
# django-solo
# mozilla-django-oidc-db
# qrcode
# zgw-consumers
Expand Down Expand Up @@ -362,7 +355,8 @@ webencodings==0.5.1
# via bleach
wrapt==1.16.0
# via elastic-apm
zgw-consumers==0.34.0
zgw-consumers==0.35.1
# via
# commonground-api-common
# notifications-api-common
# open-api-framework
33 changes: 7 additions & 26 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# ./bin/compile_dependencies.sh
Expand All @@ -13,6 +13,8 @@ amqp==5.2.0
ape-pie==0.2.0
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
# zgw-consumers
asgiref==3.8.1
# via
Expand All @@ -24,10 +26,6 @@ asn1crypto==1.5.1
# via
# -r requirements/base.txt
# webauthn
async-timeout==4.0.3
# via
# -r requirements/base.txt
# redis
attrs==24.2.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -100,7 +98,7 @@ click-repl==0.3.0
# celery
codecov==2.1.13
# via -r requirements/ci.in
commonground-api-common==1.13.2
commonground-api-common @ git+https://github.com/maykinmedia/commonground-api-common@feature/update-notifs-client
# via
# -r requirements/base.txt
# open-api-framework
Expand Down Expand Up @@ -315,8 +313,6 @@ elastic-apm==6.23.0
# via
# -r requirements/base.txt
# open-api-framework
exceptiongroup==1.2.2
# via pytest
face==20.1.1
# via
# -r requirements/base.txt
Expand All @@ -337,11 +333,6 @@ furl==2.1.3
# via
# -r requirements/base.txt
# ape-pie
gemma-zds-client==1.0.1
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
glom==23.5.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -425,7 +416,7 @@ multidict==6.0.5
# via yarl
mypy-extensions==0.4.3
# via black
notifications-api-common==0.2.2
notifications-api-common==0.3.0
# via
# -r requirements/base.txt
# commonground-api-common
Expand Down Expand Up @@ -484,7 +475,6 @@ pyjwt==2.9.0
# via
# -r requirements/base.txt
# commonground-api-common
# gemma-zds-client
# zgw-consumers
pyopenssl==24.2.1
# via
Expand Down Expand Up @@ -524,7 +514,6 @@ pyyaml==6.0.2
# -r requirements/base.txt
# drf-spectacular
# drf-yasg
# gemma-zds-client
# oyaml
# vcrpy
qrcode==7.4.2
Expand All @@ -550,7 +539,6 @@ requests==2.32.3
# commonground-api-common
# coreapi
# django-log-outgoing-requests
# gemma-zds-client
# mozilla-django-oidc
# open-api-framework
# requests-mock
Expand Down Expand Up @@ -612,21 +600,13 @@ sqlparse==0.5.1
# django
tblib==1.7.0
# via -r requirements/test-tools.in
tomli==2.0.1
# via
# black
# pytest
# sphinx
tornado==6.4.1
# via
# -r requirements/base.txt
# flower
typing-extensions==4.12.2
# via
# -r requirements/base.txt
# asgiref
# black
# django-solo
# mozilla-django-oidc-db
# qrcode
# zgw-consumers
Expand Down Expand Up @@ -683,8 +663,9 @@ wrapt==1.16.0
# vcrpy
yarl==1.9.4
# via vcrpy
zgw-consumers==0.34.0
zgw-consumers==0.35.1
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
# open-api-framework
32 changes: 7 additions & 25 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# ./bin/compile_dependencies.sh
Expand All @@ -13,6 +13,8 @@ amqp==5.2.0
ape-pie==0.2.0
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
# zgw-consumers
asgiref==3.8.1
# via
Expand All @@ -24,10 +26,6 @@ asn1crypto==1.5.1
# via
# -r requirements/base.txt
# webauthn
async-timeout==4.0.3
# via
# -r requirements/base.txt
# redis
attrs==24.2.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -103,7 +101,7 @@ click-repl==0.3.0
# via
# -r requirements/base.txt
# celery
commonground-api-common==1.13.2
commonground-api-common @ git+https://github.com/maykinmedia/commonground-api-common@feature/update-notifs-client
# via
# -r requirements/base.txt
# open-api-framework
Expand Down Expand Up @@ -342,11 +340,6 @@ furl==2.1.3
# via
# -r requirements/base.txt
# ape-pie
gemma-zds-client==1.0.1
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
gitdb==4.0.9
# via gitpython
gitpython==3.1.41
Expand Down Expand Up @@ -432,7 +425,7 @@ multidict==6.0.5
# via yarl
mypy-extensions==0.4.3
# via black
notifications-api-common==0.2.2
notifications-api-common==0.3.0
# via
# -r requirements/base.txt
# commonground-api-common
Expand Down Expand Up @@ -491,7 +484,6 @@ pyjwt==2.9.0
# via
# -r requirements/base.txt
# commonground-api-common
# gemma-zds-client
# zgw-consumers
pyopenssl==24.2.1
# via
Expand Down Expand Up @@ -531,7 +523,6 @@ pyyaml==6.0.2
# -r requirements/base.txt
# drf-spectacular
# drf-yasg
# gemma-zds-client
# oyaml
# vcrpy
qrcode==7.4.2
Expand All @@ -556,7 +547,6 @@ requests==2.32.3
# commonground-api-common
# coreapi
# django-log-outgoing-requests
# gemma-zds-client
# mozilla-django-oidc
# open-api-framework
# requests-mock
Expand Down Expand Up @@ -618,22 +608,13 @@ sqlparse==0.5.1
# django-debug-toolbar
tblib==1.7.0
# via -r requirements/test-tools.in
tomli==2.0.1
# via
# black
# build
# pip-tools
# pyproject-hooks
tornado==6.4.1
# via
# -r requirements/base.txt
# flower
typing-extensions==4.12.2
# via
# -r requirements/base.txt
# asgiref
# black
# django-solo
# mozilla-django-oidc-db
# qrcode
# zgw-consumers
Expand Down Expand Up @@ -692,9 +673,10 @@ wrapt==1.16.0
# vcrpy
yarl==1.9.4
# via vcrpy
zgw-consumers==0.34.0
zgw-consumers==0.35.1
# via
# -r requirements/base.txt
# commonground-api-common
# notifications-api-common
# open-api-framework

Expand Down
8 changes: 5 additions & 3 deletions src/nrc/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from django.utils.translation import gettext_lazy as _

from vng_api_common.models import JWTSecret
from zds_client import ClientAuth

from nrc.utils.auth import generate_jwt

admin.site.unregister(JWTSecret)

Expand All @@ -18,8 +19,9 @@ class JWTSecretAdmin(admin.ModelAdmin):
@admin.display(description="jwt")
def get_jwt(self, obj):
if obj.identifier and obj.secret:
auth = ClientAuth(obj.identifier, obj.secret)
jwt = auth.credentials()["Authorization"]
jwt = generate_jwt(
obj.identifier, obj.secret, obj.identifier, obj.identifier
)
return format_html(
'<code class="jwt">{val}</code><p>{hint}</p>',
val=jwt,
Expand Down
Loading
Loading