Skip to content

Commit 146947d

Browse files
committed
Updated changelog and moved change to unreleased. Updated test files with license header
1 parent 55d0af1 commit 146947d

File tree

4 files changed

+47
-17
lines changed

4 files changed

+47
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
> Use [this search for a list of all CHANGELOG.md files in this repo](https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-python-contrib+path%3A**%2FCHANGELOG.md&type=code).
1111
1212
## Unreleased
13+
- `opentelemetry-util-http` Added support for redacting specific url query string values and url credentials in instrumentations
14+
([#3508](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3508))
1315

1416
## Version 1.34.0/0.55b0 (2025-06-04)
1517

@@ -74,8 +76,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7476

7577
- `opentelemetry-instrumentation-aiohttp-client` Add support for HTTP metrics
7678
([#3517](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3517))
77-
- `opentelemetry-util-http` Added support for redacting specific url query string values and url credentials in instrumentations
78-
([#3508](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3508))
7979
- `opentelemetry-instrumentation-httpx` Add support for HTTP metrics
8080
([#3513](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3513))
8181
- `opentelemetry-instrumentation` Allow re-raising exception when instrumentation fails

util/opentelemetry-util-http/tests/test_redact_query_parameters.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
import unittest
216
from opentelemetry.util.http import redact_query_parameters
317

util/opentelemetry-util-http/tests/test_redact_url.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
import unittest
2-
from opentelemetry.util.http import redact_url, PARAMS_TO_REDACT
16+
from opentelemetry.util.http import redact_url
317

418
class TestRedactUrl(unittest.TestCase):
519
def test_redact_both_credentials_and_query_params(self):
@@ -32,8 +46,4 @@ def test_edge_cases(self):
3246

3347
# URL with IP address instead of domain
3448
url3 = "https://user:[email protected]/path?X-Goog-Signature=xyz"
35-
self.assertEqual(redact_url(url3), "https://REDACTED:[email protected]/path?X-Goog-Signature=REDACTED")
36-
37-
38-
if __name__ == "__main__":
39-
unittest.main()
49+
self.assertEqual(redact_url(url3), "https://REDACTED:[email protected]/path?X-Goog-Signature=REDACTED")

util/opentelemetry-util-http/tests/test_remove_credentials.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
import unittest
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
214

15+
import unittest
316
from opentelemetry.util.http import remove_url_credentials
417

5-
618
class TestRemoveUrlCredentials(unittest.TestCase):
719
def test_remove_no_credentials(self):
820
url = "http://opentelemetry.io:8080/test/path?query=value"
@@ -28,10 +40,4 @@ def test_remove_credentials_ipv6_literal(self):
2840
cleaned_url = remove_url_credentials(url)
2941
self.assertEqual(
3042
cleaned_url, "http://REDACTED:REDACTED@[::1]:8080/test/path?query=value"
31-
)
32-
33-
def test_empty_url(self):
34-
url = ""
35-
cleaned_url = remove_url_credentials(url)
36-
self.assertEqual(cleaned_url, url)
37-
43+
)

0 commit comments

Comments
 (0)