Skip to content

Commit

Permalink
📌 Pin to specific commonground-api-common version
Browse files Browse the repository at this point in the history
this version moves the auth middleware to the proper directory, to avoid unnecessary migrations if the authorizations app is unused

also remove the vng_api_common.authorizations.AuthMiddleware from the MIDDLEWARE setting, because Open Klant does not use JWT authentication
  • Loading branch information
stevenbal committed Oct 25, 2024
1 parent 77ab5b0 commit e80ba3d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
open-api-framework
git+https://github.com/maykinmedia/commonground-api-common.git@move-middleware-file#egg=commonground-api-common
6 changes: 4 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ click-plugins==1.1.1
# via celery
click-repl==0.3.0
# via celery
commonground-api-common==1.13.3
# via open-api-framework
commonground-api-common @ git+https://github.com/maykinmedia/commonground-api-common.git@move-middleware-file
# via
# -r requirements/base.in
# open-api-framework
coreapi==2.3.3
# via commonground-api-common
coreschema==0.0.4
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ click-repl==0.3.0
# celery
codecov==2.1.13
# via -r requirements/ci.in
commonground-api-common==1.13.3
commonground-api-common @ git+https://github.com/maykinmedia/commonground-api-common.git@move-middleware-file
# via
# -r requirements/base.txt
# open-api-framework
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ click-repl==0.3.0
# via
# -r requirements/base.txt
# celery
commonground-api-common==1.13.3
commonground-api-common @ git+https://github.com/maykinmedia/commonground-api-common.git@move-middleware-file
# via
# -r requirements/base.txt
# open-api-framework
Expand Down
5 changes: 0 additions & 5 deletions src/openklant/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
# but we don't want to rely on it anymore (e.g. when generating the label for 2FA)
INSTALLED_APPS.remove("django.contrib.sites")

# FIXME should these be part of OAf?
MIDDLEWARE.insert(
MIDDLEWARE.index("django.contrib.auth.middleware.AuthenticationMiddleware") + 1,
"vng_api_common.middleware.AuthMiddleware",
)
MIDDLEWARE = MIDDLEWARE + ["openklant.utils.middleware.APIVersionHeaderMiddleware"]

#
Expand Down
2 changes: 1 addition & 1 deletion src/openklant/tests/test_cors_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_credentialed_request(self):
response = self.client.get(
"/cors",
HTTP_ORIGIN="http://localhost:3000",
HTTP_AUTHORIZATION="Bearer foobarbaz",
HTTP_AUTHORIZATION="Token foobarbaz",
)

self.assertEqual(response["Access-Control-Allow-Origin"], "*")
Expand Down

0 comments on commit e80ba3d

Please sign in to comment.