Skip to content

Commit

Permalink
⚰️ [#3489] Remove old HalClient
Browse files Browse the repository at this point in the history
The HalClient variant of the ZDS Client is no longer used anywhere and
can be removed.
  • Loading branch information
sergei-maertens committed Sep 25, 2023
1 parent 1229586 commit 43fb4a2
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/openforms/contrib/hal_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from zds_client.schema import get_operation_url
from zgw_consumers.client import ZGWClient

from api_client import APIClient

HAL_CONTENT_TYPE = "application/hal+json"
Expand All @@ -19,23 +16,3 @@ def __init__(self, *args, **kwargs):

class HALClient(HALMixin, APIClient):
pass


# deprecated
class HalClient(ZGWClient):
def pre_request(self, method, url, kwargs):
"""
Add authorization header to requests for APIs without jwt.
"""

result = super().pre_request(method, url, kwargs)

headers = kwargs.get("headers", {})
headers["Accept"] = "application/hal+json"
headers["Content-Type"] = "application/hal+json"
return result

def get_operation_url(self, operation_id: str, **path_kwargs):
return get_operation_url(
self.schema, operation_id, base_url=self.api_root, **path_kwargs
)

0 comments on commit 43fb4a2

Please sign in to comment.