Skip to content

Commit

Permalink
Correct OIDC URL generation and raise max payload size (#3486)
Browse files Browse the repository at this point in the history
* Raise max request payload size to 100Gb
* Replace some urljoin() calls with simple string concatenation
  • Loading branch information
webbnh authored Jul 7, 2023
1 parent 61be9df commit 60f13e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions lib/pbench/server/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from http import HTTPStatus
import logging
from typing import Any, Optional
from urllib.parse import urljoin

import jwt
import requests
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions lib/pbench/test/unit/server/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion server/lib/config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 60f13e1

Please sign in to comment.