Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sec: BI-0 update versions #651

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import importlib.metadata
import logging
import os
from typing import Any
Expand Down Expand Up @@ -135,7 +136,12 @@ def home():

client = app.test_client()
for c_name, c_val in request_cookies.items():
client.set_cookie("localhost", c_name, c_val)
# TODO: after migration to werkzeug 3.0.3+, replace this condition with
# client.set_cookie(key=c_name, value=c_val)
if importlib.metadata.version("werkzeug") == "3.0.3":
client.set_cookie(key=c_name, value=c_val)
else:
client.set_cookie(server_name="localhost", key=c_name, value=c_val)

resp = client.get(
request_path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,18 @@ async def run(self) -> TaskResult:
conn: aiohttp.BaseConnector
if self._ctx.secure_reader_settings.endpoint is not None:
secure_reader_endpoint = self._ctx.secure_reader_settings.endpoint
# TODO: after migration to aiohttp 3.9.4+ replace with
# ssl_context: ssl.SSLContext | True = True
ssl_context: Optional[ssl.SSLContext] = None
if self._ctx.secure_reader_settings.cafile is not None:
ssl_context = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS)
ssl_context.load_verify_locations(cafile=self._ctx.secure_reader_settings.cafile)
conn = aiohttp.TCPConnector(ssl=ssl_context)
# TODO: after migration to aiohttp 3.9.4+ replace condition with
# aiohttp.TCPConnector(ssl=ssl_context)
if ssl_context is not None:
conn = aiohttp.TCPConnector(ssl=ssl_context)
else:
conn = aiohttp.TCPConnector()
else:
socket_path = self._ctx.secure_reader_settings.socket
secure_reader_endpoint = f"http+unix://{urllib.parse.quote_plus(socket_path)}"
Expand Down
Loading
Loading