diff --git a/lib/pbench/server/auth/__init__.py b/lib/pbench/server/auth/__init__.py index aa05d91b14..90ad3358ac 100644 --- a/lib/pbench/server/auth/__init__.py +++ b/lib/pbench/server/auth/__init__.py @@ -4,7 +4,6 @@ from http import HTTPStatus import logging from typing import Any, Optional -from urllib.parse import urljoin import jwt import requests @@ -54,7 +53,7 @@ def _method( Args: method : The API HTTP method - path : Path for the request. + path : Path for the request (must begin with a slash). data : Form data to send with the request in case of the POST json : JSON data to send with the request in case of the POST kwargs : Additional keyword args @@ -65,7 +64,7 @@ def _method( final_headers = self.headers.copy() if headers is not None: final_headers.update(headers) - url = urljoin(self.server_url, path) + url = self.server_url + path request_dict = dict( params=kwargs, data=data, @@ -322,7 +321,7 @@ def __repr__(self): ) def set_oidc_public_key(self): - realm_public_key_uri = f"realms/{self._realm_name}" + realm_public_key_uri = f"/realms/{self._realm_name}" response_json = self._connection.get(realm_public_key_uri).json() public_key = response_json["public_key"] pem_public_key = "-----BEGIN PUBLIC KEY-----\n" diff --git a/lib/pbench/test/unit/server/conftest.py b/lib/pbench/test/unit/server/conftest.py index b448db3ec1..118d518bd8 100644 --- a/lib/pbench/test/unit/server/conftest.py +++ b/lib/pbench/test/unit/server/conftest.py @@ -10,7 +10,6 @@ from stat import ST_MTIME import tarfile from typing import Dict, Optional -from urllib.parse import urljoin import uuid from cryptography.hazmat.primitives.asymmetric import rsa @@ -165,7 +164,7 @@ def add_auth_connection_mock(server_config, rsa_keys): with responses.RequestsMock() as mock: oidc_server = server_config.get("openid", "server_url") oidc_realm = server_config.get("openid", "realm") - url = urljoin(oidc_server, f"realms/{oidc_realm}") + url = oidc_server + "/realms/" + oidc_realm mock.add( responses.GET, diff --git a/server/lib/config/nginx.conf b/server/lib/config/nginx.conf index d23ae63188..83065d76fb 100644 --- a/server/lib/config/nginx.conf +++ b/server/lib/config/nginx.conf @@ -121,7 +121,7 @@ http { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; - client_max_body_size 10G; + client_max_body_size 100G; } location /dashboard {