Skip to content

Commit 2c3219b

Browse files
committed
Remove some leftover debugging output
1 parent 5aac189 commit 2c3219b

File tree

3 files changed

+11
-32
lines changed

3 files changed

+11
-32
lines changed

jupyterhub_traefik_proxy/etcd.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ def _default_client(self):
9898
)
9999
if self.etcd_client_kwargs:
100100
kwargs.update(self.etcd_client_kwargs)
101-
print(f"Creating etcd with {kwargs=}")
102101
return etcd3.client(**kwargs)
103102

104103
def _cleanup(self):
@@ -168,11 +167,6 @@ def _setup_traefik_static_config(self):
168167
if url.scheme == "https":
169168
# If etcd is running over TLS, then traefik needs to know
170169
etcd_config["tls"] = {}
171-
# tls_conf = {}
172-
# if self.etcd_client_ca_cert is not None:
173-
# tls_conf["ca"] = self.etcd_client_ca_cert
174-
# tls_conf["insecureSkipVerify"] = self.etcd_insecure_skip_verify
175-
# self.static_config["providers"]["etcd"]["tls"] = tls_conf
176170

177171
if self.etcd_username and self.etcd_password:
178172
etcd_config.update(

tests/conftest.py

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from certipy import Certipy
1818
from consul.aio import Consul
1919
from jupyterhub.utils import exponential_backoff
20-
from passlib.hash import apr_md5_crypt
2120
from traitlets.log import get_logger
2221

2322
from jupyterhub_traefik_proxy.consul import TraefikConsulProxy
@@ -60,15 +59,6 @@ class Config:
6059
public_url = "https://127.0.0.1:8000"
6160

6261

63-
# initial kv config for the API for external kv-stores
64-
_kv_config = {
65-
"traefik/http/middlewares/auth_api/basicAuth/users/0": f"{Config.traefik_api_user}:{apr_md5_crypt(Config.traefik_api_pass)}",
66-
"traefik/http/routers/route_api/entryPoints/0": "auth_api",
67-
"traefik/http/routers/route_api/middlewares/0": "auth_api",
68-
"traefik/http/routers/route_api/rule": "(Host(`127.0.0.1`) || Host(`localhost`)) && PathPrefix(`/api`)",
69-
"traefik/http/routers/route_api/service": "api@internal",
70-
}
71-
7262
# Define a "slow" test marker so that we can run the slow tests at the end
7363

7464

@@ -300,16 +290,16 @@ def _check_ssl(proxy, client_ca):
300290
context.load_cert_chain(proxy.ssl_cert, proxy.ssl_key)
301291

302292
url = urlparse(Config.public_url)
303-
cert = ssl.get_server_certificate((url.hostname, url.port))
304-
from cryptography import x509
305-
from cryptography.hazmat.backends import default_backend
293+
ssl.get_server_certificate((url.hostname, url.port))
306294

307-
certDecoded = x509.load_pem_x509_certificate(str.encode(cert), default_backend())
308-
print(certDecoded)
309-
print(certDecoded.issuer)
310-
print(certDecoded.subject)
311-
print(certDecoded.not_valid_after)
312-
print(certDecoded.not_valid_before)
295+
# from cryptography import x509
296+
# from cryptography.hazmat.backends import default_backend
297+
# certDecoded = x509.load_pem_x509_certificate(str.encode(cert), default_backend())
298+
# print(certDecoded)
299+
# print(certDecoded.issuer)
300+
# print(certDecoded.subject)
301+
# print(certDecoded.not_valid_after)
302+
# print(certDecoded.not_valid_before)
313303

314304
conn = context.wrap_socket(
315305
socket.socket(socket.AF_INET),
@@ -318,9 +308,7 @@ def _check_ssl(proxy, client_ca):
318308
# 5 second timeout
319309
conn.settimeout(5.0)
320310
conn.connect((url.hostname, url.port))
321-
ssl_info = conn.getpeercert()
322-
print(ssl_info, type(ssl_info))
323-
# assert ssl_info == None
311+
conn.getpeercert()
324312

325313

326314
@pytest.fixture
@@ -553,8 +541,6 @@ def _enable_auth_in_etcd(*common_args):
553541
@pytest.fixture
554542
async def launch_etcd_auth(etcd_ssl_key_cert, etcd_client_ca):
555543
key, cert = etcd_ssl_key_cert
556-
print(f"{key=} {cert=}")
557-
os.system(f"openssl x509 -nooout -text -in {cert}")
558544
etcd_proc = subprocess.Popen(
559545
[
560546
"etcd",

tests/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ async def check_host_up_http(url, **req_kwargs):
4545
A socket listening may not be enough
4646
"""
4747
u = urlparse(url)
48-
# first, check the scket
48+
# first, check the socket
4949
socket_open = is_open(u.hostname, u.port or 80)
5050
if not socket_open:
5151
return False
52-
# req_kwargs.setdefault("validate_cert", False)
5352
req = HTTPRequest(url, **req_kwargs)
5453
print(req)
5554
try:

0 commit comments

Comments
 (0)