Skip to content

Commit

Permalink
[#7028] Lint, changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Sep 15, 2022
1 parent b620d1a commit d707ab6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions changes/7088.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Site maintainers can choose to completely ignore cookie based by using ``ckan.auth.disable_cookie_auth_in_api``. When set to True, all API requests must use :ref:`API Tokens <api authentication>`. Note that this is likely to affect JS modules from the frontend that perform API calls, so it should be used with caution.
4 changes: 2 additions & 2 deletions ckan/config/middleware/flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ def load_user(user_id: str) -> Optional["model.User"]: # type: ignore
@login_manager.request_loader
def load_user_from_request(request): # type: ignore
"""
This callback function is called whenever a user could not be authenticated
via the session cookie, so we fall back to the API token
This callback function is called whenever a user could not be
authenticated via the session cookie, so we fall back to the API token.
"""
user = _get_user_for_apitoken()
return user
Expand Down
1 change: 0 additions & 1 deletion ckan/tests/controllers/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,4 +380,3 @@ def test_cookie_based_auth_disabled(app):
res = app.get(url, environ_overrides=env)

assert res.status_code == 200

0 comments on commit d707ab6

Please sign in to comment.