From 6304776a1b40efb81913383c01c20f461c921660 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Wed, 4 Dec 2024 11:09:58 +0100 Subject: [PATCH 1/4] [#294] update requirements --- requirements/base.in | 1 + requirements/base.txt | 6 ++++-- requirements/ci.txt | 2 +- requirements/dev.txt | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/requirements/base.in b/requirements/base.in index 26561e68..34a2d811 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -1,3 +1,4 @@ open-api-framework django-setup-configuration +mozilla-django-oidc-db[setup-configuration] diff --git a/requirements/base.txt b/requirements/base.txt index 6210cc67..7c428617 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -236,8 +236,10 @@ maykin-2fa==1.0.1 # via open-api-framework mozilla-django-oidc==4.0.1 # via mozilla-django-oidc-db -mozilla-django-oidc-db==0.19.0 - # via open-api-framework +mozilla-django-oidc-db[setup-configuration]==0.19.0 + # via + # -r requirements/base.in + # open-api-framework notifications-api-common==0.3.1 # via commonground-api-common open-api-framework==0.9.0 diff --git a/requirements/ci.txt b/requirements/ci.txt index 72c44ad5..6b3afc15 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -422,7 +422,7 @@ mozilla-django-oidc==4.0.1 # via # -r requirements/base.txt # mozilla-django-oidc-db -mozilla-django-oidc-db==0.19.0 +mozilla-django-oidc-db[setup-configuration]==0.19.0 # via # -r requirements/base.txt # open-api-framework diff --git a/requirements/dev.txt b/requirements/dev.txt index dcd81e7c..e271933b 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -431,7 +431,7 @@ mozilla-django-oidc==4.0.1 # via # -r requirements/base.txt # mozilla-django-oidc-db -mozilla-django-oidc-db==0.19.0 +mozilla-django-oidc-db[setup-configuration]==0.19.0 # via # -r requirements/base.txt # open-api-framework From 60fb1539f2dab4e5df2632514ddc97dcc24bb965 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Wed, 4 Dec 2024 11:10:49 +0100 Subject: [PATCH 2/4] [#294] update example file & update python settings --- docker/setup_configuration/data.yaml | 7 +++++++ src/openklant/conf/base.py | 1 + 2 files changed, 8 insertions(+) diff --git a/docker/setup_configuration/data.yaml b/docker/setup_configuration/data.yaml index 58d61108..b82645bf 100644 --- a/docker/setup_configuration/data.yaml +++ b/docker/setup_configuration/data.yaml @@ -8,3 +8,10 @@ openklant_tokens: organization: Organization XYZ application: Application XYZ administration: Administration XYZ + +oidc_db_config_enable: true +oidc_db_config_admin_auth: + oidc_rp_client_id: client-id + oidc_rp_client_secret: secret + endpoint_config: + oidc_op_discovery_endpoint: https://keycloak.local/protocol/openid-connect/ diff --git a/src/openklant/conf/base.py b/src/openklant/conf/base.py index b8d9e6e9..9865cd0f 100644 --- a/src/openklant/conf/base.py +++ b/src/openklant/conf/base.py @@ -48,4 +48,5 @@ # SETUP_CONFIGURATION_STEPS = ( "openklant.setup_configuration.steps.TokenAuthConfigurationStep", + "mozilla_django_oidc_db.setup_configuration.steps.AdminOIDCConfigurationStep", ) From a29d57472386524c84209d8f4199210369a29d00 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Wed, 4 Dec 2024 12:10:07 +0100 Subject: [PATCH 3/4] [#294] update mozilla-django-oidc-db --- requirements/base.txt | 3 ++- requirements/ci.txt | 3 ++- requirements/dev.txt | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 7c428617..eb1b66ea 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -156,6 +156,7 @@ django-sessionprofile==3.0.0 django-setup-configuration==0.4.0 # via # -r requirements/base.in + # mozilla-django-oidc-db # open-api-framework django-simple-certmanager==2.3.0 # via zgw-consumers @@ -236,7 +237,7 @@ maykin-2fa==1.0.1 # via open-api-framework mozilla-django-oidc==4.0.1 # via mozilla-django-oidc-db -mozilla-django-oidc-db[setup-configuration]==0.19.0 +mozilla-django-oidc-db[setup-configuration]==0.20.0 # via # -r requirements/base.in # open-api-framework diff --git a/requirements/ci.txt b/requirements/ci.txt index 6b3afc15..701e1449 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -250,6 +250,7 @@ django-sessionprofile==3.0.0 django-setup-configuration==0.4.0 # via # -r requirements/base.txt + # mozilla-django-oidc-db # open-api-framework django-simple-certmanager==2.3.0 # via @@ -422,7 +423,7 @@ mozilla-django-oidc==4.0.1 # via # -r requirements/base.txt # mozilla-django-oidc-db -mozilla-django-oidc-db[setup-configuration]==0.19.0 +mozilla-django-oidc-db[setup-configuration]==0.20.0 # via # -r requirements/base.txt # open-api-framework diff --git a/requirements/dev.txt b/requirements/dev.txt index e271933b..b0d9d6c7 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -257,6 +257,7 @@ django-sessionprofile==3.0.0 django-setup-configuration==0.4.0 # via # -r requirements/base.txt + # mozilla-django-oidc-db # open-api-framework django-simple-certmanager==2.3.0 # via @@ -431,7 +432,7 @@ mozilla-django-oidc==4.0.1 # via # -r requirements/base.txt # mozilla-django-oidc-db -mozilla-django-oidc-db[setup-configuration]==0.19.0 +mozilla-django-oidc-db[setup-configuration]==0.20.0 # via # -r requirements/base.txt # open-api-framework From 3e620fc943f347d4ea9d9de6c7cd95efac37b4f0 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Wed, 4 Dec 2024 12:16:25 +0100 Subject: [PATCH 4/4] [#294] update configuration & documentation --- docker/setup_configuration/data.yaml | 4 +++- docs/installation/setup_configuration.rst | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docker/setup_configuration/data.yaml b/docker/setup_configuration/data.yaml index b82645bf..062db930 100644 --- a/docker/setup_configuration/data.yaml +++ b/docker/setup_configuration/data.yaml @@ -14,4 +14,6 @@ oidc_db_config_admin_auth: oidc_rp_client_id: client-id oidc_rp_client_secret: secret endpoint_config: - oidc_op_discovery_endpoint: https://keycloak.local/protocol/openid-connect/ + 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 diff --git a/docs/installation/setup_configuration.rst b/docs/installation/setup_configuration.rst index 2110f1aa..2e81d813 100644 --- a/docs/installation/setup_configuration.rst +++ b/docs/installation/setup_configuration.rst @@ -45,6 +45,26 @@ Create a (single) YAML configuration file with your settings: contact_person: Person 2 email: person-2@example.com + +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: + oidc_rp_client_id: client-id + oidc_rp_client_secret: secret + endpoint_config: + oidc_op_discovery_endpoint: https://keycloak.local/protocol/openid-connect/ + ... + +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. + Execution =========