@@ -27,7 +27,6 @@
Loading
27 27
28 28
import dateutil.parser
29 29
from dateutil.tz import tzutc
30 -
from urllib3.util.url import IPV6_ADDRZ_RE
31 30
32 31
import botocore
33 32
import botocore.awsrequest
@@ -65,6 +64,38 @@
Loading
65 64
)
66 65
S3_ACCELERATE_WHITELIST = ['dualstack']
67 66
67 +
# Vendoring IPv6 validation regex patterns from urllib3
68 +
# https://github.com/urllib3/urllib3/blob/7e856c0/src/urllib3/util/url.py
69 +
IPV4_PAT = r"(?:[0-9]{1,3}\.){3}[0-9]{1,3}"
70 +
HEX_PAT = "[0-9A-Fa-f]{1,4}"
71 +
LS32_PAT = "(?:{hex}:{hex}|{ipv4})".format(hex=HEX_PAT, ipv4=IPV4_PAT)
72 +
_subs = {"hex": HEX_PAT, "ls32": LS32_PAT}
73 +
_variations = [
74 +
    #                            6( h16 ":" ) ls32
75 +
    "(?:%(hex)s:){6}%(ls32)s",
76 +
    #                       "::" 5( h16 ":" ) ls32
77 +
    "::(?:%(hex)s:){5}%(ls32)s",
78 +
    # [               h16 ] "::" 4( h16 ":" ) ls32
79 +
    "(?:%(hex)s)?::(?:%(hex)s:){4}%(ls32)s",
80 +
    # [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
81 +
    "(?:(?:%(hex)s:)?%(hex)s)?::(?:%(hex)s:){3}%(ls32)s",
82 +
    # [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
83 +
    "(?:(?:%(hex)s:){0,2}%(hex)s)?::(?:%(hex)s:){2}%(ls32)s",
84 +
    # [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
85 +
    "(?:(?:%(hex)s:){0,3}%(hex)s)?::%(hex)s:%(ls32)s",
86 +
    # [ *4( h16 ":" ) h16 ] "::"              ls32
87 +
    "(?:(?:%(hex)s:){0,4}%(hex)s)?::%(ls32)s",
88 +
    # [ *5( h16 ":" ) h16 ] "::"              h16
89 +
    "(?:(?:%(hex)s:){0,5}%(hex)s)?::%(hex)s",
90 +
    # [ *6( h16 ":" ) h16 ] "::"
91 +
    "(?:(?:%(hex)s:){0,6}%(hex)s)?::",
92 +
]
93 +
94 +
UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._!\-~"
95 +
IPV6_PAT = "(?:" + "|".join([x % _subs for x in _variations]) + ")"
96 +
ZONE_ID_PAT = "(?:%25|%)(?:[" + UNRESERVED_PAT + "]|%[a-fA-F0-9]{2})+"
97 +
IPV6_ADDRZ_PAT = r"\[" + IPV6_PAT + r"(?:" + ZONE_ID_PAT + r")?\]"
98 +
IPV6_ADDRZ_RE = re.compile("^" + IPV6_ADDRZ_PAT + "$")
68 99
69 100
def ensure_boolean(val):
70 101
    """Ensures a boolean value if a string or boolean is provided
@@ -241,7 +272,7 @@
Loading
241 272
        else:
242 273
            chosen_base_url = METADATA_BASE_URL
243 274
244 -
        logger.info("IMDS ENDPOINT: %s" % chosen_base_url)
275 +
        logger.debug("IMDS ENDPOINT: %s" % chosen_base_url)
245 276
        if not is_valid_uri(chosen_base_url):
246 277
            raise InvalidIMDSEndpointError(endpoint=chosen_base_url)
247 278
Files Coverage
botocore 97.61%
Project Totals (56 files) 97.61%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading