Skip to content

Commit c68e336

Browse files
authored
[EH] Emulator prep for release (#35623)
* remove check * update conn tests * no longer validate localhost * import err * Update sdk/eventhub/azure-eventhub/CHANGELOG.md * Update sdk/eventhub/azure-eventhub/CHANGELOG.md
1 parent 1203cfe commit c68e336

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

sdk/eventhub/azure-eventhub/CHANGELOG.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# Release History
22

3-
## 5.11.8 (Unreleased)
3+
## 5.12.0 (2024-05-16)
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
7+
- Added support for non-tls connections (#34272)
128

139
## 5.11.7 (2024-04-10)
1410

sdk/eventhub/azure-eventhub/azure/eventhub/_client_base.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import time
1010
import functools
1111
import collections
12-
import re
1312
from typing import Any, Dict, Tuple, List, Optional, TYPE_CHECKING, cast, Union
1413
from datetime import timedelta
1514
from urllib.parse import urlparse
@@ -69,9 +68,6 @@
6968
_LOGGER = logging.getLogger(__name__)
7069
_Address = collections.namedtuple("_Address", "hostname path")
7170

72-
def _is_local_endpoint(endpoint: str) -> bool:
73-
return re.match("^(127\\.[\\d.]+|[0:]+1|localhost)", endpoint.lower()) is not None
74-
7571
def _parse_conn_str(
7672
conn_str: str, # pylint:disable=unused-argument
7773
*,
@@ -137,13 +133,6 @@ def _parse_conn_str(
137133
host = cast(str, parsed.netloc.strip())
138134

139135
emulator = use_emulator=="true"
140-
if emulator and not _is_local_endpoint(host):
141-
raise ValueError(
142-
"Invalid endpoint on the connection string. "
143-
"For development connection strings, should be in the format: "
144-
"Endpoint=sb://localhost;SharedAccessKeyName=<KeyName>;SharedAccessKey=<KeyValue>;"
145-
"UseDevelopmentEmulator=true;"
146-
)
147136

148137
if any([shared_access_key, shared_access_key_name]) and not all(
149138
[shared_access_key, shared_access_key_name]

sdk/eventhub/azure-eventhub/tests/unittest/test_connection_string_parser.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,6 @@ def test_eh_emulator_slug_parse_localhost(self, **kwargs):
125125
assert emulator == True
126126

127127

128-
def test_eh_emulator_slug_parse_not_localhost(self, **kwargs):
129-
conn_str = 'Endpoint=sb://resourcename.servicebus.windows.net;SharedAccessKeyName=test-policy;SharedAccessKey=THISISATESTKEYXXXXXXXXXXXXXXXXXXXXXXXXXXXX=;UseDevelopmentEmulator=true'
130-
with pytest.raises(ValueError) as e:
131-
fully_qualified_namespace, policy, key, entity, signature, expiry, emulator = _parse_conn_str(
132-
conn_str
133-
)
134-
135128
def test_eh_emulator_slug_parse_ipv6(self, **kwargs):
136129
conn_str = 'Endpoint=sb://::1;SharedAccessKeyName=test-policy;SharedAccessKey=THISISATESTKEYXXXXXXXXXXXXXXXXXXXXXXXXXXXX=;UseDevelopmentEmulator=true'
137130
fully_qualified_namespace, policy, key, entity, signature, expiry, emulator = _parse_conn_str(

0 commit comments

Comments
 (0)