Skip to content

Commit 60f13e1

Browse files
authored
Correct OIDC URL generation and raise max payload size (#3486)
* Raise max request payload size to 100Gb * Replace some urljoin() calls with simple string concatenation
1 parent 61be9df commit 60f13e1

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

lib/pbench/server/auth/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from http import HTTPStatus
55
import logging
66
from typing import Any, Optional
7-
from urllib.parse import urljoin
87

98
import jwt
109
import requests
@@ -54,7 +53,7 @@ def _method(
5453
5554
Args:
5655
method : The API HTTP method
57-
path : Path for the request.
56+
path : Path for the request (must begin with a slash).
5857
data : Form data to send with the request in case of the POST
5958
json : JSON data to send with the request in case of the POST
6059
kwargs : Additional keyword args
@@ -65,7 +64,7 @@ def _method(
6564
final_headers = self.headers.copy()
6665
if headers is not None:
6766
final_headers.update(headers)
68-
url = urljoin(self.server_url, path)
67+
url = self.server_url + path
6968
request_dict = dict(
7069
params=kwargs,
7170
data=data,
@@ -322,7 +321,7 @@ def __repr__(self):
322321
)
323322

324323
def set_oidc_public_key(self):
325-
realm_public_key_uri = f"realms/{self._realm_name}"
324+
realm_public_key_uri = f"/realms/{self._realm_name}"
326325
response_json = self._connection.get(realm_public_key_uri).json()
327326
public_key = response_json["public_key"]
328327
pem_public_key = "-----BEGIN PUBLIC KEY-----\n"

lib/pbench/test/unit/server/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from stat import ST_MTIME
1111
import tarfile
1212
from typing import Dict, Optional
13-
from urllib.parse import urljoin
1413
import uuid
1514

1615
from cryptography.hazmat.primitives.asymmetric import rsa
@@ -165,7 +164,7 @@ def add_auth_connection_mock(server_config, rsa_keys):
165164
with responses.RequestsMock() as mock:
166165
oidc_server = server_config.get("openid", "server_url")
167166
oidc_realm = server_config.get("openid", "realm")
168-
url = urljoin(oidc_server, f"realms/{oidc_realm}")
167+
url = oidc_server + "/realms/" + oidc_realm
169168

170169
mock.add(
171170
responses.GET,

server/lib/config/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ http {
121121
proxy_set_header X-Real-IP $remote_addr;
122122
proxy_set_header X-Forwarded-Proto $scheme;
123123

124-
client_max_body_size 10G;
124+
client_max_body_size 100G;
125125
}
126126

127127
location /dashboard {

0 commit comments

Comments
 (0)