diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 835acc1f..21a48bf1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,37 @@ Change history ============== +3.3.0 (2025-10-06) +------------------ + +**New features** + +* [:objects-api:`653`] Add ``created_on`` & ``modified_on`` to ``Object`` & ``ObjectRecord`` models to + allow sorting and filtering in the admin UI +* [:open-api-framework:`175`] Changes to logging of handled and unhandled exceptions (see :ref:`manual_logging_exceptions`) + + * Log events for handled API exceptions (e.g. HTTP 400) now include ``data`` + * Log events for unhandled API exceptions (e.g. HTTP 500) now include the traceback via ``exception`` + +* [:open-api-framework:`184`] ``setup_configuration`` now supports pulling values from + environment variables in YAML configuration by using ``value_from`` (see `setup_configuration documentation`_ for more information) + +.. TODO should be reference to readthedocs +.. _setup_configuration documentation: https://github.com/maykinmedia/django-setup-configuration/blob/main/README.rst#environment-variable-substitution + + +**Project maintenance** + +* Upgrade dependencies + + * ``Django`` to 5.2.7 + * ``pip`` to 25.2 in dev dependencies + * [:open-api-framework:`175`] ``commonground-api-common`` to 2.10.1 + * [:open-api-framework:`184`] ``django-setup-configuration`` to 0.9.0 + * [:open-api-framework:`186`] ``open-api-framework`` to 0.13.1 + +* Fix ReadTheDocs build by installing required dependencies + 3.2.0 (2025-09-16) ------------------ diff --git a/README.NL.rst b/README.NL.rst index 09dc06dc..e83eb924 100644 --- a/README.NL.rst +++ b/README.NL.rst @@ -2,7 +2,7 @@ Objecten API ============ -:Version: 3.2.0 +:Version: 3.3.0 :Source: https://github.com/maykinmedia/objecttypes-api :Keywords: objecten, assets, zaakobjecten @@ -38,7 +38,40 @@ Applicatie versie Release datum API specificatie ================= ============== ============================= latest n/a `ReDoc `_, `Swagger `_, - (`verschillen `_) + (`verschillen `_) +3.3.0 2025-10-02 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.2.0 2025-09-16 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.1.4 2025-08-28 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.1.3 2025-08-04 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.1.2 2025-07-22 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.1.1 2025-07-04 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.1.0 2025-05-26 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.0.4 2025-05-13 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.0.3 2025-04-03 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.0.2 2025-03-07 `ReDoc `_, + `Swagger `_ + (`verschillen `_) +3.0.1 2025-03-04 `ReDoc `_, + `Swagger `_ + (`verschillen `_) 3.0.0 2025-01-22 `ReDoc `_, `Swagger `_ (`verschillen `_) diff --git a/README.rst b/README.rst index 26a87dc4..24bad1ab 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Objects API =========== -:Version: 3.2.0 +:Version: 3.3.0 :Source: https://github.com/maykinmedia/objects-api :Keywords: objects, assets, zaakobjecten @@ -36,7 +36,40 @@ Application version Release date API specification =================== ============== ============================= latest n/a `ReDoc `_, `Swagger `_, - (`diff `_) + (`diff `_) +3.3.0 2025-10-02 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.2.0 2025-09-16 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.1.4 2025-08-28 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.1.3 2025-08-04 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.1.2 2025-07-22 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.1.1 2025-07-04 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.1.0 2025-05-26 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.0.4 2025-05-13 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.0.3 2025-04-03 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.0.2 2025-03-07 `ReDoc `_, + `Swagger `_ + (`diff `_) +3.0.1 2025-03-04 `ReDoc `_, + `Swagger `_ + (`diff `_) 3.0.0 2025-01-22 `ReDoc `_, `Swagger `_ (`diff `_) diff --git a/docs/api/index.rst b/docs/api/index.rst index 764e69f1..7ccde302 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -14,9 +14,9 @@ API Specification version(s) `Redoc `__, `Swagger `__ ) -`Objects API`_ 2.4.3 ( - `Redoc `__, - `Swagger `__ +`Objects API`_ 2.4.4 ( + `Redoc `__, + `Swagger `__ ) ====================== ========================================== diff --git a/docs/conf.py b/docs/conf.py index 0914aadc..aac29dc6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -114,6 +114,7 @@ "https://objects.municipality.nl/admin/", "https://sparxsystems.com/products/ea/trial/request.html", # this raises 403 for crawlers probably? "https://data.overheid.nl/", + "https://github.com/maykinmedia/django-setup-configuration/blob/main/README.rst#environment-variable-substitution", ] extlinks = { diff --git a/docs/manual/logging.rst b/docs/manual/logging.rst index bda4d9d4..739e83c1 100644 --- a/docs/manual/logging.rst +++ b/docs/manual/logging.rst @@ -74,8 +74,53 @@ Objecttypes API * ``object_version_updated``: updated an ``Object_version`` via the API. Additional context: ``version``, ``objecttype_uuid``, ``token_identifier``, ``token_application``. * ``object_version_deleted``: deleted an ``Object_version`` via the API. Additional context: ``version``, ``objecttype_uuid``, ``token_identifier``, ``token_application``. +.. _manual_logging_exceptions: + +Exceptions +---------- + +Handled exceptions follow a standardized JSON format to ensure consistency and improve error tracking. +Most fields are standard and include: +``title``, ``code``, ``status``, ``event``, ``source``, ``user_id``, ``request_id``, ``timestamp``, ``logger`` and ``level``. + +A new field ``data`` has been added to provide detailed information about which input parameters caused the error in API calls. + +.. code-block:: json + + { + "title": "Authentication credentials were not provided.", + "code": "not_authenticated", + "status": 401, + "data": { + "detail": "Authentication credentials were not provided." + }, + "event": "api.handled_exception", + "user_id": null, + "request_id": "68b46bf0-a5b8-43f7-a550-e37dee617bff", + "source": "app", + "timestamp": "2025-10-06T07:43:40.991929Z", + "logger": "objects.utils.views", + "level": "error" + } + +Uncaught exceptions that occur via the API are logged as ``api.uncaught_exception`` events +and contain the traceback of the exception. + +.. code-block:: json + + { + "event": "api.uncaught_exception", + "request_id": "9a5c781d-b15c-4b3a-8910-e7968ae37cb6", + "user_id": null, + "timestamp": "2025-10-06T08:31:57.572352Z", + "logger": "objects.utils.views", + "level": "error", + "exception": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/rest_framework/views.py\", line 497, in dispatch\n self.initial(request, *args, **kwargs)\n File \"/usr/local/lib/python3.12/site-packages/vng_api_common/geo.py\", line 30, in initial\n super().initial(request, *args, **kwargs)\n File \"/usr/local/lib/python3.12/site-packages/rest_framework/views.py\", line 415, in initial\n self.check_permissions(request)\n File \"/usr/local/lib/python3.12/site-packages/rest_framework/views.py\", line 332, in check_permissions\n if not permission.has_permission(request, self):\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/src/objects/token/permissions.py\", line 10, in has_permission\n 1 / 0\n ~~^~~\nZeroDivisionError: division by zero" + } + + Setup configuration -~~~~~~~~~~~~~~~~~~~ +------------------- * ``no_permissions_defined``: while running the token configuration step, it was detected that neither permissions nor ``is_superuser`` was set for the token. Additional context: ``token_identifier``. * ``no_tokens_defined``: while running the token configuration step, it was detected that the config file did not define any tokens. @@ -85,7 +130,7 @@ Setup configuration * ``token_configuration_success``: configuring a token succeeded. Additional context: ``token_identifier``. Data migrations -~~~~~~~~~~~~~~~ +--------------- * ``token_identifier_generated``: while migrating, an ``identifier`` was generated for a token. Additional context: ``token_identifier``, ``token_pk``. * ``missing_service_for_objecttype``: while migrating, a ``Service`` object is missing for an ``ObjectType``. Additional context: ``object``, ``objecttype``. diff --git a/package-lock.json b/package-lock.json index e7a1bb84..97607176 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "objects", - "version": "3.2.0", + "version": "3.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "objects", - "version": "3.2.0", + "version": "3.3.0", "license": "UNLICENSED", "dependencies": { "microscope-sass": "latest", diff --git a/package.json b/package.json index 95cc4dbd..cea69ba8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "objects", - "version": "3.2.0", + "version": "3.3.0", "description": "objects project", "main": "src/objects/static/bundles/objects-js.js", "directories": { diff --git a/publiccode.yaml b/publiccode.yaml index 2693c9d0..dd7bb37d 100644 --- a/publiccode.yaml +++ b/publiccode.yaml @@ -7,8 +7,8 @@ publiccodeYmlVersion: '0.2' name: Objects API url: 'http://github.com/maykinmedia/objects-api.git' softwareType: standalone/backend -softwareVersion: 3.2.0 -releaseDate: '2025-09-16' +softwareVersion: 3.3.0 +releaseDate: '2025-10-06' logo: 'https://github.com/maykinmedia/objects-api/blob/master/docs/logo.png' platforms: - web diff --git a/pyproject.toml b/pyproject.toml index a545ef66..1d7bab31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires-python = "== 3.12" [tool.bumpversion] commit = false tag = false -current_version = "3.2.0" +current_version = "3.3.0" pre_commit_hooks = [ "npm i", # ensure that package-lock.json is updated ] diff --git a/requirements/base.txt b/requirements/base.txt index cb774c5e..2701a921 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -60,7 +60,7 @@ click-plugins==1.1.1 # via celery click-repl==0.3.0 # via celery -commonground-api-common==2.10.0 +commonground-api-common==2.10.1 # via # -r requirements/base.in # open-api-framework @@ -71,7 +71,7 @@ cryptography==44.0.1 # mozilla-django-oidc # pyopenssl # webauthn -django==5.2.3 +django==5.2.7 # via # commonground-api-common # django-admin-index diff --git a/requirements/ci.txt b/requirements/ci.txt index a9e1c572..247021ff 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -111,7 +111,7 @@ click-repl==0.3.0 # celery codecov==2.1.13 # via -r requirements/test-tools.in -commonground-api-common==2.10.0 +commonground-api-common==2.10.1 # via # -c requirements/base.txt # -r requirements/base.txt @@ -132,7 +132,7 @@ cryptography==44.0.1 # webauthn cssselect==1.1.0 # via pyquery -django==5.2.3 +django==5.2.7 # via # -c requirements/base.txt # -r requirements/base.txt diff --git a/requirements/dev.txt b/requirements/dev.txt index 221d0de7..be6f2bab 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -139,7 +139,7 @@ codecov==2.1.13 # via # -c requirements/ci.txt # -r requirements/ci.txt -commonground-api-common==2.10.0 +commonground-api-common==2.10.1 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -169,7 +169,7 @@ cssselect==1.1.0 # pyquery distlib==0.3.9 # via virtualenv -django==5.2.3 +django==5.2.7 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -584,7 +584,7 @@ phonenumberslite==8.13.30 # -c requirements/ci.txt # -r requirements/ci.txt # django-two-factor-auth -pip==24.3.1 +pip==25.2 # via pip-tools pip-tools==7.4.1 # via -r requirements/dev.in diff --git a/src/objects/__init__.py b/src/objects/__init__.py index b3125535..5e39044f 100644 --- a/src/objects/__init__.py +++ b/src/objects/__init__.py @@ -1,6 +1,6 @@ from .celery import app as celery_app __all__ = ("celery_app",) -__version__ = "3.2.0" +__version__ = "3.3.0" __author__ = "Maykin Media" __homepage__ = "https://github.com/maykinmedia/objects-api" diff --git a/src/objects/api/v2/openapi.yaml b/src/objects/api/v2/openapi.yaml index 3fc1b553..1c4a3685 100644 --- a/src/objects/api/v2/openapi.yaml +++ b/src/objects/api/v2/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: Objects API - version: 2.4.3 + version: 2.4.4 description: | An API to manage Objects. diff --git a/src/objects/conf/api.py b/src/objects/conf/api.py index 30411899..6496e284 100644 --- a/src/objects/conf/api.py +++ b/src/objects/conf/api.py @@ -1,4 +1,4 @@ -API_VERSION = "2.4.3" +API_VERSION = "2.4.4" # api settings REST_FRAMEWORK = {