commonground-api-common 2.1.0__py3-none-any.whl → 2.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: commonground-api-common
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: Commonground API tooling
5
5
  Home-page: https://github.com/maykinmedia/commonground-api-common
6
6
  Author: Maykin Media, VNG-Realisatie
@@ -32,7 +32,7 @@ Requires-Dist: isodate
32
32
  Requires-Dist: notifications-api-common>=0.3.1
33
33
  Requires-Dist: zgw-consumers>=0.35.1
34
34
  Requires-Dist: oyaml
35
- Requires-Dist: PyJWT>=2.1.0
35
+ Requires-Dist: PyJWT>=2.1.1
36
36
  Requires-Dist: requests
37
37
  Requires-Dist: requests-mock
38
38
  Requires-Dist: coreapi
@@ -53,6 +53,8 @@ Requires-Dist: freezegun; extra == "tests"
53
53
  Requires-Dist: zgw-consumers-oas; extra == "tests"
54
54
  Provides-Extra: testutils
55
55
  Requires-Dist: zgw-consumers-oas; extra == "testutils"
56
+ Provides-Extra: setup-configuration
57
+ Requires-Dist: django-setup-configuration>=0.4.0; extra == "setup-configuration"
56
58
  Provides-Extra: pep8
57
59
  Requires-Dist: flake8; extra == "pep8"
58
60
  Provides-Extra: coverage
@@ -1,7 +1,7 @@
1
- commonground_api_common-2.1.0.data/scripts/generate_schema,sha256=UKhznmbHX1zUjPx8G3XtxUPQiqnyd3TOIXs27Tnjl7U,952
2
- commonground_api_common-2.1.0.data/scripts/patch_content_types,sha256=dpGpYrZOZe8O5CHWd0F0QnP6Wk_7lK6DyuVZpBPr4mY,319
3
- commonground_api_common-2.1.0.data/scripts/use_external_components,sha256=xvvbngO2aDUagVXv4xRUqPaVtH_eOaVMWLQ8lyAPhEA,369
4
- vng_api_common/__init__.py,sha256=Xybt2skBZamGMNlLuOX1IG-h4uIxqUDGAO8MIGWrJac,22
1
+ commonground_api_common-2.2.0.data/scripts/generate_schema,sha256=UKhznmbHX1zUjPx8G3XtxUPQiqnyd3TOIXs27Tnjl7U,952
2
+ commonground_api_common-2.2.0.data/scripts/patch_content_types,sha256=dpGpYrZOZe8O5CHWd0F0QnP6Wk_7lK6DyuVZpBPr4mY,319
3
+ commonground_api_common-2.2.0.data/scripts/use_external_components,sha256=xvvbngO2aDUagVXv4xRUqPaVtH_eOaVMWLQ8lyAPhEA,369
4
+ vng_api_common/__init__.py,sha256=DKk-1b-rZsJFxFi1JoJ7TmEvIEQ0rf-C9HAZWwvjuM0,22
5
5
  vng_api_common/admin.py,sha256=iFtUPGf-ha0I-bXgq8QIFrP23Kzk_H3FlgAjt0U-ip0,259
6
6
  vng_api_common/apps.py,sha256=wOQuxUImMpH39R0JrDdCZp5ADaUM8jU8vFPFW9froSs,3458
7
7
  vng_api_common/checks.py,sha256=tOyfV7MMLGh4anrd_W30LvJCxiyQ4sFs1mGd9mtrEc0,1175
@@ -107,6 +107,10 @@ vng_api_common/caching/registry.py,sha256=mY1r99x7m0DQ1BN9lZF2zMjFj_oDNq7urxDkOH
107
107
  vng_api_common/caching/signals.py,sha256=78ej5cVan-JpNHKzZNAfs0m2ON_TXKphe8ZKtP-6FVY,4615
108
108
  vng_api_common/conf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
109
  vng_api_common/conf/api.py,sha256=bRc488POvBdKeaKVit7s1_LFP-BRLpETmTzcQ6JD614,4372
110
+ vng_api_common/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
111
+ vng_api_common/contrib/setup_configuration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
+ vng_api_common/contrib/setup_configuration/models.py,sha256=ijV_pGQNCqMrw-XJESlfBbPNHpCBOrLOVqGQQm45Fec,490
113
+ vng_api_common/contrib/setup_configuration/steps.py,sha256=OyTiyNatz-ZVgCAX_4h1cm0meVP4faACdLLNmvlpLuM,807
110
114
  vng_api_common/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
111
115
  vng_api_common/db/operations.py,sha256=3vj9zD4EntMSmYsNGN1pRDjAcVM68MESDdoAk9wl0U0,3333
