Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-opentelemetry-util-http for
openSUSE:Factory checked in at 2026-09-30 16:23:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-opentelemetry-util-http (Old)
and
/work/SRC/openSUSE:Factory/.python-opentelemetry-util-http.new.1465845 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-opentelemetry-util-http"
Wed Sep 30 16:23:42 2026 rev:13 rq:1381473 version:0.66b0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-opentelemetry-util-http/python-opentelemetry-util-http.changes
2026-07-21 22:58:20.857514583 +0200
+++
/work/SRC/openSUSE:Factory/.python-opentelemetry-util-http.new.1465845/python-opentelemetry-util-http.changes
2026-09-30 16:24:30.411989979 +0200
@@ -1,0 +2,110 @@
+Tue Sep 29 10:37:19 UTC 2026 - Nico Krapp <[email protected]>
+
+- Update to 0.66b0
+ * ### Added
+ * opentelemetry-instrumentation-psycopg2, opentelemetry-
+ instrumentation-psycopg: Add sqlcommenter support for
+ instrument_connection (#4267)
+ * opentelemetry-instrumentation-fastapi: Document
+ auto-instrumentation setup and HTTP/WebSocket trace propagation
+ opentelemetry-instrumentation: Include the instrumentation
+ README in API docs (#4555)
+ * opentelemetry-instrumentation-botocore: capture Bedrock prompt
+ cache token usage for converse and converse_stream API (#4615)
+ * opentelemetry-instrumentation-fastapi: advertise inline type
+ annotations (#4685)
+ * opentelemetry-instrumentation-kafka-python: Update kafka python
+ instrumentation to support kafka-python>=3 (#4786)
+ * opentelemetry-instrumentation-mysql: add semantic convention
+ stability opt-in mode tests (#4810)
+ * opentelemetry-instrumentation-aiopg: Add DB client operation
+ duration and returned rows metrics. (#4826)
+ * opentelemetry-instrumentation-httpx: support strict typing
+ * opentelemetry-instrumentation-mysqlclient: add semantic
+ convention stability opt-in mode tests (#4834)
+ * opentelemetry-instrumentation-pymysql: add semantic convention
+ stability opt-in mode tests (#4835)
+ * opentelemetry-instrumentation-sqlite3: add semantic convention
+ stability opt-in mode tests (#4836)
+ * opentelemetry-instrumentation-psycopg: add semantic convention
+ stability opt-in mode tests (#4838)
+ * infra: add validation for changelog file format (#4856)
+ * opentelemetry-instrumentation-aio-pika: bump maximum admissible
+ aio-pika version to 11.0.0 (#4998)
+ * ### Changed
+ * opentelemetry-instrumentation: clarify dependency conflict
+ messages, in logs and in DependencyConflictError, and promote
+ auto-instrumentation version conflict logs to error level
+ * ### Removed
+ * opentelemetry-instrumentation-kafka-python: drop support for
+ the deprecated kafka-python-ng fork now that kafka-python is
+ actively maintained again (#4839)
+ * opentelemetry-instrumentation-kafka-python: remove unused
+ KafkaPropertiesExtractor.extract_send_key and
+ KafkaPropertiesExtractor.extract_send_value helpers (#4858)
+ * opentelemetry-instrumentation-anthropic, opentelemetry-
+ instrumentation-claude-agent-sdk, opentelemetry-
+ instrumentation-langchain, opentelemetry-instrumentation-
+ weaviate: removed from this repository; these instrumentations
+ now live in and are maintained from the opentelemetry-python-
+ genai repository (#4903)
+ * ### Fixed
+ * opentelemetry-instrumentation-aws-lambda: support ALB
+ multiValueHeaders (#4605)
+ * opentelemetry-instrumentation-redis: extract ClusterPipeline
+ commands from _execution_strategy in redis-py 6+ so pipeline
+ span attributes include the queued commands instead of being
+ empty (#4728)
+ * opentelemetry-instrumentation-aiopg: fix connection metadata
+ for manual instrumentation (#4821)
+ * opentelemetry-instrumentation-redis: treat explicit db=None as
+ database index 0 (#4828)
+ * opentelemetry-instrumentation-aws-lambda: use the correct camel
+ case when accessing the SQS message attributes (#4831)
+ * opentelemetry-instrumentation-botocore: Restore PyPy test
+ coverage. (#4841)
+ * opentelemetry-instrumentation-botocore: don't emit error status
+ on 3xx ClientError responses (#4851)
+ * opentelemetry-instrumentation-kafka-python: record the actual
+ messaging.kafka.partition read back from the producer send()
+ future, instead of a pre-computed estimate that did not match
+ the delivered partition for randomly-partitioned messages
+ * opentelemetry-instrumentation-logging: Promote otel.event.name
+ to LogRecord.event_name in _translate (#4864)
+ * opentelemetry-instrumentation-grpc: respect suppressed
+ instrumentation in server interceptors (#4870)
+ * opentelemetry-instrumentation-logging: Import code_attributes
+ from stable semconv package (#4873)
+ * opentelemetry-instrumentation-asyncio: fix to_thread
+ instrumentation so spans and duration metrics measure the
+ actual function execution instead of ending immediately,
+ repeated calls of the same function are all recorded instead of
+ only the first one, and failures are recorded with the same
+ state values (exception, timeout, cancelled) as the coroutine
+ and future paths; the AsyncioInstrumentor.trace_to_thread
+ method is renamed to AsyncioInstrumentor.wrap_to_thread_func to
+ reflect that it now returns a wrapper (#4901)
+ * opentelemetry-instrumentation-logging: fix documented name of
+ the code attributes env var to OTEL_PYTHON_LOG_CODE_ATTRIBUTES
+ * opentelemetry-instrumentation-psycopg: avoid IndexError in
+ get_operation_name for comment-only or whitespace-only Composed
+ statements (#4936)
+ * opentelemetry-instrumentation-psycopg2: avoid IndexError in
+ get_operation_name for comment-only or whitespace-only
+ statements (#4942)
+ * opentelemetry-instrumentation-sqlalchemy: avoid IndexError in
+ _operation_name for comment-only or whitespace-only statements
+ * opentelemetry-instrumentation-mysql: support mysql-connector-
+ python 26.7.0 and later (#4951)
+ * opentelemetry-util-http: stop _parse_url_query raising on
+ unparsable urls (#4965)
+ * opentelemetry-instrumentation-asyncio: fix metric name and
+ future example in module docs (#5083)
+ * opentelemetry-instrumentation-pymemcache: honor instrumentation
+ suppression (#5086)
+ * opentelemetry-instrumentation-asyncpg: honor instrumentation
+ suppression (#5087)
+ * opentelemetry-propagator-ot-trace: cap ot-baggage-* entries on
+ extract and inject (#5098)
+
+-------------------------------------------------------------------
Old:
----
opentelemetry_util_http-0.64b0.tar.gz
New:
----
opentelemetry_util_http-0.66b0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-opentelemetry-util-http.spec ++++++
--- /var/tmp/diff_new_pack.xyHSFN/_old 2026-09-30 16:24:31.146020544 +0200
+++ /var/tmp/diff_new_pack.xyHSFN/_new 2026-09-30 16:24:31.147020585 +0200
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-opentelemetry-util-http
-Version: 0.64b0
+Version: 0.66b0
Release: 0
Summary: Instrumentation Tools & Auto Instrumentation for OpenTelemetry
Python
License: Apache-2.0
++++++ opentelemetry_util_http-0.64b0.tar.gz ->
opentelemetry_util_http-0.66b0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/opentelemetry_util_http-0.64b0/PKG-INFO
new/opentelemetry_util_http-0.66b0/PKG-INFO
--- old/opentelemetry_util_http-0.64b0/PKG-INFO 2020-02-02 01:00:00.000000000
+0100
+++ new/opentelemetry_util_http-0.66b0/PKG-INFO 2020-02-02 01:00:00.000000000
+0100
@@ -1,6 +1,6 @@
-Metadata-Version: 2.4
+Metadata-Version: 2.5
Name: opentelemetry-util-http
-Version: 0.64b0
+Version: 0.66b0
Summary: Web util for OpenTelemetry
Project-URL: Homepage,
https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/util/opentelemetry-util-http
Project-URL: Repository,
https://github.com/open-telemetry/opentelemetry-python-contrib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/src/opentelemetry/util/http/__init__.py
new/opentelemetry_util_http-0.66b0/src/opentelemetry/util/http/__init__.py
--- old/opentelemetry_util_http-0.64b0/src/opentelemetry/util/http/__init__.py
2020-02-02 01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/src/opentelemetry/util/http/__init__.py
2020-02-02 01:00:00.000000000 +0100
@@ -3,12 +3,12 @@
from __future__ import annotations
-from collections.abc import Mapping
+from collections.abc import Callable, Iterable, Mapping
from os import environ
from re import IGNORECASE as RE_IGNORECASE
from re import compile as re_compile
from re import search
-from typing import Callable, Iterable, overload
+from typing import overload
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
from opentelemetry.semconv._incubating.attributes.http_attributes import (
@@ -28,25 +28,13 @@
)
from opentelemetry.util.http.constants import BOT_PATTERNS, TEST_PATTERNS
-OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS = (
- "OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS"
-)
-OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST = (
- "OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST"
-)
-OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE = (
- "OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE"
-)
-OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_REQUEST = (
- "OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_REQUEST"
-)
-OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_RESPONSE = (
- "OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_RESPONSE"
-)
+OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS =
"OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS"
+OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST =
"OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST"
+OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE =
"OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE"
+OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_REQUEST =
"OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_REQUEST"
+OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_RESPONSE =
"OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_CLIENT_RESPONSE"
-OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS = (
- "OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS"
-)
+OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS =
"OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS"
# List of recommended metrics attributes
_duration_attrs = {
@@ -92,11 +80,7 @@
self._regex = re_compile("|".join(sanitized_fields), RE_IGNORECASE)
def sanitize_header_value(self, header: str, value: str) -> str:
- return (
- "[REDACTED]"
- if (self._sanitized_fields and search(self._regex, header))
- else value
- )
+ return "[REDACTED]" if (self._sanitized_fields and search(self._regex,
header)) else value
def sanitize_header_values(
self,
@@ -116,16 +100,9 @@
if header_regexes_compiled.fullmatch(header_name):
key = normalize_function(header_name.lower())
if isinstance(header_value, str):
- values[key] = [
- self.sanitize_header_value(
- header_name, header_value
- )
- ]
+ values[key] = [self.sanitize_header_value(header_name,
header_value)]
else:
- values[key] = [
- self.sanitize_header_value(header_name, value)
- for value in header_value
- ]
+ values[key] = [self.sanitize_header_value(header_name,
value) for value in header_value]
return values
@@ -134,14 +111,9 @@
def get_traced_request_attrs(instrumentation: str) -> list[str]:
- traced_request_attrs = environ.get(
- _root.format(f"{instrumentation}_TRACED_REQUEST_ATTRS")
- )
+ traced_request_attrs =
environ.get(_root.format(f"{instrumentation}_TRACED_REQUEST_ATTRS"))
if traced_request_attrs:
- return [
- traced_request_attr.strip()
- for traced_request_attr in traced_request_attrs.split(",")
- ]
+ return [traced_request_attr.strip() for traced_request_attr in
traced_request_attrs.split(",")]
return []
@@ -161,9 +133,7 @@
Small helper to put an arbitrary url list inside an ExcludeList
"""
if excluded_urls:
- excluded_url_list = [
- excluded_url.strip() for excluded_url in excluded_urls.split(",")
- ]
+ excluded_url_list = [excluded_url.strip() for excluded_url in
excluded_urls.split(",")]
else:
excluded_url_list = []
@@ -218,7 +188,8 @@
if (
environ.get(OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS)
or
- # Based on https://www.rfc-editor.org/rfc/rfc7231#section-4.1 and
https://www.rfc-editor.org/rfc/rfc5789#section-2.
+ # Based on https://www.rfc-editor.org/rfc/rfc9110.html#name-methods,
https://www.rfc-editor.org/rfc/rfc5789#section-2
+ # and https://datatracker.ietf.org/doc/rfc10008/.
method
in [
"GET",
@@ -230,6 +201,7 @@
"OPTIONS",
"TRACE",
"PATCH",
+ "QUERY",
]
):
return method
@@ -239,10 +211,7 @@
def get_custom_headers(env_var: str) -> list[str]:
custom_headers = environ.get(env_var, None)
if custom_headers:
- return [
- custom_headers.strip()
- for custom_headers in custom_headers.split(",")
- ]
+ return [custom_headers.strip() for custom_headers in
custom_headers.split(",")]
return []
@@ -270,29 +239,36 @@
if not headers or not captured_headers:
return {}
sanitize: SanitizeValue = SanitizeValue(sensitive_headers or ())
- return sanitize.sanitize_header_values(
- headers, captured_headers, normalize_function
- )
+ return sanitize.sanitize_header_values(headers, captured_headers,
normalize_function)
def _parse_active_request_count_attrs(req_attrs):
active_requests_count_attrs = {
- key: req_attrs[key]
- for key in _active_requests_count_attrs.intersection(req_attrs.keys())
+ key: req_attrs[key] for key in
_active_requests_count_attrs.intersection(req_attrs.keys())
}
return active_requests_count_attrs
def _parse_duration_attrs(req_attrs):
- duration_attrs = {
- key: req_attrs[key]
- for key in _duration_attrs.intersection(req_attrs.keys())
- }
+ duration_attrs = {key: req_attrs[key] for key in
_duration_attrs.intersection(req_attrs.keys())}
return duration_attrs
-def _parse_url_query(url: str):
- parsed_url = urlparse(url)
+def _parse_url_query(url: str) -> tuple[str, str]:
+ """Split a url into its path and query components.
+
+ Callers may pass request targets that come straight off the request line,
+ so the url need not be parsable. An unparsable one yields empty components
+ rather than raising, since instrumentation must never break the request it
+ is measuring.
+
+ Returns:
+ The path and the query string, either of which may be empty.
+ """
+ try:
+ parsed_url = urlparse(url)
+ except ValueError: # an unparsable url was passed
+ return "", ""
path = parsed_url.path
query_params = parsed_url.query
return path, query_params
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/src/opentelemetry/util/http/httplib.py
new/opentelemetry_util_http-0.66b0/src/opentelemetry/util/http/httplib.py
--- old/opentelemetry_util_http-0.64b0/src/opentelemetry/util/http/httplib.py
2020-02-02 01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/src/opentelemetry/util/http/httplib.py
2020-02-02 01:00:00.000000000 +0100
@@ -13,7 +13,8 @@
import logging
import socket # pylint:disable=unused-import # Used for typing
import typing
-from typing import Any, Callable, Collection, TypedDict, cast
+from collections.abc import Callable, Collection
+from typing import Any, TypedDict, cast
import wrapt
@@ -62,9 +63,7 @@
return True
-def trysetip(
- conn: http.client.HTTPConnection, loglevel: int = logging.DEBUG
-) -> bool:
+def trysetip(conn: http.client.HTTPConnection, loglevel: int = logging.DEBUG)
-> bool:
"""Tries to set the net.peer.ip semantic attribute on the current span
from the given
HttpConnection.
@@ -75,7 +74,7 @@
state = _getstate()
if not state:
return True
- spanlist: typing.List[Span] = state.get("need_ip")
+ spanlist: list[Span] = state.get("need_ip")
if not spanlist:
return True
@@ -86,7 +85,7 @@
sock = "<property not accessed>"
ip = None
try:
- sock: typing.Optional[socket.socket] = conn.sock
+ sock: socket.socket | None = conn.sock
logger.debug("Got socket: %s", sock)
if sock is None:
return False
@@ -164,9 +163,7 @@
def set_ip_on_next_http_connection(span: Span):
state = _getstate()
if not state:
- token = context.attach(
- context.set_value(_STATE_KEY, {"need_ip": [span]})
- )
+ token = context.attach(context.set_value(_STATE_KEY, {"need_ip":
[span]}))
try:
yield
finally:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/src/opentelemetry/util/http/version.py
new/opentelemetry_util_http-0.66b0/src/opentelemetry/util/http/version.py
--- old/opentelemetry_util_http-0.64b0/src/opentelemetry/util/http/version.py
2020-02-02 01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/src/opentelemetry/util/http/version.py
2020-02-02 01:00:00.000000000 +0100
@@ -1,4 +1,4 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
-__version__ = "0.64b0"
+__version__ = "0.66b0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/tests/test_capture_custom_headers.py
new/opentelemetry_util_http-0.66b0/tests/test_capture_custom_headers.py
--- old/opentelemetry_util_http-0.64b0/tests/test_capture_custom_headers.py
2020-02-02 01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/tests/test_capture_custom_headers.py
2020-02-02 01:00:00.000000000 +0100
@@ -18,28 +18,18 @@
class TestCaptureCustomHeaders(unittest.TestCase):
@patch.dict(
"os.environ",
- {
- OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST:
"User-Agent,Test-Header"
- },
+ {OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST:
"User-Agent,Test-Header"},
)
def test_get_custom_request_header(self):
- custom_headers_to_capture = get_custom_headers(
- OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST
- )
- self.assertEqual(
- custom_headers_to_capture, ["User-Agent", "Test-Header"]
- )
+ custom_headers_to_capture =
get_custom_headers(OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST)
+ self.assertEqual(custom_headers_to_capture, ["User-Agent",
"Test-Header"])
@patch.dict(
"os.environ",
- {
- OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE:
"content-type,content-length,test-header"
- },
+ {OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE:
"content-type,content-length,test-header"},
)
def test_get_custom_response_header(self):
- custom_headers_to_capture = get_custom_headers(
- OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE
- )
+ custom_headers_to_capture =
get_custom_headers(OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE)
self.assertEqual(
custom_headers_to_capture,
[
@@ -51,14 +41,10 @@
@patch.dict(
"os.environ",
- {
- OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS:
"My-Secret-Header,My-Secret-Header-2"
- },
+ {OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS:
"My-Secret-Header,My-Secret-Header-2"},
)
def test_get_custom_sanitize_header(self):
- sanitized_fields = get_custom_headers(
- OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS
- )
+ sanitized_fields =
get_custom_headers(OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS)
self.assertEqual(
sanitized_fields,
["My-Secret-Header", "My-Secret-Header-2"],
@@ -66,28 +52,20 @@
@patch.dict(
"os.environ",
- {
- OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS:
"My-Secret-Header,My-Secret-Header-2"
- },
+ {OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS:
"My-Secret-Header,My-Secret-Header-2"},
)
def test_sanitize(self):
- sanitized_fields = get_custom_headers(
- OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS
- )
+ sanitized_fields =
get_custom_headers(OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS)
sanitize = SanitizeValue(sanitized_fields)
self.assertEqual(
- sanitize.sanitize_header_value(
- header="My-Secret-Header", value="My-Secret-Value"
- ),
+ sanitize.sanitize_header_value(header="My-Secret-Header",
value="My-Secret-Value"),
"[REDACTED]",
)
self.assertEqual(
- sanitize.sanitize_header_value(
- header="My-Not-Secret-Header", value="My-Not-Secret-Value"
- ),
+ sanitize.sanitize_header_value(header="My-Not-Secret-Header",
value="My-Not-Secret-Value"),
"My-Not-Secret-Value",
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/tests/test_detect_synthetic_user_agent.py
new/opentelemetry_util_http-0.66b0/tests/test_detect_synthetic_user_agent.py
---
old/opentelemetry_util_http-0.64b0/tests/test_detect_synthetic_user_agent.py
2020-02-02 01:00:00.000000000 +0100
+++
new/opentelemetry_util_http-0.66b0/tests/test_detect_synthetic_user_agent.py
2020-02-02 01:00:00.000000000 +0100
@@ -44,9 +44,7 @@
def test_normal_user_agent_not_detected(self):
"""Test that normal browser user agents are not detected as
synthetic."""
- user_agent = (
- "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
- )
+ user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36"
result = detect_synthetic_user_agent(user_agent)
self.assertIsNone(result)
@@ -103,19 +101,13 @@
self.assertEqual(normalize_user_agent("Mozilla"), "Mozilla")
def test_decodes_bytes(self):
- self.assertEqual(
- normalize_user_agent(b"Custom-Client/1.0"), "Custom-Client/1.0"
- )
+ self.assertEqual(normalize_user_agent(b"Custom-Client/1.0"),
"Custom-Client/1.0")
def test_decodes_bytearray(self):
- self.assertEqual(
- normalize_user_agent(bytearray(b"Bot/2.0")), "Bot/2.0"
- )
+ self.assertEqual(normalize_user_agent(bytearray(b"Bot/2.0")),
"Bot/2.0")
def test_decodes_memoryview(self):
- self.assertEqual(
- normalize_user_agent(memoryview(b"Monitor/3.0")), "Monitor/3.0"
- )
+ self.assertEqual(normalize_user_agent(memoryview(b"Monitor/3.0")),
"Monitor/3.0")
def test_none(self):
self.assertIsNone(normalize_user_agent(None))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/tests/test_http_excluded_urls.py
new/opentelemetry_util_http-0.66b0/tests/test_http_excluded_urls.py
--- old/opentelemetry_util_http-0.64b0/tests/test_http_excluded_urls.py
2020-02-02 01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/tests/test_http_excluded_urls.py
2020-02-02 01:00:00.000000000 +0100
@@ -10,9 +10,7 @@
class TestGetExcludedUrls(unittest.TestCase):
@patch.dict(
"os.environ",
- {
- "OTEL_PYTHON_DJANGO_EXCLUDED_URLS":
"excluded_arg/123,excluded_noarg"
- },
+ {"OTEL_PYTHON_DJANGO_EXCLUDED_URLS":
"excluded_arg/123,excluded_noarg"},
)
def test_config_from_instrumentation_env(self):
exclude_list = get_excluded_urls("DJANGO")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/tests/test_parse_url_query.py
new/opentelemetry_util_http-0.66b0/tests/test_parse_url_query.py
--- old/opentelemetry_util_http-0.64b0/tests/test_parse_url_query.py
1970-01-01 01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/tests/test_parse_url_query.py
2020-02-02 01:00:00.000000000 +0100
@@ -0,0 +1,35 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+import unittest
+
+from opentelemetry.util.http import _parse_url_query
+
+
+class TestParseUrlQuery(unittest.TestCase):
+ def test_absolute_url(self):
+ self.assertEqual(
+ _parse_url_query("https://example.com/path?color=blue"),
+ ("/path", "color=blue"),
+ )
+
+ def test_request_target(self):
+ self.assertEqual(_parse_url_query("/path?color=blue"), ("/path",
"color=blue"))
+
+ def test_no_query(self):
+ self.assertEqual(_parse_url_query("/path"), ("/path", ""))
+
+ def test_empty_url(self):
+ self.assertEqual(_parse_url_query(""), ("", ""))
+
+ def test_unparsable_url_returns_empty_components(self):
+ # urlparse raises "Invalid IPv6 URL" on an unbalanced bracket in what
+ # it takes to be the netloc. Request targets are attacker controlled,
+ # so this must not propagate out of instrumentation.
+ self.assertEqual(_parse_url_query("//exa[mple"), ("", ""))
+
+ def test_unparsable_url_with_query_returns_empty_components(self):
+ self.assertEqual(_parse_url_query("//exa[mple?color=blue"), ("", ""))
+
+ def test_unparsable_absolute_url_returns_empty_components(self):
+ self.assertEqual(_parse_url_query("http://example.com[invalid"), ("",
""))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/tests/test_redact_query_parameters.py
new/opentelemetry_util_http-0.66b0/tests/test_redact_query_parameters.py
--- old/opentelemetry_util_http-0.64b0/tests/test_redact_query_parameters.py
2020-02-02 01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/tests/test_redact_query_parameters.py
2020-02-02 01:00:00.000000000 +0100
@@ -23,15 +23,11 @@
def test_no_query_parameters(self):
url = "https://www.example.com/path"
- self.assertEqual(
- redact_query_parameters(url), "https://www.example.com/path"
- )
+ self.assertEqual(redact_query_parameters(url),
"https://www.example.com/path")
def test_empty_query_string(self):
url = "https://www.example.com/path?"
- self.assertEqual(
- redact_query_parameters(url), "https://www.example.com/path?"
- )
+ self.assertEqual(redact_query_parameters(url),
"https://www.example.com/path?")
def test_empty_url(self):
url = ""
@@ -60,9 +56,7 @@
def test_url_with_at_symbol_in_path_and_query(self):
url = "https://example.com/p@th?foo=b@r"
- self.assertEqual(
- redact_query_parameters(url), "https://example.com/p@th?foo=b@r"
- )
+ self.assertEqual(redact_query_parameters(url),
"https://example.com/p@th?foo=b@r")
def test_aws_access_key_with_real_format(self):
url = "https://mock.com?AWSAccessKeyId=AKIAIOSFODNN7"
@@ -72,12 +66,8 @@
)
def test_signature_parameter(self):
- url = (
- "https://service.com?sig=39Up9jzHkxhuIhFE9594DJxe7w6cIRCg0V6ICGS0"
- )
- self.assertEqual(
- redact_query_parameters(url), "https://service.com?sig=REDACTED"
- )
+ url =
"https://service.com?sig=39Up9jzHkxhuIhFE9594DJxe7w6cIRCg0V6ICGS0"
+ self.assertEqual(redact_query_parameters(url),
"https://service.com?sig=REDACTED")
def test_signature_with_url_encoding(self):
url =
"https://service.com?Signature=39Up9jzHkxhuIhFE9594DJxe7w6cIRCg0V6ICGS0%3A377"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/tests/test_redact_url.py
new/opentelemetry_util_http-0.66b0/tests/test_redact_url.py
--- old/opentelemetry_util_http-0.64b0/tests/test_redact_url.py 2020-02-02
01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/tests/test_redact_url.py 2020-02-02
01:00:00.000000000 +0100
@@ -16,7 +16,9 @@
def test_multiple_sensitive_query_params(self):
"""Test URL with multiple sensitive query parameters."""
url =
"https://admin:[email protected]/secure?Signature=abc123&X-Goog-Signature=xyz789&sig=def456"
- expected =
"https://REDACTED:[email protected]/secure?Signature=REDACTED&X-Goog-Signature=REDACTED&sig=REDACTED"
+ expected = (
+
"https://REDACTED:[email protected]/secure?Signature=REDACTED&X-Goog-Signature=REDACTED&sig=REDACTED"
+ )
self.assertEqual(redact_url(url), expected)
def test_url_with_special_characters(self):
@@ -28,18 +30,14 @@
def test_edge_cases(self):
"""Test unusual URL formats and corner cases."""
# URL with fragment
- url1 = (
- "https://user:[email protected]/data?Signature=secret#section"
- )
+ url1 =
"https://user:[email protected]/data?Signature=secret#section"
self.assertEqual(
redact_url(url1),
"https://REDACTED:[email protected]/data?Signature=REDACTED#section",
)
# URL with port number
- url2 = (
- "https://user:[email protected]:8443/data?AWSAccessKeyId=secret"
- )
+ url2 =
"https://user:[email protected]:8443/data?AWSAccessKeyId=secret"
self.assertEqual(
redact_url(url2),
"https://REDACTED:[email protected]:8443/data?AWSAccessKeyId=REDACTED",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/tests/test_sanitize_method.py
new/opentelemetry_util_http-0.66b0/tests/test_sanitize_method.py
--- old/opentelemetry_util_http-0.64b0/tests/test_sanitize_method.py
2020-02-02 01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/tests/test_sanitize_method.py
2020-02-02 01:00:00.000000000 +0100
@@ -23,6 +23,23 @@
method = sanitize_method("UNKNOWN")
self.assertEqual(method, "_OTHER")
+ def test_known_methods(self):
+ known_methods = [
+ "GET",
+ "HEAD",
+ "POST",
+ "PUT",
+ "DELETE",
+ "CONNECT",
+ "OPTIONS",
+ "TRACE",
+ "PATCH",
+ "QUERY",
+ ]
+ for method in known_methods:
+ with self.subTest(method=method):
+ self.assertEqual(method, sanitize_method(method))
+
@patch.dict(
"os.environ",
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/opentelemetry_util_http-0.64b0/tests/test_try_set_ip.py
new/opentelemetry_util_http-0.66b0/tests/test_try_set_ip.py
--- old/opentelemetry_util_http-0.64b0/tests/test_try_set_ip.py 2020-02-02
01:00:00.000000000 +0100
+++ new/opentelemetry_util_http-0.66b0/tests/test_try_set_ip.py 2020-02-02
01:00:00.000000000 +0100
@@ -31,9 +31,7 @@
# Verify that the IP was set correctly
for span in self.mock_state["need_ip"]:
- span.set_attribute.assert_called_once_with(
- "net.peer.ip", "192.168.1.1"
- )
+ span.set_attribute.assert_called_once_with("net.peer.ip",
"192.168.1.1")
self.assertTrue(success)
def test_no_socket_connection(self):
@@ -50,7 +48,5 @@
with self.assertLogs(level=logging.WARNING) as warning:
success = trysetip(self.conn, loglevel=logging.WARNING)
self.assertEqual(len(warning.records), 1)
- self.assertIn(
- "Failed to get peer address", warning.records[0].message
- )
+ self.assertIn("Failed to get peer address",
warning.records[0].message)
self.assertTrue(success)