File tree 4 files changed +10
-10
lines changed
4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 2
2
#
3
3
# This file is part of Invenio.
4
4
# Copyright (C) 2015-2023 CERN.
5
- # Copyright (C) 2024 Graz University of Technology.
5
+ # Copyright (C) 2024-2025 Graz University of Technology.
6
6
#
7
7
# Invenio is free software; you can redistribute it and/or modify it
8
8
# under the terms of the MIT License; see LICENSE file for more details.
@@ -103,7 +103,7 @@ def get_safe_redirect_target(arg="next"):
103
103
:param arg: URL argument.
104
104
:returns: The redirect target or ``None``.
105
105
"""
106
- allowed_hosts = current_app .config .get ("APP_ALLOWED_HOSTS " ) or []
106
+ allowed_hosts = current_app .config .get ("TRUSTED_HOSTS " ) or []
107
107
for target in request .args .get (arg ), request .referrer :
108
108
if target :
109
109
redirect_uri = urisplit (target )
Original file line number Diff line number Diff line change 3
3
# This file is part of Invenio.
4
4
# Copyright (C) 2015-2018 CERN.
5
5
# Copyright (C) 2018 University of Chicago.
6
- # Copyright (C) 2023-2024 Graz University of Technology.
6
+ # Copyright (C) 2023-2025 Graz University of Technology.
7
7
#
8
8
# Invenio is free software; you can redistribute it and/or modify it
9
9
# under the terms of the MIT License; see LICENSE file for more details.
@@ -139,7 +139,7 @@ def base_app(request):
139
139
SECURITY_PASSWORD_HASH = "plaintext" ,
140
140
SECURITY_PASSWORD_SCHEMES = ["plaintext" ],
141
141
SECURITY_PASSWORD_SINGLE_HASH = None ,
142
- APP_ALLOWED_HOSTS = ["localhost" ],
142
+ TRUSTED_HOSTS = ["localhost" ],
143
143
APP_THEME = ["semantic-ui" ],
144
144
THEME_ICONS = {"semantic-ui" : dict (link = "linkify icon" )},
145
145
OAUTHCLIENT_SETTINGS_TEMPLATE = "invenio_oauthclient/settings/base.html" ,
Original file line number Diff line number Diff line change 2
2
#
3
3
# This file is part of Invenio.
4
4
# Copyright (C) 2015-2018 CERN.
5
- # Copyright (C) 2024 Graz University of Technology.
5
+ # Copyright (C) 2024-2025 Graz University of Technology.
6
6
#
7
7
# Invenio is free software; you can redistribute it and/or modify it
8
8
# under the terms of the MIT License; see LICENSE file for more details.
@@ -79,7 +79,7 @@ def test_redirect_uri(views_fixture):
79
79
check_response_redirect_url (resp , url )
80
80
81
81
# Assert that absolute redirects are allowed only if
82
- # `APP_ALLOWED_HOSTS ` is set and includes them. Otherwise, the relative
82
+ # `TRUSTED_HOSTS ` is set and includes them. Otherwise, the relative
83
83
# path of the url is extracted and returned. Note if you need to
84
84
# redirect to index page you should pass '/' as next parameter.
85
85
@@ -91,7 +91,7 @@ def test_redirect_uri(views_fixture):
91
91
92
92
check_response_redirect_url (resp , urlparse (test_url ).path )
93
93
94
- app .config .update ({"APP_ALLOWED_HOSTS " : ["inveniosoftware.org" ]})
94
+ app .config .update ({"TRUSTED_HOSTS " : ["inveniosoftware.org" ]})
95
95
96
96
resp = client .get (
97
97
url_for ("invenio_oauthclient.login" , remote_app = "test" , next = test_url )
Original file line number Diff line number Diff line change 2
2
#
3
3
# This file is part of Invenio.
4
4
# Copyright (C) 2015-2018 CERN.
5
- # Copyright (C) 2024 Graz University of Technology.
5
+ # Copyright (C) 2024-2025 Graz University of Technology.
6
6
#
7
7
# Invenio is free software; you can redistribute it and/or modify it
8
8
# under the terms of the MIT License; see LICENSE file for more details.
@@ -75,7 +75,7 @@ def test_redirect_uri(app_rest):
75
75
check_response_redirect_url (resp , url )
76
76
77
77
# Assert that absolute redirects are allowed only if
78
- # `APP_ALLOWED_HOSTS ` is set and includes them. Otherwise, the relative
78
+ # `TRUSTED_HOSTS ` is set and includes them. Otherwise, the relative
79
79
# path of the url is extracted and returned. Note if you need to
80
80
# redirect to index page you should pass '/' as next parameter.
81
81
@@ -87,7 +87,7 @@ def test_redirect_uri(app_rest):
87
87
88
88
check_response_redirect_url (resp , urlparse (test_url ).path )
89
89
90
- app_rest .config .update ({"APP_ALLOWED_HOSTS " : ["inveniosoftware.org" ]})
90
+ app_rest .config .update ({"TRUSTED_HOSTS " : ["inveniosoftware.org" ]})
91
91
92
92
resp = client .get (
93
93
url_for ("invenio_oauthclient.rest_login" , remote_app = "test" , next = test_url )
You can’t perform that action at this time.
0 commit comments