This repository was archived by the owner on Sep 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +14
-14
lines changed
contrib/opencensus-ext-azure
opencensus/ext/azure/common Expand file tree Collapse file tree 4 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 1414 ([ #949 ] ( https://github.com/census-instrumentation/opencensus-python/pull/949 ) )
1515- Disable heartbeat metrics in exporters
1616 ([ #984 ] ( https://github.com/census-instrumentation/opencensus-python/pull/984 ) )
17+ - Loosen instrumentation key validation to GUID
18+ ([ #984 ] ( https://github.com/census-instrumentation/opencensus-python/pull/984 ) )
1719
1820## 1.0.4
1921Released 2020-06-29
Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ def _transmit(self, envelopes):
7676 except Exception :
7777 pass
7878 if response .status_code == 200 :
79- logger .info ('Transmission succeeded: %s.' , text )
8079 return 0
8180 if response .status_code == 206 : # Partial Content
8281 if data :
Original file line number Diff line number Diff line change @@ -58,12 +58,9 @@ def timestamp_to_iso_str(timestamp):
5858 return to_iso_str (datetime .datetime .utcfromtimestamp (timestamp ))
5959
6060
61- # Validate UUID format
62- # Specs taken from https://tools.ietf.org/html/rfc4122
61+ # Validate GUID format
6362uuid_regex_pattern = re .compile ('^[0-9a-f]{8}-'
64- '[0-9a-f]{4}-'
65- '[1-5][0-9a-f]{3}-'
66- '[89ab][0-9a-f]{3}-'
63+ '([0-9a-f]{4}-){3}'
6764 '[0-9a-f]{12}$' )
6865
6966
Original file line number Diff line number Diff line change @@ -121,12 +121,14 @@ def test_invalid_key_section5_hex(self):
121121 self .assertRaises (ValueError ,
122122 lambda : utils .validate_instrumentation_key (key ))
123123
124- def test_invalid_key_version (self ):
125- key = '1234abcd-5678-6efa-8abc-1234567890ab'
126- self .assertRaises (ValueError ,
127- lambda : utils .validate_instrumentation_key (key ))
124+ def test_valid_key_section2_hex (self ):
125+ key = '1234abcd-567a-4efa-8abc-1234567890ab'
126+ self .assertIsNone (utils .validate_instrumentation_key (key ))
128127
129- def test_invalid_key_variant (self ):
130- key = '1234abcd-5678-4efa-2abc-1234567890ab'
131- self .assertRaises (ValueError ,
132- lambda : utils .validate_instrumentation_key (key ))
128+ def test_valid_key_section3_hex (self ):
129+ key = '1234abcd-5678-befa-8abc-1234567890ab'
130+ self .assertIsNone (utils .validate_instrumentation_key (key ))
131+
132+ def test_valid_key_section4_hex (self ):
133+ key = '1234abcd-5678-4efa-cabc-1234567890ab'
134+ self .assertIsNone (utils .validate_instrumentation_key (key ))
You can’t perform that action at this time.
0 commit comments