Skip to content

Commit

Permalink
👌 [#200] Process PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Dec 13, 2024
1 parent 1f538bd commit 83857fc
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 304 deletions.
12 changes: 0 additions & 12 deletions docker/setup_configuration/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,3 @@ vng_api_common_credentials:
# Credentials for Open Notificaties, required for autorisaties subscription
- identifier: open-notificaties
secret: oPMsHCEuoP9Qh8vP06D7

# notifications_config_enable: True
# notifications_config:
# notifications_api_service_identifier: notificaties-api
# notification_delivery_max_retries: 5
# notification_delivery_retry_backoff: 3
# notification_delivery_retry_backoff_max: 30

# site_config_enable: True
# site_config:
# domain: localhost:8001
# organization: Demodam
1 change: 0 additions & 1 deletion docs/installation/configuration/env_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ Optional
* ``LOG_OUTGOING_REQUESTS_MAX_AGE``: The amount of time after which request logs should be deleted from the database. Defaults to: ``7``.
* ``SENTRY_DSN``: URL of the sentry project to send error reports to. Default empty, i.e. -> no monitoring set up. Highly recommended to configure this.
* ``EXTRA_VERIFY_CERTS``: a comma-separated list of paths to certificates to trust, If you're using self-signed certificates for the services that Open Notificaties communicates with, specify the path to those (root) certificates here, rather than disabling SSL certificate verification. Example: ``EXTRA_VERIFY_CERTS=/etc/ssl/root1.crt,/etc/ssl/root2.crt``. Defaults to: ``(empty string)``.
* ``OPENNOTIFICATIES_DOMAIN``: The domain for this Open Notificaties instance (``[host]:[port]`` or ``[host]``). Defaults to: ``(empty string)``.



Expand Down
14 changes: 0 additions & 14 deletions src/nrc/conf/includes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@
"zgw_consumers.contrib.setup_configuration.steps.ServiceConfigurationStep",
"vng_api_common.contrib.setup_configuration.steps.JWTSecretsConfigurationStep",
"nrc.setup_configuration.authorization.AuthorizationStep",
# TODO these need to be implemented later
# "notifications_api_common.contrib.setup_configuration.steps.NotificationConfigurationStep",
# TODO this should be moved to `django-setup-configuration`
# "nrc.config.site.SiteConfigurationStep",
]

#
Expand All @@ -156,13 +152,3 @@
"``EXTRA_VERIFY_CERTS=/etc/ssl/root1.crt,/etc/ssl/root2.crt``."
),
)

#
# Open Notificaties settings
#

OPENNOTIFICATIES_DOMAIN = config(
"OPENNOTIFICATIES_DOMAIN",
"",
help_text="The domain for this Open Notificaties instance (``[host]:[port]`` or ``[host]``)",
)
11 changes: 0 additions & 11 deletions src/nrc/setup_configuration/models.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
from django.contrib.sites.models import Site

from django_setup_configuration.fields import DjangoModelRef
from django_setup_configuration.models import ConfigurationModel
from pydantic import Field
from vng_api_common.authorizations.models import AuthorizationsConfig


class AuthorizationsConfigModel(ConfigurationModel):
authorizations_api_service_identifier: str = DjangoModelRef(
AuthorizationsConfig, "authorizations_api_service"
)


class SiteConfigModel(ConfigurationModel):
organization: str = Field()
"""The name of the organization that owns this Open Notificaties instance"""

class Meta:
django_model_refs = {Site: ("domain",)}
24 changes: 0 additions & 24 deletions src/nrc/setup_configuration/site.py

This file was deleted.

37 changes: 0 additions & 37 deletions src/nrc/tests/commands/files/setup_config_full.yaml

This file was deleted.

120 changes: 0 additions & 120 deletions src/nrc/tests/commands/test_setup_configuration.py

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

from nrc.setup_configuration.authorization import AuthorizationStep

CONFIG_FILE_PATH = "src/nrc/tests/config/files/setup_config_auth_config.yaml"
CONFIG_FILE_PATH = (
"src/nrc/tests/setup_configuration/files/setup_config_auth_config.yaml"
)


class AuthorizationConfigurationTests(TestCase):
Expand Down
51 changes: 0 additions & 51 deletions src/nrc/tests/setup_configuration/test_site_configuration.py

This file was deleted.

29 changes: 0 additions & 29 deletions src/nrc/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,29 +0,0 @@
from django.conf import settings
from django.http import HttpRequest

from furl import furl


def get_domain() -> str:
"""
Obtain the domain/netloc of Open Notificaties according to settings or configuration.
"""
from django.contrib.sites.models import Site

if settings.OPENNOTIFICATIES_DOMAIN:
return settings.OPENNOTIFICATIES_DOMAIN

return Site.objects.get_current().domain


def build_absolute_url(path: str, request: HttpRequest | None = None) -> str:
if request is not None:
return request.build_absolute_uri(path)

domain = get_domain()
_furl = furl(
scheme="https" if settings.IS_HTTPS else "http",
netloc=domain,
path=path,
)
return _furl.url

0 comments on commit 83857fc

Please sign in to comment.