112
116
  vng_api_common/inspectors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -189,9 +193,9 @@ vng_api_common/templatetags/vng_api_common.py,sha256=j4Fu4rNErLcXStBbuZ9Zd_xD_ft
189
193
  vng_api_common/tests/__init__.py,sha256=zBI2etwu2lEkKkIN1_cPuugJgPcoohQuJbdiUGtoceU,426
190
194
  vng_api_common/tests/auth.py,sha256=IKDWTEFv4Bign4F70-ibsFcnJqRxEJaXvqaPQJWa1xY,4544
191
195
  vng_api_common/tests/caching.py,sha256=zfIw5cRRvO9cekHZZKfRqZc8cx5IfJUYNmcH6cuIMg4,624
192
- vng_api_common/tests/schema.py,sha256=irt_kIp1uJsnYIJlrpk0-qM9W6i44WyX3GSiJvGUfdU,2288
196
+ vng_api_common/tests/schema.py,sha256=WDvifDQQiKqIpQijpeQ7rYkFroJmuPuHe7zNhl1Bigk,2293
193
197
  vng_api_common/tests/urls.py,sha256=PFrYzQbBC0TFPMEn3uPhcBG0IQs9JsEPqckicJT1UA4,2159
194
- commonground_api_common-2.1.0.dist-info/METADATA,sha256=SCXtFBl_MO_jXJ-9ulYtK3dX0bTQcuK84IDaWTwbRUM,6497
195
- commonground_api_common-2.1.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
196
- commonground_api_common-2.1.0.dist-info/top_level.txt,sha256=vPismc83zPzWXTmlNCCwfDlFV9iygJYxNJW5iDjKTgw,15
197
- commonground_api_common-2.1.0.dist-info/RECORD,,
198
+ commonground_api_common-2.2.0.dist-info/METADATA,sha256=d8TrvWW0ZJTppBzWC6tTB8LRqjwsQAFC7kjuOUWbL9M,6614
199
+ commonground_api_common-2.2.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
200
+ commonground_api_common-2.2.0.dist-info/top_level.txt,sha256=vPismc83zPzWXTmlNCCwfDlFV9iygJYxNJW5iDjKTgw,15
201
+ commonground_api_common-2.2.0.dist-info/RECORD,,
@@ -1 +1 @@
1
- __version__ = "2.1.0"
1
+ __version__ = "2.2.0"
File without changes
File without changes
@@ -0,0 +1,18 @@
1
+ from django_setup_configuration.models import ConfigurationModel
2
+ from pydantic import Field
3
+
4
+ from vng_api_common.models import JWTSecret
5
+
6
+
7
+ class SingleJWTSecretConfigurationModel(ConfigurationModel):
8
+ class Meta:
9
+ django_model_refs = {
10
+ JWTSecret: [
11
+ "identifier",
12
+ "secret",
13
+ ]
14
+ }
15
+
16
+
17
+ class JWTSecretsConfigurationModel(ConfigurationModel):
18
+ items: list[SingleJWTSecretConfigurationModel] = Field(default_factory=list)
@@ -0,0 +1,23 @@
1
+ from django_setup_configuration.configuration import BaseConfigurationStep
2
+
3
+ from vng_api_common.models import JWTSecret
4
+
5
+ from .models import JWTSecretsConfigurationModel
6
+
7
+
8
+ class JWTSecretsConfigurationStep(BaseConfigurationStep[JWTSecretsConfigurationModel]):
9
+ """
10
+ Configure credentials for Applications that need access
11
+ """
12
+
13
+ verbose_name = "Configuration to create credentials"
14
+ config_model = JWTSecretsConfigurationModel
15
+ namespace = "vng_api_common_credentials"
16
+ enable_setting = "vng_api_common_credentials_config_enable"
17
+
18
+ def execute(self, model: JWTSecretsConfigurationModel):
19
+ for config in model.items:
20
+ JWTSecret.objects.update_or_create(
21
+ identifier=config.identifier,
22
+ defaults={"secret": config.secret},
23
+ )
@@ -6,7 +6,6 @@ from django.conf import settings
6
6
 
7
7
  import yaml
8
8
  from requests_mock import Mocker
9
- from zgw_consumers_oas.schema_loading import read_schema
10
9
 
11
10
  DEFAULT_PATH_PARAMETERS = {"version": "1"}
12
11
 
@@ -76,6 +75,8 @@ def get_validation_errors(response, field, index=0):
76
75
  def mock_service_oas_get(
77
76
  mock: Mocker, url: str, service: str, oas_url: str = ""
78
77
  ) -> None:
78
+ from zgw_consumers_oas.schema_loading import read_schema
79
+
79
80
  if not oas_url:
80
81
  oas_url = f"{url}schema/openapi.yaml?v=3"
81
82