From db68e49e804bceae69d025789c54f6def3e0d864 Mon Sep 17 00:00:00 2001 From: khs28gu Date: Tue, 19 Mar 2019 15:34:18 +0000 Subject: [PATCH] Releasing version 2.2.3 --- CHANGELOG.rst | 13 + docs/api/database.rst | 2 + ...se.models.CreateAutonomousDatabaseBase.rst | 11 + ...s.CreateAutonomousDatabaseCloneDetails.rst | 11 + requirements.txt | 4 +- src/oci/_vendor/idna/core.py | 45 +- src/oci/_vendor/idna/idnadata.py | 498 +++++- src/oci/_vendor/idna/package_data.py | 2 +- src/oci/_vendor/idna/uts46data.py | 1343 ++++++++++++----- src/oci/_vendor/jwt/__init__.py | 8 +- src/oci/_vendor/jwt/__main__.py | 14 +- src/oci/_vendor/jwt/api_jws.py | 34 +- src/oci/_vendor/jwt/api_jwt.py | 47 +- src/oci/_vendor/jwt/compat.py | 18 +- .../jwt/contrib/algorithms/py_ecdsa.py | 4 +- .../jwt/contrib/algorithms/pycrypto.py | 5 +- src/oci/_vendor/jwt/exceptions.py | 15 +- src/oci/_vendor/jwt/help.py | 65 + src/oci/_vendor/requests/__init__.py | 30 +- src/oci/_vendor/requests/__version__.py | 6 +- src/oci/_vendor/requests/adapters.py | 42 +- src/oci/_vendor/requests/api.py | 22 +- src/oci/_vendor/requests/auth.py | 16 +- src/oci/_vendor/requests/compat.py | 3 +- src/oci/_vendor/requests/cookies.py | 41 +- src/oci/_vendor/requests/exceptions.py | 4 + src/oci/_vendor/requests/help.py | 5 +- src/oci/_vendor/requests/hooks.py | 4 +- src/oci/_vendor/requests/models.py | 39 +- src/oci/_vendor/requests/sessions.py | 81 +- src/oci/_vendor/requests/status_codes.py | 39 +- src/oci/_vendor/requests/structures.py | 10 +- src/oci/_vendor/requests/utils.py | 135 +- src/oci/_vendor/six.py | 65 +- src/oci/_vendor/urllib3/__init__.py | 9 +- src/oci/_vendor/urllib3/_collections.py | 28 +- src/oci/_vendor/urllib3/connection.py | 80 +- src/oci/_vendor/urllib3/connectionpool.py | 45 +- .../urllib3/contrib/_appengine_environ.py | 34 + .../contrib/_securetransport/low_level.py | 7 +- src/oci/_vendor/urllib3/contrib/appengine.py | 45 +- src/oci/_vendor/urllib3/contrib/ntlmpool.py | 3 +- src/oci/_vendor/urllib3/contrib/pyopenssl.py | 47 +- .../urllib3/contrib/securetransport.py | 32 +- src/oci/_vendor/urllib3/contrib/socks.py | 5 + src/oci/_vendor/urllib3/exceptions.py | 2 +- src/oci/_vendor/urllib3/fields.py | 2 +- src/oci/_vendor/urllib3/filepost.py | 10 +- .../urllib3/packages/backports/makefile.py | 2 +- .../_vendor/urllib3/packages/ordered_dict.py | 259 ---- .../ssl_match_hostname/_implementation.py | 3 +- src/oci/_vendor/urllib3/poolmanager.py | 14 +- src/oci/_vendor/urllib3/request.py | 10 +- src/oci/_vendor/urllib3/response.py | 139 +- src/oci/_vendor/urllib3/util/connection.py | 22 +- src/oci/_vendor/urllib3/util/queue.py | 25 + src/oci/_vendor/urllib3/util/response.py | 10 +- src/oci/_vendor/urllib3/util/retry.py | 14 +- src/oci/_vendor/urllib3/util/selectors.py | 585 ------- src/oci/_vendor/urllib3/util/ssl_.py | 108 +- src/oci/_vendor/urllib3/util/wait.py | 188 ++- .../container_engine_client.py | 38 +- src/oci/container_engine/models/cluster.py | 2 +- .../models/create_node_pool_details.py | 31 + src/oci/container_engine/models/node_pool.py | 33 +- src/oci/database/database_client.py | 2 +- .../database_client_composite_operations.py | 2 +- src/oci/database/models/__init__.py | 4 + .../database/models/autonomous_database.py | 31 + .../models/autonomous_database_summary.py | 31 + .../models/create_autonomous_database_base.py | 477 ++++++ ...reate_autonomous_database_clone_details.py | 203 +++ .../create_autonomous_database_details.py | 318 +--- .../resource_manager_client.py | 2 +- src/oci/version.py | 2 +- 75 files changed, 3499 insertions(+), 2086 deletions(-) create mode 100644 docs/api/database/models/oci.database.models.CreateAutonomousDatabaseBase.rst create mode 100644 docs/api/database/models/oci.database.models.CreateAutonomousDatabaseCloneDetails.rst create mode 100644 src/oci/_vendor/jwt/help.py create mode 100644 src/oci/_vendor/urllib3/contrib/_appengine_environ.py delete mode 100644 src/oci/_vendor/urllib3/packages/ordered_dict.py create mode 100644 src/oci/_vendor/urllib3/util/queue.py delete mode 100644 src/oci/_vendor/urllib3/util/selectors.py create mode 100644 src/oci/database/models/create_autonomous_database_base.py create mode 100644 src/oci/database/models/create_autonomous_database_clone_details.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b4b535e45a..995392e2a3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +==================== +2.2.3 - 2019-03-19 +==================== + +Added +----- +* Support for specifying metadata on node pools in the Container Engine for Kubernetes service +* Support for provisioning a new autonomous database or autonomous data warehouse as a clone of another in the Database service + +Changed +------- +* Updated vendored packages. idna==2.8, PyJWT==1.7.1, requests==2.21.0, six==1.12.0, urllib3==1.24.1, requests==2.21.0 + ==================== 2.2.2 - 2019-03-12 ==================== diff --git a/docs/api/database.rst b/docs/api/database.rst index 595e825758..b13cb19c56 100644 --- a/docs/api/database.rst +++ b/docs/api/database.rst @@ -34,6 +34,8 @@ Database oci.database.models.CreateAutonomousDataWarehouseBackupDetails oci.database.models.CreateAutonomousDataWarehouseDetails oci.database.models.CreateAutonomousDatabaseBackupDetails + oci.database.models.CreateAutonomousDatabaseBase + oci.database.models.CreateAutonomousDatabaseCloneDetails oci.database.models.CreateAutonomousDatabaseDetails oci.database.models.CreateBackupDetails oci.database.models.CreateDataGuardAssociationDetails diff --git a/docs/api/database/models/oci.database.models.CreateAutonomousDatabaseBase.rst b/docs/api/database/models/oci.database.models.CreateAutonomousDatabaseBase.rst new file mode 100644 index 0000000000..01aad1e5d3 --- /dev/null +++ b/docs/api/database/models/oci.database.models.CreateAutonomousDatabaseBase.rst @@ -0,0 +1,11 @@ +CreateAutonomousDatabaseBase +============================ + +.. currentmodule:: oci.database.models + +.. autoclass:: CreateAutonomousDatabaseBase + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/database/models/oci.database.models.CreateAutonomousDatabaseCloneDetails.rst b/docs/api/database/models/oci.database.models.CreateAutonomousDatabaseCloneDetails.rst new file mode 100644 index 0000000000..334719297d --- /dev/null +++ b/docs/api/database/models/oci.database.models.CreateAutonomousDatabaseCloneDetails.rst @@ -0,0 +1,11 @@ +CreateAutonomousDatabaseCloneDetails +==================================== + +.. currentmodule:: oci.database.models + +.. autoclass:: CreateAutonomousDatabaseCloneDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index bb472de92f..cc98e5aaed 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ certifi configparser==3.5.0 coverage==4.4.1 -cryptography==2.1.4 +cryptography==2.4.2 flake8==3.5.0 mock==2.0.0 -pyOpenSSL==17.5.0 +pyOpenSSL==18.0.0 pytest==3.2.3 pytest-catchlog==1.2.2 pytest-cov==2.5.1 diff --git a/src/oci/_vendor/idna/core.py b/src/oci/_vendor/idna/core.py index 99b876b92b..0c28b617a0 100644 --- a/src/oci/_vendor/idna/core.py +++ b/src/oci/_vendor/idna/core.py @@ -38,7 +38,11 @@ class InvalidCodepointContext(IDNAError): def _combining_class(cp): - return unicodedata.combining(unichr(cp)) + v = unicodedata.combining(unichr(cp)) + if v == 0: + if not unicodedata.name(unichr(cp)): + raise ValueError("Unknown character in unicodedata") + return v def _is_script(cp, script): return intranges_contain(ord(cp), idnadata.scripts[script]) @@ -75,7 +79,6 @@ def check_bidi(label, check_ltr=False): raise IDNABidiError('Unknown directionality in label {0} at position {1}'.format(repr(label), idx)) if direction in ['R', 'AL', 'AN']: bidi_label = True - break if not bidi_label and not check_ltr: return True @@ -248,8 +251,13 @@ def check_label(label): if intranges_contain(cp_value, idnadata.codepoint_classes['PVALID']): continue elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTJ']): - if not valid_contextj(label, pos): - raise InvalidCodepointContext('Joiner {0} not allowed at position {1} in {2}'.format(_unot(cp_value), pos+1, repr(label))) + try: + if not valid_contextj(label, pos): + raise InvalidCodepointContext('Joiner {0} not allowed at position {1} in {2}'.format( + _unot(cp_value), pos+1, repr(label))) + except ValueError: + raise IDNAError('Unknown codepoint adjacent to joiner {0} at position {1} in {2}'.format( + _unot(cp_value), pos+1, repr(label))) elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTO']): if not valid_contexto(label, pos): raise InvalidCodepointContext('Codepoint {0} not allowed at position {1} in {2}'.format(_unot(cp_value), pos+1, repr(label))) @@ -263,10 +271,7 @@ def alabel(label): try: label = label.encode('ascii') - try: - ulabel(label) - except IDNAError: - raise IDNAError('The label {0} is not a valid A-label'.format(label)) + ulabel(label) if not valid_label_length(label): raise IDNAError('Label too long') return label @@ -321,10 +326,10 @@ def uts46_remap(domain, std3_rules=True, transitional=False): replacement = uts46row[2] if len(uts46row) == 3 else None if (status == "V" or (status == "D" and not transitional) or - (status == "3" and std3_rules and replacement is None)): + (status == "3" and not std3_rules and replacement is None)): output += char elif replacement is not None and (status == "M" or - (status == "3" and std3_rules) or + (status == "3" and not std3_rules) or (status == "D" and transitional)): output += replacement elif status != "I": @@ -348,15 +353,17 @@ def encode(s, strict=False, uts46=False, std3_rules=False, transitional=False): labels = s.split('.') else: labels = _unicode_dots_re.split(s) - while labels and not labels[0]: - del labels[0] - if not labels: + if not labels or labels == ['']: raise IDNAError('Empty domain') if labels[-1] == '': del labels[-1] trailing_dot = True for label in labels: - result.append(alabel(label)) + s = alabel(label) + if s: + result.append(s) + else: + raise IDNAError('Empty label') if trailing_dot: result.append(b'') s = b'.'.join(result) @@ -377,15 +384,17 @@ def decode(s, strict=False, uts46=False, std3_rules=False): labels = _unicode_dots_re.split(s) else: labels = s.split(u'.') - while labels and not labels[0]: - del labels[0] - if not labels: + if not labels or labels == ['']: raise IDNAError('Empty domain') if not labels[-1]: del labels[-1] trailing_dot = True for label in labels: - result.append(ulabel(label)) + s = ulabel(label) + if s: + result.append(s) + else: + raise IDNAError('Empty label') if trailing_dot: result.append(u'') return u'.'.join(result) diff --git a/src/oci/_vendor/idna/idnadata.py b/src/oci/_vendor/idna/idnadata.py index c2f7e2d76c..8b753f9db4 100644 --- a/src/oci/_vendor/idna/idnadata.py +++ b/src/oci/_vendor/idna/idnadata.py @@ -4,12 +4,13 @@ # This file is automatically generated by tools/idna-data -__version__ = "6.3.0" +__version__ = "11.0.0" scripts = { 'Greek': ( 0x37000000374, 0x37500000378, 0x37a0000037e, + 0x37f00000380, 0x38400000385, 0x38600000387, 0x3880000038b, @@ -38,7 +39,9 @@ 0x1ff200001ff5, 0x1ff600001fff, 0x212600002127, - 0x101400001018b, + 0xab650000ab66, + 0x101400001018f, + 0x101a0000101a1, 0x1d2000001d246, ), 'Han': ( @@ -50,18 +53,20 @@ 0x30210000302a, 0x30380000303c, 0x340000004db6, - 0x4e0000009fcd, + 0x4e0000009ff0, 0xf9000000fa6e, 0xfa700000fada, 0x200000002a6d7, 0x2a7000002b735, 0x2b7400002b81e, + 0x2b8200002cea2, + 0x2ceb00002ebe1, 0x2f8000002fa1e, ), 'Hebrew': ( 0x591000005c8, 0x5d0000005eb, - 0x5f0000005f5, + 0x5ef000005f5, 0xfb1d0000fb37, 0xfb380000fb3d, 0xfb3e0000fb3f, @@ -72,7 +77,7 @@ 'Hiragana': ( 0x304100003097, 0x309d000030a0, - 0x1b0010001b002, + 0x1b0010001b11f, 0x1f2000001f201, ), 'Katakana': ( @@ -92,6 +97,7 @@ 0x602: 85, 0x603: 85, 0x604: 85, + 0x605: 85, 0x608: 85, 0x60b: 85, 0x620: 68, @@ -246,6 +252,7 @@ 0x6fb: 68, 0x6fc: 68, 0x6ff: 68, + 0x70f: 84, 0x710: 82, 0x712: 68, 0x713: 68, @@ -369,7 +376,7 @@ 0x844: 68, 0x845: 68, 0x846: 82, - 0x847: 68, + 0x847: 82, 0x848: 68, 0x849: 82, 0x84a: 68, @@ -377,7 +384,7 @@ 0x84c: 68, 0x84d: 68, 0x84e: 68, - 0x84f: 82, + 0x84f: 68, 0x850: 68, 0x851: 68, 0x852: 68, @@ -387,7 +394,19 @@ 0x856: 85, 0x857: 85, 0x858: 85, + 0x860: 68, + 0x861: 85, + 0x862: 68, + 0x863: 68, + 0x864: 68, + 0x865: 68, + 0x866: 85, + 0x867: 82, + 0x868: 68, + 0x869: 82, + 0x86a: 82, 0x8a0: 68, + 0x8a1: 68, 0x8a2: 68, 0x8a3: 68, 0x8a4: 68, @@ -399,6 +418,23 @@ 0x8aa: 82, 0x8ab: 82, 0x8ac: 82, + 0x8ad: 85, + 0x8ae: 82, + 0x8af: 68, + 0x8b0: 68, + 0x8b1: 82, + 0x8b2: 82, + 0x8b3: 68, + 0x8b4: 68, + 0x8b6: 68, + 0x8b7: 68, + 0x8b8: 68, + 0x8b9: 82, + 0x8ba: 68, + 0x8bb: 68, + 0x8bc: 68, + 0x8bd: 68, + 0x8e2: 85, 0x1806: 85, 0x1807: 68, 0x180a: 67, @@ -491,13 +527,14 @@ 0x1875: 68, 0x1876: 68, 0x1877: 68, + 0x1878: 68, 0x1880: 85, 0x1881: 85, 0x1882: 85, 0x1883: 85, 0x1884: 85, - 0x1885: 85, - 0x1886: 85, + 0x1885: 84, + 0x1886: 84, 0x1887: 68, 0x1888: 68, 0x1889: 68, @@ -535,6 +572,7 @@ 0x18aa: 68, 0x200c: 85, 0x200d: 67, + 0x202f: 85, 0x2066: 85, 0x2067: 85, 0x2068: 85, @@ -591,6 +629,205 @@ 0xa871: 68, 0xa872: 76, 0xa873: 85, + 0x10ac0: 68, + 0x10ac1: 68, + 0x10ac2: 68, + 0x10ac3: 68, + 0x10ac4: 68, + 0x10ac5: 82, + 0x10ac6: 85, + 0x10ac7: 82, + 0x10ac8: 85, + 0x10ac9: 82, + 0x10aca: 82, + 0x10acb: 85, + 0x10acc: 85, + 0x10acd: 76, + 0x10ace: 82, + 0x10acf: 82, + 0x10ad0: 82, + 0x10ad1: 82, + 0x10ad2: 82, + 0x10ad3: 68, + 0x10ad4: 68, + 0x10ad5: 68, + 0x10ad6: 68, + 0x10ad7: 76, + 0x10ad8: 68, + 0x10ad9: 68, + 0x10ada: 68, + 0x10adb: 68, + 0x10adc: 68, + 0x10add: 82, + 0x10ade: 68, + 0x10adf: 68, + 0x10ae0: 68, + 0x10ae1: 82, + 0x10ae2: 85, + 0x10ae3: 85, + 0x10ae4: 82, + 0x10aeb: 68, + 0x10aec: 68, + 0x10aed: 68, + 0x10aee: 68, + 0x10aef: 82, + 0x10b80: 68, + 0x10b81: 82, + 0x10b82: 68, + 0x10b83: 82, + 0x10b84: 82, + 0x10b85: 82, + 0x10b86: 68, + 0x10b87: 68, + 0x10b88: 68, + 0x10b89: 82, + 0x10b8a: 68, + 0x10b8b: 68, + 0x10b8c: 82, + 0x10b8d: 68, + 0x10b8e: 82, + 0x10b8f: 82, + 0x10b90: 68, + 0x10b91: 82, + 0x10ba9: 82, + 0x10baa: 82, + 0x10bab: 82, + 0x10bac: 82, + 0x10bad: 68, + 0x10bae: 68, + 0x10baf: 85, + 0x10d00: 76, + 0x10d01: 68, + 0x10d02: 68, + 0x10d03: 68, + 0x10d04: 68, + 0x10d05: 68, + 0x10d06: 68, + 0x10d07: 68, + 0x10d08: 68, + 0x10d09: 68, + 0x10d0a: 68, + 0x10d0b: 68, + 0x10d0c: 68, + 0x10d0d: 68, + 0x10d0e: 68, + 0x10d0f: 68, + 0x10d10: 68, + 0x10d11: 68, + 0x10d12: 68, + 0x10d13: 68, + 0x10d14: 68, + 0x10d15: 68, + 0x10d16: 68, + 0x10d17: 68, + 0x10d18: 68, + 0x10d19: 68, + 0x10d1a: 68, + 0x10d1b: 68, + 0x10d1c: 68, + 0x10d1d: 68, + 0x10d1e: 68, + 0x10d1f: 68, + 0x10d20: 68, + 0x10d21: 68, + 0x10d22: 82, + 0x10d23: 68, + 0x10f30: 68, + 0x10f31: 68, + 0x10f32: 68, + 0x10f33: 82, + 0x10f34: 68, + 0x10f35: 68, + 0x10f36: 68, + 0x10f37: 68, + 0x10f38: 68, + 0x10f39: 68, + 0x10f3a: 68, + 0x10f3b: 68, + 0x10f3c: 68, + 0x10f3d: 68, + 0x10f3e: 68, + 0x10f3f: 68, + 0x10f40: 68, + 0x10f41: 68, + 0x10f42: 68, + 0x10f43: 68, + 0x10f44: 68, + 0x10f45: 85, + 0x10f51: 68, + 0x10f52: 68, + 0x10f53: 68, + 0x10f54: 82, + 0x110bd: 85, + 0x110cd: 85, + 0x1e900: 68, + 0x1e901: 68, + 0x1e902: 68, + 0x1e903: 68, + 0x1e904: 68, + 0x1e905: 68, + 0x1e906: 68, + 0x1e907: 68, + 0x1e908: 68, + 0x1e909: 68, + 0x1e90a: 68, + 0x1e90b: 68, + 0x1e90c: 68, + 0x1e90d: 68, + 0x1e90e: 68, + 0x1e90f: 68, + 0x1e910: 68, + 0x1e911: 68, + 0x1e912: 68, + 0x1e913: 68, + 0x1e914: 68, + 0x1e915: 68, + 0x1e916: 68, + 0x1e917: 68, + 0x1e918: 68, + 0x1e919: 68, + 0x1e91a: 68, + 0x1e91b: 68, + 0x1e91c: 68, + 0x1e91d: 68, + 0x1e91e: 68, + 0x1e91f: 68, + 0x1e920: 68, + 0x1e921: 68, + 0x1e922: 68, + 0x1e923: 68, + 0x1e924: 68, + 0x1e925: 68, + 0x1e926: 68, + 0x1e927: 68, + 0x1e928: 68, + 0x1e929: 68, + 0x1e92a: 68, + 0x1e92b: 68, + 0x1e92c: 68, + 0x1e92d: 68, + 0x1e92e: 68, + 0x1e92f: 68, + 0x1e930: 68, + 0x1e931: 68, + 0x1e932: 68, + 0x1e933: 68, + 0x1e934: 68, + 0x1e935: 68, + 0x1e936: 68, + 0x1e937: 68, + 0x1e938: 68, + 0x1e939: 68, + 0x1e93a: 68, + 0x1e93b: 68, + 0x1e93c: 68, + 0x1e93d: 68, + 0x1e93e: 68, + 0x1e93f: 68, + 0x1e940: 68, + 0x1e941: 68, + 0x1e942: 68, + 0x1e943: 68, } codepoint_classes = { 'PVALID': ( @@ -862,15 +1099,20 @@ 0x52300000524, 0x52500000526, 0x52700000528, + 0x5290000052a, + 0x52b0000052c, + 0x52d0000052e, + 0x52f00000530, 0x5590000055a, - 0x56100000587, + 0x56000000587, + 0x58800000589, 0x591000005be, 0x5bf000005c0, 0x5c1000005c3, 0x5c4000005c6, 0x5c7000005c8, 0x5d0000005eb, - 0x5f0000005f3, + 0x5ef000005f3, 0x6100000061b, 0x62000000640, 0x64100000660, @@ -883,17 +1125,17 @@ 0x7100000074b, 0x74d000007b2, 0x7c0000007f6, + 0x7fd000007fe, 0x8000000082e, 0x8400000085c, - 0x8a0000008a1, - 0x8a2000008ad, - 0x8e4000008ff, - 0x90000000958, + 0x8600000086b, + 0x8a0000008b5, + 0x8b6000008be, + 0x8d3000008e2, + 0x8e300000958, 0x96000000964, 0x96600000970, - 0x97100000978, - 0x97900000980, - 0x98100000984, + 0x97100000984, 0x9850000098d, 0x98f00000991, 0x993000009a9, @@ -906,6 +1148,8 @@ 0x9d7000009d8, 0x9e0000009e4, 0x9e6000009f2, + 0x9fc000009fd, + 0x9fe000009ff, 0xa0100000a04, 0xa0500000a0b, 0xa0f00000a11, @@ -934,6 +1178,7 @@ 0xad000000ad1, 0xae000000ae4, 0xae600000af0, + 0xaf900000b00, 0xb0100000b04, 0xb0500000b0d, 0xb0f00000b11, @@ -964,20 +1209,18 @@ 0xbd000000bd1, 0xbd700000bd8, 0xbe600000bf0, - 0xc0100000c04, - 0xc0500000c0d, + 0xc0000000c0d, 0xc0e00000c11, 0xc1200000c29, - 0xc2a00000c34, - 0xc3500000c3a, + 0xc2a00000c3a, 0xc3d00000c45, 0xc4600000c49, 0xc4a00000c4e, 0xc5500000c57, - 0xc5800000c5a, + 0xc5800000c5b, 0xc6000000c64, 0xc6600000c70, - 0xc8200000c84, + 0xc8000000c84, 0xc8500000c8d, 0xc8e00000c91, 0xc9200000ca9, @@ -991,15 +1234,14 @@ 0xce000000ce4, 0xce600000cf0, 0xcf100000cf3, - 0xd0200000d04, + 0xd0000000d04, 0xd0500000d0d, 0xd0e00000d11, - 0xd1200000d3b, - 0xd3d00000d45, + 0xd1200000d45, 0xd4600000d49, 0xd4a00000d4f, - 0xd5700000d58, - 0xd6000000d64, + 0xd5400000d58, + 0xd5f00000d64, 0xd6600000d70, 0xd7a00000d80, 0xd8200000d84, @@ -1012,6 +1254,7 @@ 0xdcf00000dd5, 0xdd600000dd7, 0xdd800000de0, + 0xde600000df0, 0xdf200000df4, 0xe0100000e33, 0xe3400000e3b, @@ -1086,11 +1329,12 @@ 0x13180000135b, 0x135d00001360, 0x138000001390, - 0x13a0000013f5, + 0x13a0000013f6, 0x14010000166d, 0x166f00001680, 0x16810000169b, 0x16a0000016eb, + 0x16f1000016f9, 0x17000000170d, 0x170e00001715, 0x172000001735, @@ -1104,10 +1348,10 @@ 0x17dc000017de, 0x17e0000017ea, 0x18100000181a, - 0x182000001878, + 0x182000001879, 0x1880000018ab, 0x18b0000018f6, - 0x19000000191d, + 0x19000000191f, 0x19200000192c, 0x19300000193c, 0x19460000196e, @@ -1121,6 +1365,7 @@ 0x1a7f00001a8a, 0x1a9000001a9a, 0x1aa700001aa8, + 0x1ab000001abe, 0x1b0000001b4c, 0x1b5000001b5a, 0x1b6b00001b74, @@ -1129,15 +1374,15 @@ 0x1c4000001c4a, 0x1c4d00001c7e, 0x1cd000001cd3, - 0x1cd400001cf7, + 0x1cd400001cfa, 0x1d0000001d2c, 0x1d2f00001d30, 0x1d3b00001d3c, 0x1d4e00001d4f, 0x1d6b00001d78, 0x1d7900001d9b, - 0x1dc000001de7, - 0x1dfc00001e00, + 0x1dc000001dfa, + 0x1dfb00001e00, 0x1e0100001e02, 0x1e0300001e04, 0x1e0500001e06, @@ -1371,11 +1616,11 @@ 0x309d0000309f, 0x30a1000030fb, 0x30fc000030ff, - 0x31050000312e, + 0x310500003130, 0x31a0000031bb, 0x31f000003200, 0x340000004db6, - 0x4e0000009fcd, + 0x4e0000009ff0, 0xa0000000a48d, 0xa4d00000a4fe, 0xa5000000a60d, @@ -1417,7 +1662,9 @@ 0xa6930000a694, 0xa6950000a696, 0xa6970000a698, - 0xa69f0000a6e6, + 0xa6990000a69a, + 0xa69b0000a69c, + 0xa69e0000a6e6, 0xa6f00000a6f2, 0xa7170000a720, 0xa7230000a724, @@ -1467,30 +1714,40 @@ 0xa7850000a786, 0xa7870000a789, 0xa78c0000a78d, - 0xa78e0000a78f, + 0xa78e0000a790, 0xa7910000a792, - 0xa7930000a794, + 0xa7930000a796, + 0xa7970000a798, + 0xa7990000a79a, + 0xa79b0000a79c, + 0xa79d0000a79e, + 0xa79f0000a7a0, 0xa7a10000a7a2, 0xa7a30000a7a4, 0xa7a50000a7a6, 0xa7a70000a7a8, 0xa7a90000a7aa, + 0xa7af0000a7b0, + 0xa7b50000a7b6, + 0xa7b70000a7b8, + 0xa7b90000a7ba, + 0xa7f70000a7f8, 0xa7fa0000a828, 0xa8400000a874, - 0xa8800000a8c5, + 0xa8800000a8c6, 0xa8d00000a8da, 0xa8e00000a8f8, 0xa8fb0000a8fc, - 0xa9000000a92e, + 0xa8fd0000a92e, 0xa9300000a954, 0xa9800000a9c1, 0xa9cf0000a9da, + 0xa9e00000a9ff, 0xaa000000aa37, 0xaa400000aa4e, 0xaa500000aa5a, 0xaa600000aa77, - 0xaa7a0000aa7c, - 0xaa800000aac3, + 0xaa7a0000aac3, 0xaadb0000aade, 0xaae00000aaf0, 0xaaf20000aaf7, @@ -1499,6 +1756,8 @@ 0xab110000ab17, 0xab200000ab27, 0xab280000ab2f, + 0xab300000ab5b, + 0xab600000ab66, 0xabc00000abeb, 0xabec0000abee, 0xabf00000abfa, @@ -1511,7 +1770,7 @@ 0xfa230000fa25, 0xfa270000fa2a, 0xfb1e0000fb1f, - 0xfe200000fe27, + 0xfe200000fe30, 0xfe730000fe74, 0x100000001000c, 0x1000d00010027, @@ -1523,20 +1782,32 @@ 0x101fd000101fe, 0x102800001029d, 0x102a0000102d1, - 0x103000001031f, - 0x1033000010341, + 0x102e0000102e1, + 0x1030000010320, + 0x1032d00010341, 0x103420001034a, + 0x103500001037b, 0x103800001039e, 0x103a0000103c4, 0x103c8000103d0, 0x104280001049e, 0x104a0000104aa, + 0x104d8000104fc, + 0x1050000010528, + 0x1053000010564, + 0x1060000010737, + 0x1074000010756, + 0x1076000010768, 0x1080000010806, 0x1080800010809, 0x1080a00010836, 0x1083700010839, 0x1083c0001083d, 0x1083f00010856, + 0x1086000010877, + 0x108800001089f, + 0x108e0000108f3, + 0x108f4000108f6, 0x1090000010916, 0x109200001093a, 0x10980000109b8, @@ -1545,35 +1816,158 @@ 0x10a0500010a07, 0x10a0c00010a14, 0x10a1500010a18, - 0x10a1900010a34, + 0x10a1900010a36, 0x10a3800010a3b, 0x10a3f00010a40, 0x10a6000010a7d, + 0x10a8000010a9d, + 0x10ac000010ac8, + 0x10ac900010ae7, 0x10b0000010b36, 0x10b4000010b56, 0x10b6000010b73, + 0x10b8000010b92, 0x10c0000010c49, + 0x10cc000010cf3, + 0x10d0000010d28, + 0x10d3000010d3a, + 0x10f0000010f1d, + 0x10f2700010f28, + 0x10f3000010f51, 0x1100000011047, 0x1106600011070, - 0x11080000110bb, + 0x1107f000110bb, 0x110d0000110e9, 0x110f0000110fa, 0x1110000011135, 0x1113600011140, + 0x1114400011147, + 0x1115000011174, + 0x1117600011177, 0x11180000111c5, - 0x111d0000111da, + 0x111c9000111cd, + 0x111d0000111db, + 0x111dc000111dd, + 0x1120000011212, + 0x1121300011238, + 0x1123e0001123f, + 0x1128000011287, + 0x1128800011289, + 0x1128a0001128e, + 0x1128f0001129e, + 0x1129f000112a9, + 0x112b0000112eb, + 0x112f0000112fa, + 0x1130000011304, + 0x113050001130d, + 0x1130f00011311, + 0x1131300011329, + 0x1132a00011331, + 0x1133200011334, + 0x113350001133a, + 0x1133b00011345, + 0x1134700011349, + 0x1134b0001134e, + 0x1135000011351, + 0x1135700011358, + 0x1135d00011364, + 0x113660001136d, + 0x1137000011375, + 0x114000001144b, + 0x114500001145a, + 0x1145e0001145f, + 0x11480000114c6, + 0x114c7000114c8, + 0x114d0000114da, + 0x11580000115b6, + 0x115b8000115c1, + 0x115d8000115de, + 0x1160000011641, + 0x1164400011645, + 0x116500001165a, 0x11680000116b8, 0x116c0000116ca, - 0x120000001236f, + 0x117000001171b, + 0x1171d0001172c, + 0x117300001173a, + 0x118000001183b, + 0x118c0000118ea, + 0x118ff00011900, + 0x11a0000011a3f, + 0x11a4700011a48, + 0x11a5000011a84, + 0x11a8600011a9a, + 0x11a9d00011a9e, + 0x11ac000011af9, + 0x11c0000011c09, + 0x11c0a00011c37, + 0x11c3800011c41, + 0x11c5000011c5a, + 0x11c7200011c90, + 0x11c9200011ca8, + 0x11ca900011cb7, + 0x11d0000011d07, + 0x11d0800011d0a, + 0x11d0b00011d37, + 0x11d3a00011d3b, + 0x11d3c00011d3e, + 0x11d3f00011d48, + 0x11d5000011d5a, + 0x11d6000011d66, + 0x11d6700011d69, + 0x11d6a00011d8f, + 0x11d9000011d92, + 0x11d9300011d99, + 0x11da000011daa, + 0x11ee000011ef7, + 0x120000001239a, + 0x1248000012544, 0x130000001342f, + 0x1440000014647, 0x1680000016a39, + 0x16a4000016a5f, + 0x16a6000016a6a, + 0x16ad000016aee, + 0x16af000016af5, + 0x16b0000016b37, + 0x16b4000016b44, + 0x16b5000016b5a, + 0x16b6300016b78, + 0x16b7d00016b90, + 0x16e6000016e80, 0x16f0000016f45, 0x16f5000016f7f, 0x16f8f00016fa0, - 0x1b0000001b002, + 0x16fe000016fe2, + 0x17000000187f2, + 0x1880000018af3, + 0x1b0000001b11f, + 0x1b1700001b2fc, + 0x1bc000001bc6b, + 0x1bc700001bc7d, + 0x1bc800001bc89, + 0x1bc900001bc9a, + 0x1bc9d0001bc9f, + 0x1da000001da37, + 0x1da3b0001da6d, + 0x1da750001da76, + 0x1da840001da85, + 0x1da9b0001daa0, + 0x1daa10001dab0, + 0x1e0000001e007, + 0x1e0080001e019, + 0x1e01b0001e022, + 0x1e0230001e025, + 0x1e0260001e02b, + 0x1e8000001e8c5, + 0x1e8d00001e8d7, + 0x1e9220001e94b, + 0x1e9500001e95a, 0x200000002a6d7, 0x2a7000002b735, 0x2b7400002b81e, + 0x2b8200002cea2, + 0x2ceb00002ebe1, ), 'CONTEXTJ': ( 0x200c0000200e, diff --git a/src/oci/_vendor/idna/package_data.py b/src/oci/_vendor/idna/package_data.py index 4e1cf76a00..29923dc580 100644 --- a/src/oci/_vendor/idna/package_data.py +++ b/src/oci/_vendor/idna/package_data.py @@ -2,5 +2,5 @@ # Modified Work: Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013-2018, Kim Davies. All rights reserved. -__version__ = '2.6' +__version__ = '2.8' diff --git a/src/oci/_vendor/idna/uts46data.py b/src/oci/_vendor/idna/uts46data.py index a69f6ebece..e974e0c10d 100644 --- a/src/oci/_vendor/idna/uts46data.py +++ b/src/oci/_vendor/idna/uts46data.py @@ -8,7 +8,7 @@ """IDNA Mapping Table from UTS46.""" -__version__ = "6.3.0" +__version__ = "11.0.0" def _seg_0(): return [ (0x0, '3'), @@ -639,7 +639,8 @@ def _seg_6(): (0x37A, '3', u' ι'), (0x37B, 'V'), (0x37E, '3', u';'), - (0x37F, 'X'), + (0x37F, 'M', u'ϳ'), + (0x380, 'X'), (0x384, '3', u' ́'), (0x385, '3', u' ̈́'), (0x386, 'M', u'ά'), @@ -734,11 +735,11 @@ def _seg_6(): (0x400, 'M', u'ѐ'), (0x401, 'M', u'ё'), (0x402, 'M', u'ђ'), - (0x403, 'M', u'ѓ'), ] def _seg_7(): return [ + (0x403, 'M', u'ѓ'), (0x404, 'M', u'є'), (0x405, 'M', u'ѕ'), (0x406, 'M', u'і'), @@ -838,11 +839,11 @@ def _seg_7(): (0x49B, 'V'), (0x49C, 'M', u'ҝ'), (0x49D, 'V'), - (0x49E, 'M', u'ҟ'), ] def _seg_8(): return [ + (0x49E, 'M', u'ҟ'), (0x49F, 'V'), (0x4A0, 'M', u'ҡ'), (0x4A1, 'V'), @@ -942,11 +943,11 @@ def _seg_8(): (0x500, 'M', u'ԁ'), (0x501, 'V'), (0x502, 'M', u'ԃ'), - (0x503, 'V'), ] def _seg_9(): return [ + (0x503, 'V'), (0x504, 'M', u'ԅ'), (0x505, 'V'), (0x506, 'M', u'ԇ'), @@ -983,7 +984,15 @@ def _seg_9(): (0x525, 'V'), (0x526, 'M', u'ԧ'), (0x527, 'V'), - (0x528, 'X'), + (0x528, 'M', u'ԩ'), + (0x529, 'V'), + (0x52A, 'M', u'ԫ'), + (0x52B, 'V'), + (0x52C, 'M', u'ԭ'), + (0x52D, 'V'), + (0x52E, 'M', u'ԯ'), + (0x52F, 'V'), + (0x530, 'X'), (0x531, 'M', u'ա'), (0x532, 'M', u'բ'), (0x533, 'M', u'գ'), @@ -1024,33 +1033,30 @@ def _seg_9(): (0x556, 'M', u'ֆ'), (0x557, 'X'), (0x559, 'V'), - (0x560, 'X'), - (0x561, 'V'), (0x587, 'M', u'եւ'), - (0x588, 'X'), - (0x589, 'V'), + (0x588, 'V'), (0x58B, 'X'), - (0x58F, 'V'), + (0x58D, 'V'), (0x590, 'X'), (0x591, 'V'), (0x5C8, 'X'), (0x5D0, 'V'), (0x5EB, 'X'), - (0x5F0, 'V'), + (0x5EF, 'V'), (0x5F5, 'X'), (0x606, 'V'), (0x61C, 'X'), (0x61E, 'V'), + ] + +def _seg_10(): + return [ (0x675, 'M', u'اٴ'), (0x676, 'M', u'وٴ'), (0x677, 'M', u'ۇٴ'), (0x678, 'M', u'يٴ'), (0x679, 'V'), (0x6DD, 'X'), - ] - -def _seg_10(): - return [ (0x6DE, 'V'), (0x70E, 'X'), (0x710, 'V'), @@ -1059,7 +1065,7 @@ def _seg_10(): (0x7B2, 'X'), (0x7C0, 'V'), (0x7FB, 'X'), - (0x800, 'V'), + (0x7FD, 'V'), (0x82E, 'X'), (0x830, 'V'), (0x83F, 'X'), @@ -1067,13 +1073,15 @@ def _seg_10(): (0x85C, 'X'), (0x85E, 'V'), (0x85F, 'X'), + (0x860, 'V'), + (0x86B, 'X'), (0x8A0, 'V'), - (0x8A1, 'X'), - (0x8A2, 'V'), - (0x8AD, 'X'), - (0x8E4, 'V'), - (0x8FF, 'X'), - (0x900, 'V'), + (0x8B5, 'X'), + (0x8B6, 'V'), + (0x8BE, 'X'), + (0x8D3, 'V'), + (0x8E2, 'X'), + (0x8E3, 'V'), (0x958, 'M', u'क़'), (0x959, 'M', u'ख़'), (0x95A, 'M', u'ग़'), @@ -1083,10 +1091,6 @@ def _seg_10(): (0x95E, 'M', u'फ़'), (0x95F, 'M', u'य़'), (0x960, 'V'), - (0x978, 'X'), - (0x979, 'V'), - (0x980, 'X'), - (0x981, 'V'), (0x984, 'X'), (0x985, 'V'), (0x98D, 'X'), @@ -1115,7 +1119,7 @@ def _seg_10(): (0x9E0, 'V'), (0x9E4, 'X'), (0x9E6, 'V'), - (0x9FC, 'X'), + (0x9FF, 'X'), (0xA01, 'V'), (0xA04, 'X'), (0xA05, 'V'), @@ -1147,16 +1151,16 @@ def _seg_10(): (0xA59, 'M', u'ਖ਼'), (0xA5A, 'M', u'ਗ਼'), (0xA5B, 'M', u'ਜ਼'), - (0xA5C, 'V'), - (0xA5D, 'X'), - (0xA5E, 'M', u'ਫ਼'), - (0xA5F, 'X'), ] def _seg_11(): return [ + (0xA5C, 'V'), + (0xA5D, 'X'), + (0xA5E, 'M', u'ਫ਼'), + (0xA5F, 'X'), (0xA66, 'V'), - (0xA76, 'X'), + (0xA77, 'X'), (0xA81, 'V'), (0xA84, 'X'), (0xA85, 'V'), @@ -1183,6 +1187,8 @@ def _seg_11(): (0xAE4, 'X'), (0xAE6, 'V'), (0xAF2, 'X'), + (0xAF9, 'V'), + (0xB00, 'X'), (0xB01, 'V'), (0xB04, 'X'), (0xB05, 'V'), @@ -1244,21 +1250,17 @@ def _seg_11(): (0xBD8, 'X'), (0xBE6, 'V'), (0xBFB, 'X'), - (0xC01, 'V'), - (0xC04, 'X'), - (0xC05, 'V'), + (0xC00, 'V'), (0xC0D, 'X'), (0xC0E, 'V'), (0xC11, 'X'), (0xC12, 'V'), - (0xC29, 'X'), - (0xC2A, 'V'), - (0xC34, 'X'), - (0xC35, 'V'), ] def _seg_12(): return [ + (0xC29, 'X'), + (0xC2A, 'V'), (0xC3A, 'X'), (0xC3D, 'V'), (0xC45, 'X'), @@ -1269,16 +1271,12 @@ def _seg_12(): (0xC55, 'V'), (0xC57, 'X'), (0xC58, 'V'), - (0xC5A, 'X'), + (0xC5B, 'X'), (0xC60, 'V'), (0xC64, 'X'), (0xC66, 'V'), (0xC70, 'X'), (0xC78, 'V'), - (0xC80, 'X'), - (0xC82, 'V'), - (0xC84, 'X'), - (0xC85, 'V'), (0xC8D, 'X'), (0xC8E, 'V'), (0xC91, 'X'), @@ -1304,27 +1302,21 @@ def _seg_12(): (0xCF0, 'X'), (0xCF1, 'V'), (0xCF3, 'X'), - (0xD02, 'V'), + (0xD00, 'V'), (0xD04, 'X'), (0xD05, 'V'), (0xD0D, 'X'), (0xD0E, 'V'), (0xD11, 'X'), (0xD12, 'V'), - (0xD3B, 'X'), - (0xD3D, 'V'), (0xD45, 'X'), (0xD46, 'V'), (0xD49, 'X'), (0xD4A, 'V'), - (0xD4F, 'X'), - (0xD57, 'V'), - (0xD58, 'X'), - (0xD60, 'V'), + (0xD50, 'X'), + (0xD54, 'V'), (0xD64, 'X'), (0xD66, 'V'), - (0xD76, 'X'), - (0xD79, 'V'), (0xD80, 'X'), (0xD82, 'V'), (0xD84, 'X'), @@ -1346,6 +1338,8 @@ def _seg_12(): (0xDD7, 'X'), (0xDD8, 'V'), (0xDE0, 'X'), + (0xDE6, 'V'), + (0xDF0, 'X'), (0xDF2, 'V'), (0xDF5, 'X'), (0xE01, 'V'), @@ -1359,16 +1353,16 @@ def _seg_12(): (0xE84, 'V'), (0xE85, 'X'), (0xE87, 'V'), - ] - -def _seg_13(): - return [ (0xE89, 'X'), (0xE8A, 'V'), (0xE8B, 'X'), (0xE8D, 'V'), (0xE8E, 'X'), (0xE94, 'V'), + ] + +def _seg_13(): + return [ (0xE98, 'X'), (0xE99, 'V'), (0xEA0, 'X'), @@ -1463,16 +1457,16 @@ def _seg_13(): (0x1250, 'V'), (0x1257, 'X'), (0x1258, 'V'), - ] - -def _seg_14(): - return [ (0x1259, 'X'), (0x125A, 'V'), (0x125E, 'X'), (0x1260, 'V'), (0x1289, 'X'), (0x128A, 'V'), + ] + +def _seg_14(): + return [ (0x128E, 'X'), (0x1290, 'V'), (0x12B1, 'X'), @@ -1497,13 +1491,20 @@ def _seg_14(): (0x1380, 'V'), (0x139A, 'X'), (0x13A0, 'V'), - (0x13F5, 'X'), + (0x13F6, 'X'), + (0x13F8, 'M', u'Ᏸ'), + (0x13F9, 'M', u'Ᏹ'), + (0x13FA, 'M', u'Ᏺ'), + (0x13FB, 'M', u'Ᏻ'), + (0x13FC, 'M', u'Ᏼ'), + (0x13FD, 'M', u'Ᏽ'), + (0x13FE, 'X'), (0x1400, 'V'), (0x1680, 'X'), (0x1681, 'V'), (0x169D, 'X'), (0x16A0, 'V'), - (0x16F1, 'X'), + (0x16F9, 'X'), (0x1700, 'V'), (0x170D, 'X'), (0x170E, 'V'), @@ -1534,13 +1535,13 @@ def _seg_14(): (0x1810, 'V'), (0x181A, 'X'), (0x1820, 'V'), - (0x1878, 'X'), + (0x1879, 'X'), (0x1880, 'V'), (0x18AB, 'X'), (0x18B0, 'V'), (0x18F6, 'X'), (0x1900, 'V'), - (0x191D, 'X'), + (0x191F, 'X'), (0x1920, 'V'), (0x192C, 'X'), (0x1930, 'V'), @@ -1566,13 +1567,15 @@ def _seg_14(): (0x1A7F, 'V'), (0x1A8A, 'X'), (0x1A90, 'V'), - (0x1A9A, 'X'), ] def _seg_15(): return [ + (0x1A9A, 'X'), (0x1AA0, 'V'), (0x1AAE, 'X'), + (0x1AB0, 'V'), + (0x1ABF, 'X'), (0x1B00, 'V'), (0x1B4C, 'X'), (0x1B50, 'V'), @@ -1584,11 +1587,19 @@ def _seg_15(): (0x1C3B, 'V'), (0x1C4A, 'X'), (0x1C4D, 'V'), - (0x1C80, 'X'), + (0x1C80, 'M', u'в'), + (0x1C81, 'M', u'д'), + (0x1C82, 'M', u'о'), + (0x1C83, 'M', u'с'), + (0x1C84, 'M', u'т'), + (0x1C86, 'M', u'ъ'), + (0x1C87, 'M', u'ѣ'), + (0x1C88, 'M', u'ꙋ'), + (0x1C89, 'X'), (0x1CC0, 'V'), (0x1CC8, 'X'), (0x1CD0, 'V'), - (0x1CF7, 'X'), + (0x1CFA, 'X'), (0x1D00, 'V'), (0x1D2C, 'M', u'a'), (0x1D2D, 'M', u'æ'), @@ -1660,6 +1671,10 @@ def _seg_15(): (0x1D9C, 'M', u'c'), (0x1D9D, 'M', u'ɕ'), (0x1D9E, 'M', u'ð'), + ] + +def _seg_16(): + return [ (0x1D9F, 'M', u'ɜ'), (0x1DA0, 'M', u'f'), (0x1DA1, 'M', u'ɟ'), @@ -1671,10 +1686,6 @@ def _seg_15(): (0x1DA7, 'M', u'ᵻ'), (0x1DA8, 'M', u'ʝ'), (0x1DA9, 'M', u'ɭ'), - ] - -def _seg_16(): - return [ (0x1DAA, 'M', u'ᶅ'), (0x1DAB, 'M', u'ʟ'), (0x1DAC, 'M', u'ɱ'), @@ -1698,8 +1709,8 @@ def _seg_16(): (0x1DBE, 'M', u'ʒ'), (0x1DBF, 'M', u'θ'), (0x1DC0, 'V'), - (0x1DE7, 'X'), - (0x1DFC, 'V'), + (0x1DFA, 'X'), + (0x1DFB, 'V'), (0x1E00, 'M', u'ḁ'), (0x1E01, 'V'), (0x1E02, 'M', u'ḃ'), @@ -1764,6 +1775,10 @@ def _seg_16(): (0x1E3D, 'V'), (0x1E3E, 'M', u'ḿ'), (0x1E3F, 'V'), + ] + +def _seg_17(): + return [ (0x1E40, 'M', u'ṁ'), (0x1E41, 'V'), (0x1E42, 'M', u'ṃ'), @@ -1775,10 +1790,6 @@ def _seg_16(): (0x1E48, 'M', u'ṉ'), (0x1E49, 'V'), (0x1E4A, 'M', u'ṋ'), - ] - -def _seg_17(): - return [ (0x1E4B, 'V'), (0x1E4C, 'M', u'ṍ'), (0x1E4D, 'V'), @@ -1868,6 +1879,10 @@ def _seg_17(): (0x1EA6, 'M', u'ầ'), (0x1EA7, 'V'), (0x1EA8, 'M', u'ẩ'), + ] + +def _seg_18(): + return [ (0x1EA9, 'V'), (0x1EAA, 'M', u'ẫ'), (0x1EAB, 'V'), @@ -1879,10 +1894,6 @@ def _seg_17(): (0x1EB1, 'V'), (0x1EB2, 'M', u'ẳ'), (0x1EB3, 'V'), - ] - -def _seg_18(): - return [ (0x1EB4, 'M', u'ẵ'), (0x1EB5, 'V'), (0x1EB6, 'M', u'ặ'), @@ -1972,6 +1983,10 @@ def _seg_18(): (0x1F18, 'M', u'ἐ'), (0x1F19, 'M', u'ἑ'), (0x1F1A, 'M', u'ἒ'), + ] + +def _seg_19(): + return [ (0x1F1B, 'M', u'ἓ'), (0x1F1C, 'M', u'ἔ'), (0x1F1D, 'M', u'ἕ'), @@ -1983,10 +1998,6 @@ def _seg_18(): (0x1F2B, 'M', u'ἣ'), (0x1F2C, 'M', u'ἤ'), (0x1F2D, 'M', u'ἥ'), - ] - -def _seg_19(): - return [ (0x1F2E, 'M', u'ἦ'), (0x1F2F, 'M', u'ἧ'), (0x1F30, 'V'), @@ -2076,6 +2087,10 @@ def _seg_19(): (0x1FA1, 'M', u'ὡι'), (0x1FA2, 'M', u'ὢι'), (0x1FA3, 'M', u'ὣι'), + ] + +def _seg_20(): + return [ (0x1FA4, 'M', u'ὤι'), (0x1FA5, 'M', u'ὥι'), (0x1FA6, 'M', u'ὦι'), @@ -2087,10 +2102,6 @@ def _seg_19(): (0x1FAC, 'M', u'ὤι'), (0x1FAD, 'M', u'ὥι'), (0x1FAE, 'M', u'ὦι'), - ] - -def _seg_20(): - return [ (0x1FAF, 'M', u'ὧι'), (0x1FB0, 'V'), (0x1FB2, 'M', u'ὰι'), @@ -2180,6 +2191,10 @@ def _seg_20(): (0x2035, 'V'), (0x2036, 'M', u'‵‵'), (0x2037, 'M', u'‵‵‵'), + ] + +def _seg_21(): + return [ (0x2038, 'V'), (0x203C, '3', u'!!'), (0x203D, 'V'), @@ -2191,10 +2206,6 @@ def _seg_20(): (0x204A, 'V'), (0x2057, 'M', u'′′′′'), (0x2058, 'V'), - ] - -def _seg_21(): - return [ (0x205F, '3', u' '), (0x2060, 'I'), (0x2061, 'X'), @@ -2248,7 +2259,7 @@ def _seg_21(): (0x20A0, 'V'), (0x20A8, 'M', u'rs'), (0x20A9, 'V'), - (0x20BB, 'X'), + (0x20C0, 'X'), (0x20D0, 'V'), (0x20F1, 'X'), (0x2100, '3', u'a/c'), @@ -2284,6 +2295,10 @@ def _seg_21(): (0x2127, 'V'), (0x2128, 'M', u'z'), (0x2129, 'V'), + ] + +def _seg_22(): + return [ (0x212A, 'M', u'k'), (0x212B, 'M', u'å'), (0x212C, 'M', u'b'), @@ -2295,10 +2310,6 @@ def _seg_21(): (0x2133, 'M', u'm'), (0x2134, 'M', u'o'), (0x2135, 'M', u'א'), - ] - -def _seg_22(): - return [ (0x2136, 'M', u'ב'), (0x2137, 'M', u'ג'), (0x2138, 'M', u'ד'), @@ -2367,7 +2378,8 @@ def _seg_22(): (0x2183, 'X'), (0x2184, 'V'), (0x2189, 'M', u'0⁄3'), - (0x218A, 'X'), + (0x218A, 'V'), + (0x218C, 'X'), (0x2190, 'V'), (0x222C, 'M', u'∫∫'), (0x222D, 'M', u'∫∫∫'), @@ -2382,13 +2394,15 @@ def _seg_22(): (0x2329, 'M', u'〈'), (0x232A, 'M', u'〉'), (0x232B, 'V'), - (0x23F4, 'X'), - (0x2400, 'V'), (0x2427, 'X'), (0x2440, 'V'), (0x244B, 'X'), (0x2460, 'M', u'1'), (0x2461, 'M', u'2'), + ] + +def _seg_23(): + return [ (0x2462, 'M', u'3'), (0x2463, 'M', u'4'), (0x2464, 'M', u'5'), @@ -2399,10 +2413,6 @@ def _seg_22(): (0x2469, 'M', u'10'), (0x246A, 'M', u'11'), (0x246B, 'M', u'12'), - ] - -def _seg_23(): - return [ (0x246C, 'M', u'13'), (0x246D, 'M', u'14'), (0x246E, 'M', u'15'), @@ -2493,6 +2503,10 @@ def _seg_23(): (0x24D6, 'M', u'g'), (0x24D7, 'M', u'h'), (0x24D8, 'M', u'i'), + ] + +def _seg_24(): + return [ (0x24D9, 'M', u'j'), (0x24DA, 'M', u'k'), (0x24DB, 'M', u'l'), @@ -2503,10 +2517,6 @@ def _seg_23(): (0x24E0, 'M', u'q'), (0x24E1, 'M', u'r'), (0x24E2, 'M', u's'), - ] - -def _seg_24(): - return [ (0x24E3, 'M', u't'), (0x24E4, 'M', u'u'), (0x24E5, 'M', u'v'), @@ -2516,8 +2526,6 @@ def _seg_24(): (0x24E9, 'M', u'z'), (0x24EA, 'M', u'0'), (0x24EB, 'V'), - (0x2700, 'X'), - (0x2701, 'V'), (0x2A0C, 'M', u'∫∫∫∫'), (0x2A0D, 'V'), (0x2A74, '3', u'::='), @@ -2526,9 +2534,13 @@ def _seg_24(): (0x2A77, 'V'), (0x2ADC, 'M', u'⫝̸'), (0x2ADD, 'V'), - (0x2B4D, 'X'), - (0x2B50, 'V'), - (0x2B5A, 'X'), + (0x2B74, 'X'), + (0x2B76, 'V'), + (0x2B96, 'X'), + (0x2B98, 'V'), + (0x2BC9, 'X'), + (0x2BCA, 'V'), + (0x2BFF, 'X'), (0x2C00, 'M', u'ⰰ'), (0x2C01, 'M', u'ⰱ'), (0x2C02, 'M', u'ⰲ'), @@ -2595,6 +2607,10 @@ def _seg_24(): (0x2C6E, 'M', u'ɱ'), (0x2C6F, 'M', u'ɐ'), (0x2C70, 'M', u'ɒ'), + ] + +def _seg_25(): + return [ (0x2C71, 'V'), (0x2C72, 'M', u'ⱳ'), (0x2C73, 'V'), @@ -2607,10 +2623,6 @@ def _seg_24(): (0x2C80, 'M', u'ⲁ'), (0x2C81, 'V'), (0x2C82, 'M', u'ⲃ'), - ] - -def _seg_25(): - return [ (0x2C83, 'V'), (0x2C84, 'M', u'ⲅ'), (0x2C85, 'V'), @@ -2699,6 +2711,10 @@ def _seg_25(): (0x2CD8, 'M', u'ⳙ'), (0x2CD9, 'V'), (0x2CDA, 'M', u'ⳛ'), + ] + +def _seg_26(): + return [ (0x2CDB, 'V'), (0x2CDC, 'M', u'ⳝ'), (0x2CDD, 'V'), @@ -2711,10 +2727,6 @@ def _seg_25(): (0x2CEB, 'M', u'ⳬ'), (0x2CEC, 'V'), (0x2CED, 'M', u'ⳮ'), - ] - -def _seg_26(): - return [ (0x2CEE, 'V'), (0x2CF2, 'M', u'ⳳ'), (0x2CF3, 'V'), @@ -2749,7 +2761,7 @@ def _seg_26(): (0x2DD8, 'V'), (0x2DDF, 'X'), (0x2DE0, 'V'), - (0x2E3C, 'X'), + (0x2E4F, 'X'), (0x2E80, 'V'), (0x2E9A, 'X'), (0x2E9B, 'V'), @@ -2803,6 +2815,10 @@ def _seg_26(): (0x2F2B, 'M', u'尸'), (0x2F2C, 'M', u'屮'), (0x2F2D, 'M', u'山'), + ] + +def _seg_27(): + return [ (0x2F2E, 'M', u'巛'), (0x2F2F, 'M', u'工'), (0x2F30, 'M', u'己'), @@ -2815,10 +2831,6 @@ def _seg_26(): (0x2F37, 'M', u'弋'), (0x2F38, 'M', u'弓'), (0x2F39, 'M', u'彐'), - ] - -def _seg_27(): - return [ (0x2F3A, 'M', u'彡'), (0x2F3B, 'M', u'彳'), (0x2F3C, 'M', u'心'), @@ -2907,6 +2919,10 @@ def _seg_27(): (0x2F8F, 'M', u'行'), (0x2F90, 'M', u'衣'), (0x2F91, 'M', u'襾'), + ] + +def _seg_28(): + return [ (0x2F92, 'M', u'見'), (0x2F93, 'M', u'角'), (0x2F94, 'M', u'言'), @@ -2919,10 +2935,6 @@ def _seg_27(): (0x2F9B, 'M', u'走'), (0x2F9C, 'M', u'足'), (0x2F9D, 'M', u'身'), - ] - -def _seg_28(): - return [ (0x2F9E, 'M', u'車'), (0x2F9F, 'M', u'辛'), (0x2FA0, 'M', u'辰'), @@ -3002,7 +3014,7 @@ def _seg_28(): (0x30FF, 'M', u'コト'), (0x3100, 'X'), (0x3105, 'V'), - (0x312E, 'X'), + (0x3130, 'X'), (0x3131, 'M', u'ᄀ'), (0x3132, 'M', u'ᄁ'), (0x3133, 'M', u'ᆪ'), @@ -3011,6 +3023,10 @@ def _seg_28(): (0x3136, 'M', u'ᆭ'), (0x3137, 'M', u'ᄃ'), (0x3138, 'M', u'ᄄ'), + ] + +def _seg_29(): + return [ (0x3139, 'M', u'ᄅ'), (0x313A, 'M', u'ᆰ'), (0x313B, 'M', u'ᆱ'), @@ -3023,10 +3039,6 @@ def _seg_28(): (0x3142, 'M', u'ᄇ'), (0x3143, 'M', u'ᄈ'), (0x3144, 'M', u'ᄡ'), - ] - -def _seg_29(): - return [ (0x3145, 'M', u'ᄉ'), (0x3146, 'M', u'ᄊ'), (0x3147, 'M', u'ᄋ'), @@ -3115,6 +3127,10 @@ def _seg_29(): (0x319B, 'M', u'丙'), (0x319C, 'M', u'丁'), (0x319D, 'M', u'天'), + ] + +def _seg_30(): + return [ (0x319E, 'M', u'地'), (0x319F, 'M', u'人'), (0x31A0, 'V'), @@ -3127,10 +3143,6 @@ def _seg_29(): (0x3202, '3', u'(ᄃ)'), (0x3203, '3', u'(ᄅ)'), (0x3204, '3', u'(ᄆ)'), - ] - -def _seg_30(): - return [ (0x3205, '3', u'(ᄇ)'), (0x3206, '3', u'(ᄉ)'), (0x3207, '3', u'(ᄋ)'), @@ -3219,6 +3231,10 @@ def _seg_30(): (0x3261, 'M', u'ᄂ'), (0x3262, 'M', u'ᄃ'), (0x3263, 'M', u'ᄅ'), + ] + +def _seg_31(): + return [ (0x3264, 'M', u'ᄆ'), (0x3265, 'M', u'ᄇ'), (0x3266, 'M', u'ᄉ'), @@ -3231,10 +3247,6 @@ def _seg_30(): (0x326D, 'M', u'ᄒ'), (0x326E, 'M', u'가'), (0x326F, 'M', u'나'), - ] - -def _seg_31(): - return [ (0x3270, 'M', u'다'), (0x3271, 'M', u'라'), (0x3272, 'M', u'마'), @@ -3323,6 +3335,10 @@ def _seg_31(): (0x32C5, 'M', u'6月'), (0x32C6, 'M', u'7月'), (0x32C7, 'M', u'8月'), + ] + +def _seg_32(): + return [ (0x32C8, 'M', u'9月'), (0x32C9, 'M', u'10月'), (0x32CA, 'M', u'11月'), @@ -3335,10 +3351,6 @@ def _seg_31(): (0x32D1, 'M', u'イ'), (0x32D2, 'M', u'ウ'), (0x32D3, 'M', u'エ'), - ] - -def _seg_32(): - return [ (0x32D4, 'M', u'オ'), (0x32D5, 'M', u'カ'), (0x32D6, 'M', u'キ'), @@ -3427,6 +3439,10 @@ def _seg_32(): (0x3329, 'M', u'ノット'), (0x332A, 'M', u'ハイツ'), (0x332B, 'M', u'パーセント'), + ] + +def _seg_33(): + return [ (0x332C, 'M', u'パーツ'), (0x332D, 'M', u'バーレル'), (0x332E, 'M', u'ピアストル'), @@ -3439,10 +3455,6 @@ def _seg_32(): (0x3335, 'M', u'フラン'), (0x3336, 'M', u'ヘクタール'), (0x3337, 'M', u'ペソ'), - ] - -def _seg_33(): - return [ (0x3338, 'M', u'ペニヒ'), (0x3339, 'M', u'ヘルツ'), (0x333A, 'M', u'ペンス'), @@ -3531,6 +3543,10 @@ def _seg_33(): (0x338D, 'M', u'μg'), (0x338E, 'M', u'mg'), (0x338F, 'M', u'kg'), + ] + +def _seg_34(): + return [ (0x3390, 'M', u'hz'), (0x3391, 'M', u'khz'), (0x3392, 'M', u'mhz'), @@ -3543,10 +3559,6 @@ def _seg_33(): (0x3399, 'M', u'fm'), (0x339A, 'M', u'nm'), (0x339B, 'M', u'μm'), - ] - -def _seg_34(): - return [ (0x339C, 'M', u'mm'), (0x339D, 'M', u'cm'), (0x339E, 'M', u'km'), @@ -3635,6 +3647,10 @@ def _seg_34(): (0x33F1, 'M', u'18日'), (0x33F2, 'M', u'19日'), (0x33F3, 'M', u'20日'), + ] + +def _seg_35(): + return [ (0x33F4, 'M', u'21日'), (0x33F5, 'M', u'22日'), (0x33F6, 'M', u'23日'), @@ -3647,14 +3663,10 @@ def _seg_34(): (0x33FD, 'M', u'30日'), (0x33FE, 'M', u'31日'), (0x33FF, 'M', u'gal'), - ] - -def _seg_35(): - return [ (0x3400, 'V'), (0x4DB6, 'X'), (0x4DC0, 'V'), - (0x9FCD, 'X'), + (0x9FF0, 'X'), (0xA000, 'V'), (0xA48D, 'X'), (0xA490, 'V'), @@ -3731,9 +3743,18 @@ def _seg_35(): (0xA695, 'V'), (0xA696, 'M', u'ꚗ'), (0xA697, 'V'), - (0xA698, 'X'), - (0xA69F, 'V'), + (0xA698, 'M', u'ꚙ'), + (0xA699, 'V'), + (0xA69A, 'M', u'ꚛ'), + (0xA69B, 'V'), + (0xA69C, 'M', u'ъ'), + (0xA69D, 'M', u'ь'), + (0xA69E, 'V'), (0xA6F8, 'X'), + ] + +def _seg_36(): + return [ (0xA700, 'V'), (0xA722, 'M', u'ꜣ'), (0xA723, 'V'), @@ -3751,10 +3772,6 @@ def _seg_35(): (0xA72F, 'V'), (0xA732, 'M', u'ꜳ'), (0xA733, 'V'), - ] - -def _seg_36(): - return [ (0xA734, 'M', u'ꜵ'), (0xA735, 'V'), (0xA736, 'M', u'ꜷ'), @@ -3836,12 +3853,24 @@ def _seg_36(): (0xA78C, 'V'), (0xA78D, 'M', u'ɥ'), (0xA78E, 'V'), - (0xA78F, 'X'), (0xA790, 'M', u'ꞑ'), (0xA791, 'V'), + ] + +def _seg_37(): + return [ (0xA792, 'M', u'ꞓ'), (0xA793, 'V'), - (0xA794, 'X'), + (0xA796, 'M', u'ꞗ'), + (0xA797, 'V'), + (0xA798, 'M', u'ꞙ'), + (0xA799, 'V'), + (0xA79A, 'M', u'ꞛ'), + (0xA79B, 'V'), + (0xA79C, 'M', u'ꞝ'), + (0xA79D, 'V'), + (0xA79E, 'M', u'ꞟ'), + (0xA79F, 'V'), (0xA7A0, 'M', u'ꞡ'), (0xA7A1, 'V'), (0xA7A2, 'M', u'ꞣ'), @@ -3853,12 +3882,24 @@ def _seg_36(): (0xA7A8, 'M', u'ꞩ'), (0xA7A9, 'V'), (0xA7AA, 'M', u'ɦ'), - (0xA7AB, 'X'), + (0xA7AB, 'M', u'ɜ'), + (0xA7AC, 'M', u'ɡ'), + (0xA7AD, 'M', u'ɬ'), + (0xA7AE, 'M', u'ɪ'), + (0xA7AF, 'V'), + (0xA7B0, 'M', u'ʞ'), + (0xA7B1, 'M', u'ʇ'), + (0xA7B2, 'M', u'ʝ'), + (0xA7B3, 'M', u'ꭓ'), + (0xA7B4, 'M', u'ꞵ'), + (0xA7B5, 'V'), + (0xA7B6, 'M', u'ꞷ'), + (0xA7B7, 'V'), + (0xA7B8, 'X'), + (0xA7B9, 'V'), + (0xA7BA, 'X'), + (0xA7F7, 'V'), (0xA7F8, 'M', u'ħ'), - ] - -def _seg_37(): - return [ (0xA7F9, 'M', u'œ'), (0xA7FA, 'V'), (0xA82C, 'X'), @@ -3867,12 +3908,10 @@ def _seg_37(): (0xA840, 'V'), (0xA878, 'X'), (0xA880, 'V'), - (0xA8C5, 'X'), + (0xA8C6, 'X'), (0xA8CE, 'V'), (0xA8DA, 'X'), (0xA8E0, 'V'), - (0xA8FC, 'X'), - (0xA900, 'V'), (0xA954, 'X'), (0xA95F, 'V'), (0xA97D, 'X'), @@ -3881,7 +3920,7 @@ def _seg_37(): (0xA9CF, 'V'), (0xA9DA, 'X'), (0xA9DE, 'V'), - (0xA9E0, 'X'), + (0xA9FF, 'X'), (0xAA00, 'V'), (0xAA37, 'X'), (0xAA40, 'V'), @@ -3889,8 +3928,6 @@ def _seg_37(): (0xAA50, 'V'), (0xAA5A, 'X'), (0xAA5C, 'V'), - (0xAA7C, 'X'), - (0xAA80, 'V'), (0xAAC3, 'X'), (0xAADB, 'V'), (0xAAF7, 'X'), @@ -3904,6 +3941,97 @@ def _seg_37(): (0xAB27, 'X'), (0xAB28, 'V'), (0xAB2F, 'X'), + (0xAB30, 'V'), + (0xAB5C, 'M', u'ꜧ'), + (0xAB5D, 'M', u'ꬷ'), + (0xAB5E, 'M', u'ɫ'), + (0xAB5F, 'M', u'ꭒ'), + (0xAB60, 'V'), + (0xAB66, 'X'), + (0xAB70, 'M', u'Ꭰ'), + (0xAB71, 'M', u'Ꭱ'), + (0xAB72, 'M', u'Ꭲ'), + (0xAB73, 'M', u'Ꭳ'), + (0xAB74, 'M', u'Ꭴ'), + (0xAB75, 'M', u'Ꭵ'), + (0xAB76, 'M', u'Ꭶ'), + (0xAB77, 'M', u'Ꭷ'), + (0xAB78, 'M', u'Ꭸ'), + (0xAB79, 'M', u'Ꭹ'), + (0xAB7A, 'M', u'Ꭺ'), + ] + +def _seg_38(): + return [ + (0xAB7B, 'M', u'Ꭻ'), + (0xAB7C, 'M', u'Ꭼ'), + (0xAB7D, 'M', u'Ꭽ'), + (0xAB7E, 'M', u'Ꭾ'), + (0xAB7F, 'M', u'Ꭿ'), + (0xAB80, 'M', u'Ꮀ'), + (0xAB81, 'M', u'Ꮁ'), + (0xAB82, 'M', u'Ꮂ'), + (0xAB83, 'M', u'Ꮃ'), + (0xAB84, 'M', u'Ꮄ'), + (0xAB85, 'M', u'Ꮅ'), + (0xAB86, 'M', u'Ꮆ'), + (0xAB87, 'M', u'Ꮇ'), + (0xAB88, 'M', u'Ꮈ'), + (0xAB89, 'M', u'Ꮉ'), + (0xAB8A, 'M', u'Ꮊ'), + (0xAB8B, 'M', u'Ꮋ'), + (0xAB8C, 'M', u'Ꮌ'), + (0xAB8D, 'M', u'Ꮍ'), + (0xAB8E, 'M', u'Ꮎ'), + (0xAB8F, 'M', u'Ꮏ'), + (0xAB90, 'M', u'Ꮐ'), + (0xAB91, 'M', u'Ꮑ'), + (0xAB92, 'M', u'Ꮒ'), + (0xAB93, 'M', u'Ꮓ'), + (0xAB94, 'M', u'Ꮔ'), + (0xAB95, 'M', u'Ꮕ'), + (0xAB96, 'M', u'Ꮖ'), + (0xAB97, 'M', u'Ꮗ'), + (0xAB98, 'M', u'Ꮘ'), + (0xAB99, 'M', u'Ꮙ'), + (0xAB9A, 'M', u'Ꮚ'), + (0xAB9B, 'M', u'Ꮛ'), + (0xAB9C, 'M', u'Ꮜ'), + (0xAB9D, 'M', u'Ꮝ'), + (0xAB9E, 'M', u'Ꮞ'), + (0xAB9F, 'M', u'Ꮟ'), + (0xABA0, 'M', u'Ꮠ'), + (0xABA1, 'M', u'Ꮡ'), + (0xABA2, 'M', u'Ꮢ'), + (0xABA3, 'M', u'Ꮣ'), + (0xABA4, 'M', u'Ꮤ'), + (0xABA5, 'M', u'Ꮥ'), + (0xABA6, 'M', u'Ꮦ'), + (0xABA7, 'M', u'Ꮧ'), + (0xABA8, 'M', u'Ꮨ'), + (0xABA9, 'M', u'Ꮩ'), + (0xABAA, 'M', u'Ꮪ'), + (0xABAB, 'M', u'Ꮫ'), + (0xABAC, 'M', u'Ꮬ'), + (0xABAD, 'M', u'Ꮭ'), + (0xABAE, 'M', u'Ꮮ'), + (0xABAF, 'M', u'Ꮯ'), + (0xABB0, 'M', u'Ꮰ'), + (0xABB1, 'M', u'Ꮱ'), + (0xABB2, 'M', u'Ꮲ'), + (0xABB3, 'M', u'Ꮳ'), + (0xABB4, 'M', u'Ꮴ'), + (0xABB5, 'M', u'Ꮵ'), + (0xABB6, 'M', u'Ꮶ'), + (0xABB7, 'M', u'Ꮷ'), + (0xABB8, 'M', u'Ꮸ'), + (0xABB9, 'M', u'Ꮹ'), + (0xABBA, 'M', u'Ꮺ'), + (0xABBB, 'M', u'Ꮻ'), + (0xABBC, 'M', u'Ꮼ'), + (0xABBD, 'M', u'Ꮽ'), + (0xABBE, 'M', u'Ꮾ'), + (0xABBF, 'M', u'Ꮿ'), (0xABC0, 'V'), (0xABEE, 'X'), (0xABF0, 'V'), @@ -3935,6 +4063,10 @@ def _seg_37(): (0xF913, 'M', u'邏'), (0xF914, 'M', u'樂'), (0xF915, 'M', u'洛'), + ] + +def _seg_39(): + return [ (0xF916, 'M', u'烙'), (0xF917, 'M', u'珞'), (0xF918, 'M', u'落'), @@ -3959,10 +4091,6 @@ def _seg_37(): (0xF92B, 'M', u'狼'), (0xF92C, 'M', u'郎'), (0xF92D, 'M', u'來'), - ] - -def _seg_38(): - return [ (0xF92E, 'M', u'冷'), (0xF92F, 'M', u'勞'), (0xF930, 'M', u'擄'), @@ -4039,6 +4167,10 @@ def _seg_38(): (0xF977, 'M', u'亮'), (0xF978, 'M', u'兩'), (0xF979, 'M', u'凉'), + ] + +def _seg_40(): + return [ (0xF97A, 'M', u'梁'), (0xF97B, 'M', u'糧'), (0xF97C, 'M', u'良'), @@ -4063,10 +4195,6 @@ def _seg_38(): (0xF98F, 'M', u'憐'), (0xF990, 'M', u'戀'), (0xF991, 'M', u'撚'), - ] - -def _seg_39(): - return [ (0xF992, 'M', u'漣'), (0xF993, 'M', u'煉'), (0xF994, 'M', u'璉'), @@ -4143,6 +4271,10 @@ def _seg_39(): (0xF9DB, 'M', u'率'), (0xF9DC, 'M', u'隆'), (0xF9DD, 'M', u'利'), + ] + +def _seg_41(): + return [ (0xF9DE, 'M', u'吏'), (0xF9DF, 'M', u'履'), (0xF9E0, 'M', u'易'), @@ -4167,10 +4299,6 @@ def _seg_39(): (0xF9F3, 'M', u'麟'), (0xF9F4, 'M', u'林'), (0xF9F5, 'M', u'淋'), - ] - -def _seg_40(): - return [ (0xF9F6, 'M', u'臨'), (0xF9F7, 'M', u'立'), (0xF9F8, 'M', u'笠'), @@ -4247,6 +4375,10 @@ def _seg_40(): (0xFA44, 'M', u'梅'), (0xFA45, 'M', u'海'), (0xFA46, 'M', u'渚'), + ] + +def _seg_42(): + return [ (0xFA47, 'M', u'漢'), (0xFA48, 'M', u'煮'), (0xFA49, 'M', u'爫'), @@ -4271,10 +4403,6 @@ def _seg_40(): (0xFA5C, 'M', u'臭'), (0xFA5D, 'M', u'艹'), (0xFA5F, 'M', u'著'), - ] - -def _seg_41(): - return [ (0xFA60, 'M', u'褐'), (0xFA61, 'M', u'視'), (0xFA62, 'M', u'謁'), @@ -4351,6 +4479,10 @@ def _seg_41(): (0xFAAA, 'M', u'着'), (0xFAAB, 'M', u'磌'), (0xFAAC, 'M', u'窱'), + ] + +def _seg_43(): + return [ (0xFAAD, 'M', u'節'), (0xFAAE, 'M', u'类'), (0xFAAF, 'M', u'絛'), @@ -4375,10 +4507,6 @@ def _seg_41(): (0xFAC2, 'M', u'輸'), (0xFAC3, 'M', u'遲'), (0xFAC4, 'M', u'醙'), - ] - -def _seg_42(): - return [ (0xFAC5, 'M', u'鉶'), (0xFAC6, 'M', u'陼'), (0xFAC7, 'M', u'難'), @@ -4455,6 +4583,10 @@ def _seg_42(): (0xFB43, 'M', u'ףּ'), (0xFB44, 'M', u'פּ'), (0xFB45, 'X'), + ] + +def _seg_44(): + return [ (0xFB46, 'M', u'צּ'), (0xFB47, 'M', u'קּ'), (0xFB48, 'M', u'רּ'), @@ -4479,10 +4611,6 @@ def _seg_42(): (0xFB7A, 'M', u'چ'), (0xFB7E, 'M', u'ڇ'), (0xFB82, 'M', u'ڍ'), - ] - -def _seg_43(): - return [ (0xFB84, 'M', u'ڌ'), (0xFB86, 'M', u'ڎ'), (0xFB88, 'M', u'ڈ'), @@ -4559,6 +4687,10 @@ def _seg_43(): (0xFC24, 'M', u'ضخ'), (0xFC25, 'M', u'ضم'), (0xFC26, 'M', u'طح'), + ] + +def _seg_45(): + return [ (0xFC27, 'M', u'طم'), (0xFC28, 'M', u'ظم'), (0xFC29, 'M', u'عج'), @@ -4583,10 +4715,6 @@ def _seg_43(): (0xFC3C, 'M', u'كم'), (0xFC3D, 'M', u'كى'), (0xFC3E, 'M', u'كي'), - ] - -def _seg_44(): - return [ (0xFC3F, 'M', u'لج'), (0xFC40, 'M', u'لح'), (0xFC41, 'M', u'لخ'), @@ -4663,6 +4791,10 @@ def _seg_44(): (0xFC88, 'M', u'ما'), (0xFC89, 'M', u'مم'), (0xFC8A, 'M', u'نر'), + ] + +def _seg_46(): + return [ (0xFC8B, 'M', u'نز'), (0xFC8C, 'M', u'نم'), (0xFC8D, 'M', u'نن'), @@ -4687,10 +4819,6 @@ def _seg_44(): (0xFCA0, 'M', u'به'), (0xFCA1, 'M', u'تج'), (0xFCA2, 'M', u'تح'), - ] - -def _seg_45(): - return [ (0xFCA3, 'M', u'تخ'), (0xFCA4, 'M', u'تم'), (0xFCA5, 'M', u'ته'), @@ -4767,6 +4895,10 @@ def _seg_45(): (0xFCEC, 'M', u'كم'), (0xFCED, 'M', u'لم'), (0xFCEE, 'M', u'نم'), + ] + +def _seg_47(): + return [ (0xFCEF, 'M', u'نه'), (0xFCF0, 'M', u'يم'), (0xFCF1, 'M', u'يه'), @@ -4791,10 +4923,6 @@ def _seg_45(): (0xFD04, 'M', u'خي'), (0xFD05, 'M', u'صى'), (0xFD06, 'M', u'صي'), - ] - -def _seg_46(): - return [ (0xFD07, 'M', u'ضى'), (0xFD08, 'M', u'ضي'), (0xFD09, 'M', u'شج'), @@ -4871,6 +4999,10 @@ def _seg_46(): (0xFD66, 'M', u'صمم'), (0xFD67, 'M', u'شحم'), (0xFD69, 'M', u'شجي'), + ] + +def _seg_48(): + return [ (0xFD6A, 'M', u'شمخ'), (0xFD6C, 'M', u'شمم'), (0xFD6E, 'M', u'ضحى'), @@ -4895,10 +5027,6 @@ def _seg_46(): (0xFD87, 'M', u'لمح'), (0xFD89, 'M', u'محج'), (0xFD8A, 'M', u'محم'), - ] - -def _seg_47(): - return [ (0xFD8B, 'M', u'محي'), (0xFD8C, 'M', u'مجح'), (0xFD8D, 'M', u'مجم'), @@ -4975,6 +5103,10 @@ def _seg_47(): (0xFDFE, 'X'), (0xFE00, 'I'), (0xFE10, '3', u','), + ] + +def _seg_49(): + return [ (0xFE11, 'M', u'、'), (0xFE12, 'X'), (0xFE13, '3', u':'), @@ -4985,7 +5117,7 @@ def _seg_47(): (0xFE18, 'M', u'〗'), (0xFE19, 'X'), (0xFE20, 'V'), - (0xFE27, 'X'), + (0xFE30, 'X'), (0xFE31, 'M', u'—'), (0xFE32, 'M', u'–'), (0xFE33, '3', u'_'), @@ -4999,10 +5131,6 @@ def _seg_47(): (0xFE3C, 'M', u'】'), (0xFE3D, 'M', u'《'), (0xFE3E, 'M', u'》'), - ] - -def _seg_48(): - return [ (0xFE3F, 'M', u'〈'), (0xFE40, 'M', u'〉'), (0xFE41, 'M', u'「'), @@ -5079,6 +5207,10 @@ def _seg_48(): (0xFEB1, 'M', u'س'), (0xFEB5, 'M', u'ش'), (0xFEB9, 'M', u'ص'), + ] + +def _seg_50(): + return [ (0xFEBD, 'M', u'ض'), (0xFEC1, 'M', u'ط'), (0xFEC5, 'M', u'ظ'), @@ -5103,10 +5235,6 @@ def _seg_48(): (0xFF00, 'X'), (0xFF01, '3', u'!'), (0xFF02, '3', u'"'), - ] - -def _seg_49(): - return [ (0xFF03, '3', u'#'), (0xFF04, '3', u'$'), (0xFF05, '3', u'%'), @@ -5183,6 +5311,10 @@ def _seg_49(): (0xFF4C, 'M', u'l'), (0xFF4D, 'M', u'm'), (0xFF4E, 'M', u'n'), + ] + +def _seg_51(): + return [ (0xFF4F, 'M', u'o'), (0xFF50, 'M', u'p'), (0xFF51, 'M', u'q'), @@ -5207,10 +5339,6 @@ def _seg_49(): (0xFF64, 'M', u'、'), (0xFF65, 'M', u'・'), (0xFF66, 'M', u'ヲ'), - ] - -def _seg_50(): - return [ (0xFF67, 'M', u'ァ'), (0xFF68, 'M', u'ィ'), (0xFF69, 'M', u'ゥ'), @@ -5287,6 +5415,10 @@ def _seg_50(): (0xFFB0, 'M', u'ᄚ'), (0xFFB1, 'M', u'ᄆ'), (0xFFB2, 'M', u'ᄇ'), + ] + +def _seg_52(): + return [ (0xFFB3, 'M', u'ᄈ'), (0xFFB4, 'M', u'ᄡ'), (0xFFB5, 'M', u'ᄉ'), @@ -5311,10 +5443,6 @@ def _seg_50(): (0xFFCB, 'M', u'ᅨ'), (0xFFCC, 'M', u'ᅩ'), (0xFFCD, 'M', u'ᅪ'), - ] - -def _seg_51(): - return [ (0xFFCE, 'M', u'ᅫ'), (0xFFCF, 'M', u'ᅬ'), (0xFFD0, 'X'), @@ -5364,21 +5492,25 @@ def _seg_51(): (0x10107, 'V'), (0x10134, 'X'), (0x10137, 'V'), - (0x1018B, 'X'), + (0x1018F, 'X'), (0x10190, 'V'), (0x1019C, 'X'), + (0x101A0, 'V'), + (0x101A1, 'X'), (0x101D0, 'V'), (0x101FE, 'X'), (0x10280, 'V'), (0x1029D, 'X'), (0x102A0, 'V'), (0x102D1, 'X'), + (0x102E0, 'V'), + (0x102FC, 'X'), (0x10300, 'V'), - (0x1031F, 'X'), - (0x10320, 'V'), (0x10324, 'X'), - (0x10330, 'V'), + (0x1032D, 'V'), (0x1034B, 'X'), + (0x10350, 'V'), + (0x1037B, 'X'), (0x10380, 'V'), (0x1039E, 'X'), (0x1039F, 'V'), @@ -5387,6 +5519,10 @@ def _seg_51(): (0x103D6, 'X'), (0x10400, 'M', u'𐐨'), (0x10401, 'M', u'𐐩'), + ] + +def _seg_53(): + return [ (0x10402, 'M', u'𐐪'), (0x10403, 'M', u'𐐫'), (0x10404, 'M', u'𐐬'), @@ -5415,10 +5551,6 @@ def _seg_51(): (0x1041B, 'M', u'𐑃'), (0x1041C, 'M', u'𐑄'), (0x1041D, 'M', u'𐑅'), - ] - -def _seg_52(): - return [ (0x1041E, 'M', u'𐑆'), (0x1041F, 'M', u'𐑇'), (0x10420, 'M', u'𐑈'), @@ -5433,6 +5565,57 @@ def _seg_52(): (0x1049E, 'X'), (0x104A0, 'V'), (0x104AA, 'X'), + (0x104B0, 'M', u'𐓘'), + (0x104B1, 'M', u'𐓙'), + (0x104B2, 'M', u'𐓚'), + (0x104B3, 'M', u'𐓛'), + (0x104B4, 'M', u'𐓜'), + (0x104B5, 'M', u'𐓝'), + (0x104B6, 'M', u'𐓞'), + (0x104B7, 'M', u'𐓟'), + (0x104B8, 'M', u'𐓠'), + (0x104B9, 'M', u'𐓡'), + (0x104BA, 'M', u'𐓢'), + (0x104BB, 'M', u'𐓣'), + (0x104BC, 'M', u'𐓤'), + (0x104BD, 'M', u'𐓥'), + (0x104BE, 'M', u'𐓦'), + (0x104BF, 'M', u'𐓧'), + (0x104C0, 'M', u'𐓨'), + (0x104C1, 'M', u'𐓩'), + (0x104C2, 'M', u'𐓪'), + (0x104C3, 'M', u'𐓫'), + (0x104C4, 'M', u'𐓬'), + (0x104C5, 'M', u'𐓭'), + (0x104C6, 'M', u'𐓮'), + (0x104C7, 'M', u'𐓯'), + (0x104C8, 'M', u'𐓰'), + (0x104C9, 'M', u'𐓱'), + (0x104CA, 'M', u'𐓲'), + (0x104CB, 'M', u'𐓳'), + (0x104CC, 'M', u'𐓴'), + (0x104CD, 'M', u'𐓵'), + (0x104CE, 'M', u'𐓶'), + (0x104CF, 'M', u'𐓷'), + (0x104D0, 'M', u'𐓸'), + (0x104D1, 'M', u'𐓹'), + (0x104D2, 'M', u'𐓺'), + (0x104D3, 'M', u'𐓻'), + (0x104D4, 'X'), + (0x104D8, 'V'), + (0x104FC, 'X'), + (0x10500, 'V'), + (0x10528, 'X'), + (0x10530, 'V'), + (0x10564, 'X'), + (0x1056F, 'V'), + (0x10570, 'X'), + (0x10600, 'V'), + (0x10737, 'X'), + (0x10740, 'V'), + (0x10756, 'X'), + (0x10760, 'V'), + (0x10768, 'X'), (0x10800, 'V'), (0x10806, 'X'), (0x10808, 'V'), @@ -5440,14 +5623,24 @@ def _seg_52(): (0x1080A, 'V'), (0x10836, 'X'), (0x10837, 'V'), + ] + +def _seg_54(): + return [ (0x10839, 'X'), (0x1083C, 'V'), (0x1083D, 'X'), (0x1083F, 'V'), (0x10856, 'X'), (0x10857, 'V'), - (0x10860, 'X'), - (0x10900, 'V'), + (0x1089F, 'X'), + (0x108A7, 'V'), + (0x108B0, 'X'), + (0x108E0, 'V'), + (0x108F3, 'X'), + (0x108F4, 'V'), + (0x108F6, 'X'), + (0x108FB, 'V'), (0x1091C, 'X'), (0x1091F, 'V'), (0x1093A, 'X'), @@ -5455,9 +5648,9 @@ def _seg_52(): (0x10940, 'X'), (0x10980, 'V'), (0x109B8, 'X'), - (0x109BE, 'V'), - (0x109C0, 'X'), - (0x10A00, 'V'), + (0x109BC, 'V'), + (0x109D0, 'X'), + (0x109D2, 'V'), (0x10A04, 'X'), (0x10A05, 'V'), (0x10A07, 'X'), @@ -5466,15 +5659,19 @@ def _seg_52(): (0x10A15, 'V'), (0x10A18, 'X'), (0x10A19, 'V'), - (0x10A34, 'X'), + (0x10A36, 'X'), (0x10A38, 'V'), (0x10A3B, 'X'), (0x10A3F, 'V'), - (0x10A48, 'X'), + (0x10A49, 'X'), (0x10A50, 'V'), (0x10A59, 'X'), (0x10A60, 'V'), - (0x10A80, 'X'), + (0x10AA0, 'X'), + (0x10AC0, 'V'), + (0x10AE7, 'X'), + (0x10AEB, 'V'), + (0x10AF7, 'X'), (0x10B00, 'V'), (0x10B36, 'X'), (0x10B39, 'V'), @@ -5482,16 +5679,86 @@ def _seg_52(): (0x10B58, 'V'), (0x10B73, 'X'), (0x10B78, 'V'), - (0x10B80, 'X'), + (0x10B92, 'X'), + (0x10B99, 'V'), + (0x10B9D, 'X'), + (0x10BA9, 'V'), + (0x10BB0, 'X'), (0x10C00, 'V'), (0x10C49, 'X'), + (0x10C80, 'M', u'𐳀'), + (0x10C81, 'M', u'𐳁'), + (0x10C82, 'M', u'𐳂'), + (0x10C83, 'M', u'𐳃'), + (0x10C84, 'M', u'𐳄'), + (0x10C85, 'M', u'𐳅'), + (0x10C86, 'M', u'𐳆'), + (0x10C87, 'M', u'𐳇'), + (0x10C88, 'M', u'𐳈'), + (0x10C89, 'M', u'𐳉'), + (0x10C8A, 'M', u'𐳊'), + (0x10C8B, 'M', u'𐳋'), + (0x10C8C, 'M', u'𐳌'), + (0x10C8D, 'M', u'𐳍'), + (0x10C8E, 'M', u'𐳎'), + (0x10C8F, 'M', u'𐳏'), + (0x10C90, 'M', u'𐳐'), + (0x10C91, 'M', u'𐳑'), + (0x10C92, 'M', u'𐳒'), + (0x10C93, 'M', u'𐳓'), + (0x10C94, 'M', u'𐳔'), + (0x10C95, 'M', u'𐳕'), + (0x10C96, 'M', u'𐳖'), + (0x10C97, 'M', u'𐳗'), + (0x10C98, 'M', u'𐳘'), + (0x10C99, 'M', u'𐳙'), + (0x10C9A, 'M', u'𐳚'), + (0x10C9B, 'M', u'𐳛'), + (0x10C9C, 'M', u'𐳜'), + (0x10C9D, 'M', u'𐳝'), + (0x10C9E, 'M', u'𐳞'), + (0x10C9F, 'M', u'𐳟'), + (0x10CA0, 'M', u'𐳠'), + (0x10CA1, 'M', u'𐳡'), + (0x10CA2, 'M', u'𐳢'), + (0x10CA3, 'M', u'𐳣'), + (0x10CA4, 'M', u'𐳤'), + (0x10CA5, 'M', u'𐳥'), + (0x10CA6, 'M', u'𐳦'), + (0x10CA7, 'M', u'𐳧'), + (0x10CA8, 'M', u'𐳨'), + ] + +def _seg_55(): + return [ + (0x10CA9, 'M', u'𐳩'), + (0x10CAA, 'M', u'𐳪'), + (0x10CAB, 'M', u'𐳫'), + (0x10CAC, 'M', u'𐳬'), + (0x10CAD, 'M', u'𐳭'), + (0x10CAE, 'M', u'𐳮'), + (0x10CAF, 'M', u'𐳯'), + (0x10CB0, 'M', u'𐳰'), + (0x10CB1, 'M', u'𐳱'), + (0x10CB2, 'M', u'𐳲'), + (0x10CB3, 'X'), + (0x10CC0, 'V'), + (0x10CF3, 'X'), + (0x10CFA, 'V'), + (0x10D28, 'X'), + (0x10D30, 'V'), + (0x10D3A, 'X'), (0x10E60, 'V'), (0x10E7F, 'X'), + (0x10F00, 'V'), + (0x10F28, 'X'), + (0x10F30, 'V'), + (0x10F5A, 'X'), (0x11000, 'V'), (0x1104E, 'X'), (0x11052, 'V'), (0x11070, 'X'), - (0x11080, 'V'), + (0x1107F, 'V'), (0x110BD, 'X'), (0x110BE, 'V'), (0x110C2, 'X'), @@ -5502,37 +5769,252 @@ def _seg_52(): (0x11100, 'V'), (0x11135, 'X'), (0x11136, 'V'), - (0x11144, 'X'), + (0x11147, 'X'), + (0x11150, 'V'), + (0x11177, 'X'), (0x11180, 'V'), - (0x111C9, 'X'), + (0x111CE, 'X'), (0x111D0, 'V'), - (0x111DA, 'X'), + (0x111E0, 'X'), + (0x111E1, 'V'), + (0x111F5, 'X'), + (0x11200, 'V'), + (0x11212, 'X'), + (0x11213, 'V'), + (0x1123F, 'X'), + (0x11280, 'V'), + (0x11287, 'X'), + (0x11288, 'V'), + (0x11289, 'X'), + (0x1128A, 'V'), + (0x1128E, 'X'), + (0x1128F, 'V'), + (0x1129E, 'X'), + (0x1129F, 'V'), + (0x112AA, 'X'), + (0x112B0, 'V'), + (0x112EB, 'X'), + (0x112F0, 'V'), + (0x112FA, 'X'), + (0x11300, 'V'), + (0x11304, 'X'), + (0x11305, 'V'), + (0x1130D, 'X'), + (0x1130F, 'V'), + (0x11311, 'X'), + (0x11313, 'V'), + (0x11329, 'X'), + (0x1132A, 'V'), + (0x11331, 'X'), + (0x11332, 'V'), + (0x11334, 'X'), + (0x11335, 'V'), + (0x1133A, 'X'), + (0x1133B, 'V'), + (0x11345, 'X'), + (0x11347, 'V'), + (0x11349, 'X'), + (0x1134B, 'V'), + (0x1134E, 'X'), + (0x11350, 'V'), + (0x11351, 'X'), + (0x11357, 'V'), + (0x11358, 'X'), + (0x1135D, 'V'), + (0x11364, 'X'), + (0x11366, 'V'), + (0x1136D, 'X'), + (0x11370, 'V'), + (0x11375, 'X'), + (0x11400, 'V'), + (0x1145A, 'X'), + (0x1145B, 'V'), + (0x1145C, 'X'), + (0x1145D, 'V'), + ] + +def _seg_56(): + return [ + (0x1145F, 'X'), + (0x11480, 'V'), + (0x114C8, 'X'), + (0x114D0, 'V'), + (0x114DA, 'X'), + (0x11580, 'V'), + (0x115B6, 'X'), + (0x115B8, 'V'), + (0x115DE, 'X'), + (0x11600, 'V'), + (0x11645, 'X'), + (0x11650, 'V'), + (0x1165A, 'X'), + (0x11660, 'V'), + (0x1166D, 'X'), (0x11680, 'V'), (0x116B8, 'X'), (0x116C0, 'V'), (0x116CA, 'X'), + (0x11700, 'V'), + (0x1171B, 'X'), + (0x1171D, 'V'), + (0x1172C, 'X'), + (0x11730, 'V'), + (0x11740, 'X'), + (0x11800, 'V'), + (0x1183C, 'X'), + (0x118A0, 'M', u'𑣀'), + (0x118A1, 'M', u'𑣁'), + (0x118A2, 'M', u'𑣂'), + (0x118A3, 'M', u'𑣃'), + (0x118A4, 'M', u'𑣄'), + (0x118A5, 'M', u'𑣅'), + (0x118A6, 'M', u'𑣆'), + (0x118A7, 'M', u'𑣇'), + (0x118A8, 'M', u'𑣈'), + (0x118A9, 'M', u'𑣉'), + (0x118AA, 'M', u'𑣊'), + (0x118AB, 'M', u'𑣋'), + (0x118AC, 'M', u'𑣌'), + (0x118AD, 'M', u'𑣍'), + (0x118AE, 'M', u'𑣎'), + (0x118AF, 'M', u'𑣏'), + (0x118B0, 'M', u'𑣐'), + (0x118B1, 'M', u'𑣑'), + (0x118B2, 'M', u'𑣒'), + (0x118B3, 'M', u'𑣓'), + (0x118B4, 'M', u'𑣔'), + (0x118B5, 'M', u'𑣕'), + (0x118B6, 'M', u'𑣖'), + (0x118B7, 'M', u'𑣗'), + (0x118B8, 'M', u'𑣘'), + (0x118B9, 'M', u'𑣙'), + (0x118BA, 'M', u'𑣚'), + (0x118BB, 'M', u'𑣛'), + (0x118BC, 'M', u'𑣜'), + (0x118BD, 'M', u'𑣝'), + (0x118BE, 'M', u'𑣞'), + (0x118BF, 'M', u'𑣟'), + (0x118C0, 'V'), + (0x118F3, 'X'), + (0x118FF, 'V'), + (0x11900, 'X'), + (0x11A00, 'V'), + (0x11A48, 'X'), + (0x11A50, 'V'), + (0x11A84, 'X'), + (0x11A86, 'V'), + (0x11AA3, 'X'), + (0x11AC0, 'V'), + (0x11AF9, 'X'), + (0x11C00, 'V'), + (0x11C09, 'X'), + (0x11C0A, 'V'), + (0x11C37, 'X'), + (0x11C38, 'V'), + (0x11C46, 'X'), + (0x11C50, 'V'), + (0x11C6D, 'X'), + (0x11C70, 'V'), + (0x11C90, 'X'), + (0x11C92, 'V'), + (0x11CA8, 'X'), + (0x11CA9, 'V'), + (0x11CB7, 'X'), + (0x11D00, 'V'), + (0x11D07, 'X'), + (0x11D08, 'V'), + (0x11D0A, 'X'), + (0x11D0B, 'V'), + (0x11D37, 'X'), + (0x11D3A, 'V'), + (0x11D3B, 'X'), + (0x11D3C, 'V'), + (0x11D3E, 'X'), + (0x11D3F, 'V'), + (0x11D48, 'X'), + (0x11D50, 'V'), + (0x11D5A, 'X'), + (0x11D60, 'V'), + ] + +def _seg_57(): + return [ + (0x11D66, 'X'), + (0x11D67, 'V'), + (0x11D69, 'X'), + (0x11D6A, 'V'), + (0x11D8F, 'X'), + (0x11D90, 'V'), + (0x11D92, 'X'), + (0x11D93, 'V'), + (0x11D99, 'X'), + (0x11DA0, 'V'), + (0x11DAA, 'X'), + (0x11EE0, 'V'), + (0x11EF9, 'X'), (0x12000, 'V'), - (0x1236F, 'X'), + (0x1239A, 'X'), (0x12400, 'V'), - (0x12463, 'X'), + (0x1246F, 'X'), (0x12470, 'V'), - (0x12474, 'X'), + (0x12475, 'X'), + (0x12480, 'V'), + (0x12544, 'X'), (0x13000, 'V'), (0x1342F, 'X'), - ] - -def _seg_53(): - return [ + (0x14400, 'V'), + (0x14647, 'X'), (0x16800, 'V'), (0x16A39, 'X'), + (0x16A40, 'V'), + (0x16A5F, 'X'), + (0x16A60, 'V'), + (0x16A6A, 'X'), + (0x16A6E, 'V'), + (0x16A70, 'X'), + (0x16AD0, 'V'), + (0x16AEE, 'X'), + (0x16AF0, 'V'), + (0x16AF6, 'X'), + (0x16B00, 'V'), + (0x16B46, 'X'), + (0x16B50, 'V'), + (0x16B5A, 'X'), + (0x16B5B, 'V'), + (0x16B62, 'X'), + (0x16B63, 'V'), + (0x16B78, 'X'), + (0x16B7D, 'V'), + (0x16B90, 'X'), + (0x16E60, 'V'), + (0x16E9B, 'X'), (0x16F00, 'V'), (0x16F45, 'X'), (0x16F50, 'V'), (0x16F7F, 'X'), (0x16F8F, 'V'), (0x16FA0, 'X'), + (0x16FE0, 'V'), + (0x16FE2, 'X'), + (0x17000, 'V'), + (0x187F2, 'X'), + (0x18800, 'V'), + (0x18AF3, 'X'), (0x1B000, 'V'), - (0x1B002, 'X'), + (0x1B11F, 'X'), + (0x1B170, 'V'), + (0x1B2FC, 'X'), + (0x1BC00, 'V'), + (0x1BC6B, 'X'), + (0x1BC70, 'V'), + (0x1BC7D, 'X'), + (0x1BC80, 'V'), + (0x1BC89, 'X'), + (0x1BC90, 'V'), + (0x1BC9A, 'X'), + (0x1BC9C, 'V'), + (0x1BCA0, 'I'), + (0x1BCA4, 'X'), (0x1D000, 'V'), (0x1D0F6, 'X'), (0x1D100, 'V'), @@ -5555,13 +6037,19 @@ def _seg_53(): (0x1D1BF, 'M', u'𝆹𝅥𝅯'), (0x1D1C0, 'M', u'𝆺𝅥𝅯'), (0x1D1C1, 'V'), - (0x1D1DE, 'X'), + (0x1D1E9, 'X'), (0x1D200, 'V'), + ] + +def _seg_58(): + return [ (0x1D246, 'X'), + (0x1D2E0, 'V'), + (0x1D2F4, 'X'), (0x1D300, 'V'), (0x1D357, 'X'), (0x1D360, 'V'), - (0x1D372, 'X'), + (0x1D379, 'X'), (0x1D400, 'M', u'a'), (0x1D401, 'M', u'b'), (0x1D402, 'M', u'c'), @@ -5623,10 +6111,6 @@ def _seg_53(): (0x1D43A, 'M', u'g'), (0x1D43B, 'M', u'h'), (0x1D43C, 'M', u'i'), - ] - -def _seg_54(): - return [ (0x1D43D, 'M', u'j'), (0x1D43E, 'M', u'k'), (0x1D43F, 'M', u'l'), @@ -5659,6 +6143,10 @@ def _seg_54(): (0x1D45A, 'M', u'm'), (0x1D45B, 'M', u'n'), (0x1D45C, 'M', u'o'), + ] + +def _seg_59(): + return [ (0x1D45D, 'M', u'p'), (0x1D45E, 'M', u'q'), (0x1D45F, 'M', u'r'), @@ -5727,10 +6215,6 @@ def _seg_54(): (0x1D49E, 'M', u'c'), (0x1D49F, 'M', u'd'), (0x1D4A0, 'X'), - ] - -def _seg_55(): - return [ (0x1D4A2, 'M', u'g'), (0x1D4A3, 'X'), (0x1D4A5, 'M', u'j'), @@ -5763,6 +6247,10 @@ def _seg_55(): (0x1D4C1, 'M', u'l'), (0x1D4C2, 'M', u'm'), (0x1D4C3, 'M', u'n'), + ] + +def _seg_60(): + return [ (0x1D4C4, 'X'), (0x1D4C5, 'M', u'p'), (0x1D4C6, 'M', u'q'), @@ -5831,10 +6319,6 @@ def _seg_55(): (0x1D505, 'M', u'b'), (0x1D506, 'X'), (0x1D507, 'M', u'd'), - ] - -def _seg_56(): - return [ (0x1D508, 'M', u'e'), (0x1D509, 'M', u'f'), (0x1D50A, 'M', u'g'), @@ -5867,6 +6351,10 @@ def _seg_56(): (0x1D526, 'M', u'i'), (0x1D527, 'M', u'j'), (0x1D528, 'M', u'k'), + ] + +def _seg_61(): + return [ (0x1D529, 'M', u'l'), (0x1D52A, 'M', u'm'), (0x1D52B, 'M', u'n'), @@ -5935,10 +6423,6 @@ def _seg_56(): (0x1D56C, 'M', u'a'), (0x1D56D, 'M', u'b'), (0x1D56E, 'M', u'c'), - ] - -def _seg_57(): - return [ (0x1D56F, 'M', u'd'), (0x1D570, 'M', u'e'), (0x1D571, 'M', u'f'), @@ -5971,6 +6455,10 @@ def _seg_57(): (0x1D58C, 'M', u'g'), (0x1D58D, 'M', u'h'), (0x1D58E, 'M', u'i'), + ] + +def _seg_62(): + return [ (0x1D58F, 'M', u'j'), (0x1D590, 'M', u'k'), (0x1D591, 'M', u'l'), @@ -6039,10 +6527,6 @@ def _seg_57(): (0x1D5D0, 'M', u'w'), (0x1D5D1, 'M', u'x'), (0x1D5D2, 'M', u'y'), - ] - -def _seg_58(): - return [ (0x1D5D3, 'M', u'z'), (0x1D5D4, 'M', u'a'), (0x1D5D5, 'M', u'b'), @@ -6075,6 +6559,10 @@ def _seg_58(): (0x1D5F0, 'M', u'c'), (0x1D5F1, 'M', u'd'), (0x1D5F2, 'M', u'e'), + ] + +def _seg_63(): + return [ (0x1D5F3, 'M', u'f'), (0x1D5F4, 'M', u'g'), (0x1D5F5, 'M', u'h'), @@ -6143,10 +6631,6 @@ def _seg_58(): (0x1D634, 'M', u's'), (0x1D635, 'M', u't'), (0x1D636, 'M', u'u'), - ] - -def _seg_59(): - return [ (0x1D637, 'M', u'v'), (0x1D638, 'M', u'w'), (0x1D639, 'M', u'x'), @@ -6179,6 +6663,10 @@ def _seg_59(): (0x1D654, 'M', u'y'), (0x1D655, 'M', u'z'), (0x1D656, 'M', u'a'), + ] + +def _seg_64(): + return [ (0x1D657, 'M', u'b'), (0x1D658, 'M', u'c'), (0x1D659, 'M', u'd'), @@ -6247,10 +6735,6 @@ def _seg_59(): (0x1D698, 'M', u'o'), (0x1D699, 'M', u'p'), (0x1D69A, 'M', u'q'), - ] - -def _seg_60(): - return [ (0x1D69B, 'M', u'r'), (0x1D69C, 'M', u's'), (0x1D69D, 'M', u't'), @@ -6283,6 +6767,10 @@ def _seg_60(): (0x1D6B9, 'M', u'θ'), (0x1D6BA, 'M', u'σ'), (0x1D6BB, 'M', u'τ'), + ] + +def _seg_65(): + return [ (0x1D6BC, 'M', u'υ'), (0x1D6BD, 'M', u'φ'), (0x1D6BE, 'M', u'χ'), @@ -6351,10 +6839,6 @@ def _seg_60(): (0x1D6FE, 'M', u'γ'), (0x1D6FF, 'M', u'δ'), (0x1D700, 'M', u'ε'), - ] - -def _seg_61(): - return [ (0x1D701, 'M', u'ζ'), (0x1D702, 'M', u'η'), (0x1D703, 'M', u'θ'), @@ -6387,6 +6871,10 @@ def _seg_61(): (0x1D71F, 'M', u'δ'), (0x1D720, 'M', u'ε'), (0x1D721, 'M', u'ζ'), + ] + +def _seg_66(): + return [ (0x1D722, 'M', u'η'), (0x1D723, 'M', u'θ'), (0x1D724, 'M', u'ι'), @@ -6455,10 +6943,6 @@ def _seg_61(): (0x1D764, 'M', u'ο'), (0x1D765, 'M', u'π'), (0x1D766, 'M', u'ρ'), - ] - -def _seg_62(): - return [ (0x1D767, 'M', u'θ'), (0x1D768, 'M', u'σ'), (0x1D769, 'M', u'τ'), @@ -6491,6 +6975,10 @@ def _seg_62(): (0x1D785, 'M', u'φ'), (0x1D786, 'M', u'χ'), (0x1D787, 'M', u'ψ'), + ] + +def _seg_67(): + return [ (0x1D788, 'M', u'ω'), (0x1D789, 'M', u'∂'), (0x1D78A, 'M', u'ε'), @@ -6559,10 +7047,6 @@ def _seg_62(): (0x1D7CA, 'M', u'ϝ'), (0x1D7CC, 'X'), (0x1D7CE, 'M', u'0'), - ] - -def _seg_63(): - return [ (0x1D7CF, 'M', u'1'), (0x1D7D0, 'M', u'2'), (0x1D7D1, 'M', u'3'), @@ -6595,6 +7079,10 @@ def _seg_63(): (0x1D7EC, 'M', u'0'), (0x1D7ED, 'M', u'1'), (0x1D7EE, 'M', u'2'), + ] + +def _seg_68(): + return [ (0x1D7EF, 'M', u'3'), (0x1D7F0, 'M', u'4'), (0x1D7F1, 'M', u'5'), @@ -6612,7 +7100,68 @@ def _seg_63(): (0x1D7FD, 'M', u'7'), (0x1D7FE, 'M', u'8'), (0x1D7FF, 'M', u'9'), - (0x1D800, 'X'), + (0x1D800, 'V'), + (0x1DA8C, 'X'), + (0x1DA9B, 'V'), + (0x1DAA0, 'X'), + (0x1DAA1, 'V'), + (0x1DAB0, 'X'), + (0x1E000, 'V'), + (0x1E007, 'X'), + (0x1E008, 'V'), + (0x1E019, 'X'), + (0x1E01B, 'V'), + (0x1E022, 'X'), + (0x1E023, 'V'), + (0x1E025, 'X'), + (0x1E026, 'V'), + (0x1E02B, 'X'), + (0x1E800, 'V'), + (0x1E8C5, 'X'), + (0x1E8C7, 'V'), + (0x1E8D7, 'X'), + (0x1E900, 'M', u'𞤢'), + (0x1E901, 'M', u'𞤣'), + (0x1E902, 'M', u'𞤤'), + (0x1E903, 'M', u'𞤥'), + (0x1E904, 'M', u'𞤦'), + (0x1E905, 'M', u'𞤧'), + (0x1E906, 'M', u'𞤨'), + (0x1E907, 'M', u'𞤩'), + (0x1E908, 'M', u'𞤪'), + (0x1E909, 'M', u'𞤫'), + (0x1E90A, 'M', u'𞤬'), + (0x1E90B, 'M', u'𞤭'), + (0x1E90C, 'M', u'𞤮'), + (0x1E90D, 'M', u'𞤯'), + (0x1E90E, 'M', u'𞤰'), + (0x1E90F, 'M', u'𞤱'), + (0x1E910, 'M', u'𞤲'), + (0x1E911, 'M', u'𞤳'), + (0x1E912, 'M', u'𞤴'), + (0x1E913, 'M', u'𞤵'), + (0x1E914, 'M', u'𞤶'), + (0x1E915, 'M', u'𞤷'), + (0x1E916, 'M', u'𞤸'), + (0x1E917, 'M', u'𞤹'), + (0x1E918, 'M', u'𞤺'), + (0x1E919, 'M', u'𞤻'), + (0x1E91A, 'M', u'𞤼'), + (0x1E91B, 'M', u'𞤽'), + (0x1E91C, 'M', u'𞤾'), + (0x1E91D, 'M', u'𞤿'), + (0x1E91E, 'M', u'𞥀'), + (0x1E91F, 'M', u'𞥁'), + (0x1E920, 'M', u'𞥂'), + (0x1E921, 'M', u'𞥃'), + (0x1E922, 'V'), + (0x1E94B, 'X'), + (0x1E950, 'V'), + (0x1E95A, 'X'), + (0x1E95E, 'V'), + (0x1E960, 'X'), + (0x1EC71, 'V'), + (0x1ECB5, 'X'), (0x1EE00, 'M', u'ا'), (0x1EE01, 'M', u'ب'), (0x1EE02, 'M', u'ج'), @@ -6634,6 +7183,10 @@ def _seg_63(): (0x1EE12, 'M', u'ق'), (0x1EE13, 'M', u'ر'), (0x1EE14, 'M', u'ش'), + ] + +def _seg_69(): + return [ (0x1EE15, 'M', u'ت'), (0x1EE16, 'M', u'ث'), (0x1EE17, 'M', u'خ'), @@ -6663,10 +7216,6 @@ def _seg_63(): (0x1EE30, 'M', u'ف'), (0x1EE31, 'M', u'ص'), (0x1EE32, 'M', u'ق'), - ] - -def _seg_64(): - return [ (0x1EE33, 'X'), (0x1EE34, 'M', u'ش'), (0x1EE35, 'M', u'ت'), @@ -6738,6 +7287,10 @@ def _seg_64(): (0x1EE81, 'M', u'ب'), (0x1EE82, 'M', u'ج'), (0x1EE83, 'M', u'د'), + ] + +def _seg_70(): + return [ (0x1EE84, 'M', u'ه'), (0x1EE85, 'M', u'و'), (0x1EE86, 'M', u'ز'), @@ -6767,10 +7320,6 @@ def _seg_64(): (0x1EEA2, 'M', u'ج'), (0x1EEA3, 'M', u'د'), (0x1EEA4, 'X'), - ] - -def _seg_65(): - return [ (0x1EEA5, 'M', u'و'), (0x1EEA6, 'M', u'ز'), (0x1EEA7, 'M', u'ح'), @@ -6804,11 +7353,11 @@ def _seg_65(): (0x1F0A0, 'V'), (0x1F0AF, 'X'), (0x1F0B1, 'V'), - (0x1F0BF, 'X'), + (0x1F0C0, 'X'), (0x1F0C1, 'V'), (0x1F0D0, 'X'), (0x1F0D1, 'V'), - (0x1F0E0, 'X'), + (0x1F0F6, 'X'), (0x1F101, '3', u'0,'), (0x1F102, '3', u'1,'), (0x1F103, '3', u'2,'), @@ -6819,7 +7368,8 @@ def _seg_65(): (0x1F108, '3', u'7,'), (0x1F109, '3', u'8,'), (0x1F10A, '3', u'9,'), - (0x1F10B, 'X'), + (0x1F10B, 'V'), + (0x1F10D, 'X'), (0x1F110, '3', u'(a)'), (0x1F111, '3', u'(b)'), (0x1F112, '3', u'(c)'), @@ -6841,6 +7391,10 @@ def _seg_65(): (0x1F122, '3', u'(s)'), (0x1F123, '3', u'(t)'), (0x1F124, '3', u'(u)'), + ] + +def _seg_71(): + return [ (0x1F125, '3', u'(v)'), (0x1F126, '3', u'(w)'), (0x1F127, '3', u'(x)'), @@ -6851,7 +7405,7 @@ def _seg_65(): (0x1F12C, 'M', u'r'), (0x1F12D, 'M', u'cd'), (0x1F12E, 'M', u'wz'), - (0x1F12F, 'X'), + (0x1F12F, 'V'), (0x1F130, 'M', u'a'), (0x1F131, 'M', u'b'), (0x1F132, 'M', u'c'), @@ -6871,10 +7425,6 @@ def _seg_65(): (0x1F140, 'M', u'q'), (0x1F141, 'M', u'r'), (0x1F142, 'M', u's'), - ] - -def _seg_66(): - return [ (0x1F143, 'M', u't'), (0x1F144, 'M', u'u'), (0x1F145, 'M', u'v'), @@ -6895,7 +7445,7 @@ def _seg_66(): (0x1F170, 'V'), (0x1F190, 'M', u'dj'), (0x1F191, 'V'), - (0x1F19B, 'X'), + (0x1F1AD, 'X'), (0x1F1E6, 'V'), (0x1F200, 'M', u'ほか'), (0x1F201, 'M', u'ココ'), @@ -6944,7 +7494,12 @@ def _seg_66(): (0x1F238, 'M', u'申'), (0x1F239, 'M', u'割'), (0x1F23A, 'M', u'営'), - (0x1F23B, 'X'), + (0x1F23B, 'M', u'配'), + ] + +def _seg_72(): + return [ + (0x1F23C, 'X'), (0x1F240, 'M', u'〔本〕'), (0x1F241, 'M', u'〔三〕'), (0x1F242, 'M', u'〔二〕'), @@ -6958,52 +7513,58 @@ def _seg_66(): (0x1F250, 'M', u'得'), (0x1F251, 'M', u'可'), (0x1F252, 'X'), + (0x1F260, 'V'), + (0x1F266, 'X'), (0x1F300, 'V'), - (0x1F321, 'X'), - (0x1F330, 'V'), - (0x1F336, 'X'), - (0x1F337, 'V'), - (0x1F37D, 'X'), - (0x1F380, 'V'), - (0x1F394, 'X'), - (0x1F3A0, 'V'), - (0x1F3C5, 'X'), - (0x1F3C6, 'V'), - (0x1F3CB, 'X'), - (0x1F3E0, 'V'), - (0x1F3F1, 'X'), - (0x1F400, 'V'), - (0x1F43F, 'X'), - (0x1F440, 'V'), - ] - -def _seg_67(): - return [ - (0x1F441, 'X'), - (0x1F442, 'V'), - (0x1F4F8, 'X'), - (0x1F4F9, 'V'), - (0x1F4FD, 'X'), - (0x1F500, 'V'), - (0x1F53E, 'X'), - (0x1F540, 'V'), - (0x1F544, 'X'), - (0x1F550, 'V'), - (0x1F568, 'X'), - (0x1F5FB, 'V'), - (0x1F641, 'X'), - (0x1F645, 'V'), - (0x1F650, 'X'), - (0x1F680, 'V'), - (0x1F6C6, 'X'), + (0x1F6D5, 'X'), + (0x1F6E0, 'V'), + (0x1F6ED, 'X'), + (0x1F6F0, 'V'), + (0x1F6FA, 'X'), (0x1F700, 'V'), (0x1F774, 'X'), + (0x1F780, 'V'), + (0x1F7D9, 'X'), + (0x1F800, 'V'), + (0x1F80C, 'X'), + (0x1F810, 'V'), + (0x1F848, 'X'), + (0x1F850, 'V'), + (0x1F85A, 'X'), + (0x1F860, 'V'), + (0x1F888, 'X'), + (0x1F890, 'V'), + (0x1F8AE, 'X'), + (0x1F900, 'V'), + (0x1F90C, 'X'), + (0x1F910, 'V'), + (0x1F93F, 'X'), + (0x1F940, 'V'), + (0x1F971, 'X'), + (0x1F973, 'V'), + (0x1F977, 'X'), + (0x1F97A, 'V'), + (0x1F97B, 'X'), + (0x1F97C, 'V'), + (0x1F9A3, 'X'), + (0x1F9B0, 'V'), + (0x1F9BA, 'X'), + (0x1F9C0, 'V'), + (0x1F9C3, 'X'), + (0x1F9D0, 'V'), + (0x1FA00, 'X'), + (0x1FA60, 'V'), + (0x1FA6E, 'X'), (0x20000, 'V'), (0x2A6D7, 'X'), (0x2A700, 'V'), (0x2B735, 'X'), (0x2B740, 'V'), (0x2B81E, 'X'), + (0x2B820, 'V'), + (0x2CEA2, 'X'), + (0x2CEB0, 'V'), + (0x2EBE1, 'X'), (0x2F800, 'M', u'丽'), (0x2F801, 'M', u'丸'), (0x2F802, 'M', u'乁'), @@ -7038,6 +7599,10 @@ def _seg_67(): (0x2F81F, 'M', u'㓟'), (0x2F820, 'M', u'刻'), (0x2F821, 'M', u'剆'), + ] + +def _seg_73(): + return [ (0x2F822, 'M', u'割'), (0x2F823, 'M', u'剷'), (0x2F824, 'M', u'㔕'), @@ -7079,10 +7644,6 @@ def _seg_67(): (0x2F84B, 'M', u'圖'), (0x2F84C, 'M', u'嘆'), (0x2F84D, 'M', u'圗'), - ] - -def _seg_68(): - return [ (0x2F84E, 'M', u'噑'), (0x2F84F, 'M', u'噴'), (0x2F850, 'M', u'切'), @@ -7142,6 +7703,10 @@ def _seg_68(): (0x2F887, 'M', u'幩'), (0x2F888, 'M', u'㡢'), (0x2F889, 'M', u'𢆃'), + ] + +def _seg_74(): + return [ (0x2F88A, 'M', u'㡼'), (0x2F88B, 'M', u'庰'), (0x2F88C, 'M', u'庳'), @@ -7183,10 +7748,6 @@ def _seg_68(): (0x2F8B2, 'M', u'成'), (0x2F8B3, 'M', u'戛'), (0x2F8B4, 'M', u'扝'), - ] - -def _seg_69(): - return [ (0x2F8B5, 'M', u'抱'), (0x2F8B6, 'M', u'拔'), (0x2F8B7, 'M', u'捐'), @@ -7246,6 +7807,10 @@ def _seg_69(): (0x2F8ED, 'M', u'櫛'), (0x2F8EE, 'M', u'㰘'), (0x2F8EF, 'M', u'次'), + ] + +def _seg_75(): + return [ (0x2F8F0, 'M', u'𣢧'), (0x2F8F1, 'M', u'歔'), (0x2F8F2, 'M', u'㱎'), @@ -7287,10 +7852,6 @@ def _seg_69(): (0x2F916, 'M', u'㶖'), (0x2F917, 'M', u'灊'), (0x2F918, 'M', u'災'), - ] - -def _seg_70(): - return [ (0x2F919, 'M', u'灷'), (0x2F91A, 'M', u'炭'), (0x2F91B, 'M', u'𠔥'), @@ -7350,6 +7911,10 @@ def _seg_70(): (0x2F953, 'M', u'祖'), (0x2F954, 'M', u'𥚚'), (0x2F955, 'M', u'𥛅'), + ] + +def _seg_76(): + return [ (0x2F956, 'M', u'福'), (0x2F957, 'M', u'秫'), (0x2F958, 'M', u'䄯'), @@ -7391,10 +7956,6 @@ def _seg_70(): (0x2F97D, 'M', u'聠'), (0x2F97E, 'M', u'𦖨'), (0x2F97F, 'M', u'聰'), - ] - -def _seg_71(): - return [ (0x2F980, 'M', u'𣍟'), (0x2F981, 'M', u'䏕'), (0x2F982, 'M', u'育'), @@ -7454,6 +8015,10 @@ def _seg_71(): (0x2F9B8, 'M', u'蚈'), (0x2F9B9, 'M', u'蜎'), (0x2F9BA, 'M', u'蛢'), + ] + +def _seg_77(): + return [ (0x2F9BB, 'M', u'蝹'), (0x2F9BC, 'M', u'蜨'), (0x2F9BD, 'M', u'蝫'), @@ -7495,10 +8060,6 @@ def _seg_71(): (0x2F9E1, 'M', u'𨗭'), (0x2F9E2, 'M', u'邔'), (0x2F9E3, 'M', u'郱'), - ] - -def _seg_72(): - return [ (0x2F9E4, 'M', u'鄑'), (0x2F9E5, 'M', u'𨜮'), (0x2F9E6, 'M', u'鄛'), @@ -7558,6 +8119,10 @@ def _seg_72(): (0x2FA1D, 'M', u'𪘀'), (0x2FA1E, 'X'), (0xE0100, 'I'), + ] + +def _seg_78(): + return [ (0xE01F0, 'X'), ] @@ -7635,4 +8200,10 @@ def _seg_72(): + _seg_70() + _seg_71() + _seg_72() + + _seg_73() + + _seg_74() + + _seg_75() + + _seg_76() + + _seg_77() + + _seg_78() ) diff --git a/src/oci/_vendor/jwt/__init__.py b/src/oci/_vendor/jwt/__init__.py index 52f6b434e3..a8155f893f 100644 --- a/src/oci/_vendor/jwt/__init__.py +++ b/src/oci/_vendor/jwt/__init__.py @@ -14,10 +14,10 @@ __title__ = 'pyjwt' -__version__ = '1.5.3' +__version__ = '1.7.1' __author__ = 'José Padilla' __license__ = 'MIT' -__copyright__ = 'Copyright 2015 José Padilla' +__copyright__ = 'Copyright 2015-2018 José Padilla' from .api_jwt import ( @@ -29,5 +29,7 @@ InvalidTokenError, DecodeError, InvalidAlgorithmError, InvalidAudienceError, ExpiredSignatureError, ImmatureSignatureError, InvalidIssuedAtError, InvalidIssuerError, ExpiredSignature, - InvalidAudience, InvalidIssuer, MissingRequiredClaimError + InvalidAudience, InvalidIssuer, MissingRequiredClaimError, + InvalidSignatureError, + PyJWTError, ) diff --git a/src/oci/_vendor/jwt/__main__.py b/src/oci/_vendor/jwt/__main__.py index 0bf718332a..1cb2087184 100644 --- a/src/oci/_vendor/jwt/__main__.py +++ b/src/oci/_vendor/jwt/__main__.py @@ -58,10 +58,13 @@ def encode_payload(args): def decode_payload(args): try: - if sys.stdin.isatty(): - token = sys.stdin.read() - else: + if args.token: token = args.token + else: + if sys.stdin.isatty(): + token = sys.stdin.readline().strip() + else: + raise IOError('Cannot read from stdin: terminal not a TTY') token = token.encode('utf-8') data = decode(token, key=args.key, verify=args.verify) @@ -137,7 +140,10 @@ def build_argparser(): # Decode subcommand decode_parser = subparsers.add_parser('decode', help='use to decode a supplied JSON web token') - decode_parser.add_argument('token', help='JSON web token to decode.') + decode_parser.add_argument( + 'token', + help='JSON web token to decode.', + nargs='?') decode_parser.add_argument( '-n', '--no-verify', diff --git a/src/oci/_vendor/jwt/api_jws.py b/src/oci/_vendor/jwt/api_jws.py index 69fb62d6ce..68b0739c60 100644 --- a/src/oci/_vendor/jwt/api_jws.py +++ b/src/oci/_vendor/jwt/api_jws.py @@ -5,14 +5,20 @@ import binascii import json import warnings - -from collections import Mapping +try: + # import required by mypy to perform type checking, not used for normal execution + from typing import Callable, Dict, List, Optional, Union # NOQA +except ImportError: + pass from .algorithms import ( Algorithm, get_default_algorithms, has_crypto, requires_cryptography # NOQA ) -from .compat import binary_type, string_types, text_type -from .exceptions import DecodeError, InvalidAlgorithmError, InvalidTokenError +from .compat import Mapping, binary_type, string_types, text_type +from .exceptions import ( + DecodeError, InvalidAlgorithmError, InvalidSignatureError, + InvalidTokenError +) from .utils import base64url_decode, base64url_encode, force_bytes, merge_dict @@ -71,8 +77,13 @@ def get_algorithms(self): """ return list(self._valid_algs) - def encode(self, payload, key, algorithm='HS256', headers=None, - json_encoder=None): + def encode(self, + payload, # type: Union[Dict, bytes] + key, # type: str + algorithm='HS256', # type: str + headers=None, # type: Optional[Dict] + json_encoder=None # type: Optional[Callable] + ): segments = [] if algorithm is None: @@ -119,7 +130,12 @@ def encode(self, payload, key, algorithm='HS256', headers=None, return b'.'.join(segments) - def decode(self, jws, key='', verify=True, algorithms=None, options=None, + def decode(self, + jwt, # type: str + key='', # type: str + verify=True, # type: bool + algorithms=None, # type: List[str] + options=None, # type: Dict **kwargs): merged_options = merge_dict(self.options, options) @@ -133,7 +149,7 @@ def decode(self, jws, key='', verify=True, algorithms=None, options=None, DeprecationWarning ) - payload, signing_input, header, signature = self._load(jws) + payload, signing_input, header, signature = self._load(jwt) if not verify: warnings.warn('The verify parameter is deprecated. ' @@ -208,7 +224,7 @@ def _verify_signature(self, payload, signing_input, header, signature, key = alg_obj.prepare_key(key) if not alg_obj.verify(signing_input, key, signature): - raise DecodeError('Signature verification failed') + raise InvalidSignatureError('Signature verification failed') except KeyError: raise InvalidAlgorithmError('Algorithm not supported') diff --git a/src/oci/_vendor/jwt/api_jwt.py b/src/oci/_vendor/jwt/api_jwt.py index 6939b066fe..c73d39ff2d 100644 --- a/src/oci/_vendor/jwt/api_jwt.py +++ b/src/oci/_vendor/jwt/api_jwt.py @@ -4,14 +4,17 @@ import json import warnings - from calendar import timegm -from collections import Mapping from datetime import datetime, timedelta +try: + # import required by mypy to perform type checking, not used for normal execution + from typing import Callable, Dict, List, Optional, Union # NOQA +except ImportError: + pass from .api_jws import PyJWS from .algorithms import Algorithm, get_default_algorithms # NOQA -from .compat import string_types, timedelta_total_seconds +from .compat import Iterable, Mapping, string_types from .exceptions import ( DecodeError, ExpiredSignatureError, ImmatureSignatureError, InvalidAudienceError, InvalidIssuedAtError, @@ -25,6 +28,7 @@ class PyJWT(PyJWS): @staticmethod def _get_default_options(): + # type: () -> Dict[str, bool] return { 'verify_signature': True, 'verify_exp': True, @@ -37,8 +41,13 @@ def _get_default_options(): 'require_nbf': False } - def encode(self, payload, key, algorithm='HS256', headers=None, - json_encoder=None): + def encode(self, + payload, # type: Union[Dict, bytes] + key, # type: str + algorithm='HS256', # type: str + headers=None, # type: Optional[Dict] + json_encoder=None # type: Optional[Callable] + ): # Check that we get a mapping if not isinstance(payload, Mapping): raise TypeError('Expecting a mapping object, as JWT only supports ' @@ -48,7 +57,7 @@ def encode(self, payload, key, algorithm='HS256', headers=None, for time_claim in ['exp', 'iat', 'nbf']: # Convert datetime to a intDate value in known time-format claims if isinstance(payload.get(time_claim), datetime): - payload[time_claim] = timegm(payload[time_claim].utctimetuple()) + payload[time_claim] = timegm(payload[time_claim].utctimetuple()) # type: ignore json_payload = json.dumps( payload, @@ -60,7 +69,12 @@ def encode(self, payload, key, algorithm='HS256', headers=None, json_payload, key, algorithm, headers, json_encoder ) - def decode(self, jwt, key='', verify=True, algorithms=None, options=None, + def decode(self, + jwt, # type: str + key='', # type: str + verify=True, # type: bool + algorithms=None, # type: List[str] + options=None, # type: Dict **kwargs): if verify and not algorithms: @@ -71,7 +85,7 @@ def decode(self, jwt, key='', verify=True, algorithms=None, options=None, DeprecationWarning ) - payload, signing_input, header, signature = self._load(jwt) + payload, _, _, _ = self._load(jwt) if options is None: options = {'verify_signature': verify} @@ -105,10 +119,10 @@ def _validate_claims(self, payload, options, audience=None, issuer=None, DeprecationWarning) if isinstance(leeway, timedelta): - leeway = timedelta_total_seconds(leeway) + leeway = leeway.total_seconds() - if not isinstance(audience, (string_types, type(None))): - raise TypeError('audience must be a string or None') + if not isinstance(audience, (string_types, type(None), Iterable)): + raise TypeError('audience must be a string, iterable, or None') self._validate_required_claims(payload, options) @@ -173,6 +187,11 @@ def _validate_aud(self, payload, audience): # verified since the token does not contain a claim. raise MissingRequiredClaimError('aud') + if audience is None and 'aud' in payload: + # Application did not specify an audience, but + # the token has the 'aud' claim + raise InvalidAudienceError('Invalid audience') + audience_claims = payload['aud'] if isinstance(audience_claims, string_types): @@ -181,7 +200,11 @@ def _validate_aud(self, payload, audience): raise InvalidAudienceError('Invalid claim format in token') if any(not isinstance(c, string_types) for c in audience_claims): raise InvalidAudienceError('Invalid claim format in token') - if audience not in audience_claims: + + if isinstance(audience, string_types): + audience = [audience] + + if not any(aud in audience_claims for aud in audience): raise InvalidAudienceError('Invalid audience') def _validate_iss(self, payload, issuer): diff --git a/src/oci/_vendor/jwt/compat.py b/src/oci/_vendor/jwt/compat.py index dd38bcfe7c..6f1a2b24a8 100644 --- a/src/oci/_vendor/jwt/compat.py +++ b/src/oci/_vendor/jwt/compat.py @@ -24,19 +24,11 @@ string_types = (text_type, binary_type) - -def timedelta_total_seconds(delta): - try: - delta.total_seconds - except AttributeError: - # On Python 2.6, timedelta instances do not have - # a .total_seconds() method. - total_seconds = delta.days * 24 * 60 * 60 + delta.seconds - else: - total_seconds = delta.total_seconds() - - return total_seconds - +try: + # Importing ABCs from collections will be removed in PY3.8 + from collections.abc import Iterable, Mapping +except ImportError: + from collections import Iterable, Mapping try: constant_time_compare = hmac.compare_digest diff --git a/src/oci/_vendor/jwt/contrib/algorithms/py_ecdsa.py b/src/oci/_vendor/jwt/contrib/algorithms/py_ecdsa.py index 95f967e293..66d11af255 100644 --- a/src/oci/_vendor/jwt/contrib/algorithms/py_ecdsa.py +++ b/src/oci/_vendor/jwt/contrib/algorithms/py_ecdsa.py @@ -5,8 +5,8 @@ import ecdsa -from ....jwt.algorithms import Algorithm -from ....jwt.compat import string_types, text_type +from oci._vendor.jwt.algorithms import Algorithm +from oci._vendor.jwt.compat import string_types, text_type class ECAlgorithm(Algorithm): diff --git a/src/oci/_vendor/jwt/contrib/algorithms/pycrypto.py b/src/oci/_vendor/jwt/contrib/algorithms/pycrypto.py index e47255a5ce..7815243b62 100644 --- a/src/oci/_vendor/jwt/contrib/algorithms/pycrypto.py +++ b/src/oci/_vendor/jwt/contrib/algorithms/pycrypto.py @@ -1,12 +1,11 @@ import Crypto.Hash.SHA256 import Crypto.Hash.SHA384 import Crypto.Hash.SHA512 - from Crypto.PublicKey import RSA from Crypto.Signature import PKCS1_v1_5 -from ....jwt.algorithms import Algorithm -from ....jwt.compat import string_types, text_type +from oci._vendor.jwt.algorithms import Algorithm +from oci._vendor.jwt.compat import string_types, text_type class RSAAlgorithm(Algorithm): diff --git a/src/oci/_vendor/jwt/exceptions.py b/src/oci/_vendor/jwt/exceptions.py index c52028a4d0..a3a61406ae 100644 --- a/src/oci/_vendor/jwt/exceptions.py +++ b/src/oci/_vendor/jwt/exceptions.py @@ -2,7 +2,14 @@ # Modified Work: Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. # Original Work: Copyright (c) 2015 José Padilla -class InvalidTokenError(Exception): +class PyJWTError(Exception): + """ + Base class for all exceptions + """ + pass + + +class InvalidTokenError(PyJWTError): pass @@ -10,6 +17,10 @@ class DecodeError(InvalidTokenError): pass +class InvalidSignatureError(DecodeError): + pass + + class ExpiredSignatureError(InvalidTokenError): pass @@ -30,7 +41,7 @@ class ImmatureSignatureError(InvalidTokenError): pass -class InvalidKeyError(Exception): +class InvalidKeyError(PyJWTError): pass diff --git a/src/oci/_vendor/jwt/help.py b/src/oci/_vendor/jwt/help.py new file mode 100644 index 0000000000..b1181bd1e7 --- /dev/null +++ b/src/oci/_vendor/jwt/help.py @@ -0,0 +1,65 @@ +# coding: utf-8 +# Modified Work: Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. +# Original Work: Copyright (c) 2015 José Padilla + +from __future__ import print_function + +import json +import platform +import sys + +from . import __version__ as pyjwt_version + +try: + import cryptography +except ImportError: + cryptography = None + +try: + import ecdsa +except ImportError: + ecdsa = None + + +def info(): + """ + Generate information for a bug report. + Based on the requests package help utility module. + """ + try: + platform_info = {"system": platform.system(), "release": platform.release()} + except IOError: + platform_info = {"system": "Unknown", "release": "Unknown"} + + implementation = platform.python_implementation() + + if implementation == "CPython": + implementation_version = platform.python_version() + elif implementation == "PyPy": + implementation_version = "%s.%s.%s" % ( + sys.pypy_version_info.major, + sys.pypy_version_info.minor, + sys.pypy_version_info.micro, + ) + if sys.pypy_version_info.releaselevel != "final": + implementation_version = "".join( + [implementation_version, sys.pypy_version_info.releaselevel] + ) + else: + implementation_version = "Unknown" + + return { + "platform": platform_info, + "implementation": {"name": implementation, "version": implementation_version}, + "cryptography": {"version": getattr(cryptography, "__version__", "")}, + "pyjwt": {"version": pyjwt_version}, + } + + +def main(): + """Pretty-print the bug information as JSON.""" + print(json.dumps(info(), sort_keys=True, indent=2)) + + +if __name__ == "__main__": + main() diff --git a/src/oci/_vendor/requests/__init__.py b/src/oci/_vendor/requests/__init__.py index 4edbfd32ce..c1a3d79f07 100644 --- a/src/oci/_vendor/requests/__init__.py +++ b/src/oci/_vendor/requests/__init__.py @@ -26,7 +26,7 @@ ... or POST: >>> payload = dict(key1='value1', key2='value2') - >>> r = requests.post('http://httpbin.org/post', data=payload) + >>> r = requests.post('https://httpbin.org/post', data=payload) >>> print(r.text) { ... @@ -61,10 +61,10 @@ def check_compatibility(urllib3_version, chardet_version): # Check urllib3 for compatibility. major, minor, patch = urllib3_version # noqa: F811 major, minor, patch = int(major), int(minor), int(patch) - # urllib3 >= 1.21.1, <= 1.22 + # urllib3 >= 1.21.1, <= 1.24 assert major == 1 assert minor >= 21 - assert minor <= 22 + assert minor <= 24 # Check chardet for compatibility. major, minor, patch = chardet_version.split('.')[:3] @@ -75,11 +75,22 @@ def check_compatibility(urllib3_version, chardet_version): assert patch >= 2 +def _check_cryptography(cryptography_version): + # cryptography < 1.3.4 + try: + cryptography_version = list(map(int, cryptography_version.split('.'))) + except ValueError: + return + + if cryptography_version < [1, 3, 4]: + warning = 'Old version of cryptography ({}) may cause slowdown.'.format(cryptography_version) + warnings.warn(warning, RequestsDependencyWarning) + # Check imported dependencies for compatibility. try: check_compatibility(urllib3.__version__, chardet.__version__) except (AssertionError, ValueError): - warnings.warn("urllib3 ({0}) or chardet ({1}) doesn't match a supported " + warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported " "version!".format(urllib3.__version__, chardet.__version__), RequestsDependencyWarning) @@ -87,6 +98,10 @@ def check_compatibility(urllib3_version, chardet_version): try: from oci._vendor.urllib3.contrib import pyopenssl pyopenssl.inject_into_urllib3() + + # Check cryptography version + from cryptography import __version__ as cryptography_version + _check_cryptography(cryptography_version) except ImportError: pass @@ -112,12 +127,7 @@ def check_compatibility(urllib3_version, chardet_version): # Set default logging handler to avoid "No handler found" warnings. import logging -try: # Python 2.7+ - from logging import NullHandler -except ImportError: - class NullHandler(logging.Handler): - def emit(self, record): - pass +from logging import NullHandler logging.getLogger(__name__).addHandler(NullHandler()) diff --git a/src/oci/_vendor/requests/__version__.py b/src/oci/_vendor/requests/__version__.py index 5c157caa7d..d0de8c353b 100644 --- a/src/oci/_vendor/requests/__version__.py +++ b/src/oci/_vendor/requests/__version__.py @@ -9,10 +9,10 @@ __title__ = 'requests' __description__ = 'Python HTTP for Humans.' __url__ = 'http://python-requests.org' -__version__ = '2.18.4' -__build__ = 0x021804 +__version__ = '2.21.0' +__build__ = 0x022100 __author__ = 'Kenneth Reitz' __author_email__ = 'me@kennethreitz.org' __license__ = 'Apache 2.0' -__copyright__ = 'Copyright 2017 Kenneth Reitz' +__copyright__ = 'Copyright 2018 Kenneth Reitz' __cake__ = u'\u2728 \U0001f370 \u2728' diff --git a/src/oci/_vendor/requests/adapters.py b/src/oci/_vendor/requests/adapters.py index 2cceb169d4..43b9eeb80b 100644 --- a/src/oci/_vendor/requests/adapters.py +++ b/src/oci/_vendor/requests/adapters.py @@ -17,6 +17,7 @@ from oci._vendor.urllib3.poolmanager import PoolManager, proxy_from_url from oci._vendor.urllib3.response import HTTPResponse +from oci._vendor.urllib3.util import parse_url from oci._vendor.urllib3.util import Timeout as TimeoutSauce from oci._vendor.urllib3.util.retry import Retry from oci._vendor.urllib3.exceptions import ClosedPoolError @@ -29,16 +30,18 @@ from oci._vendor.urllib3.exceptions import ReadTimeoutError from oci._vendor.urllib3.exceptions import SSLError as _SSLError from oci._vendor.urllib3.exceptions import ResponseError +from oci._vendor.urllib3.exceptions import LocationValueError from .models import Response from .compat import urlparse, basestring -from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers, - prepend_scheme_if_needed, get_auth_from_url, urldefragauth, - select_proxy) +from .utils import (DEFAULT_CA_BUNDLE_PATH, extract_zipped_paths, + get_encoding_from_headers, prepend_scheme_if_needed, + get_auth_from_url, urldefragauth, select_proxy) from .structures import CaseInsensitiveDict from .cookies import extract_cookies_to_jar from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError, - ProxyError, RetryError, InvalidSchema) + ProxyError, RetryError, InvalidSchema, InvalidProxyURL, + InvalidURL) from .auth import _basic_auth_str try: @@ -130,8 +133,7 @@ def __init__(self, pool_connections=DEFAULT_POOLSIZE, self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block) def __getstate__(self): - return dict((attr, getattr(self, attr, None)) for attr in - self.__attrs__) + return {attr: getattr(self, attr, None) for attr in self.__attrs__} def __setstate__(self, state): # Can't handle by adding 'proxy_manager' to self.__attrs__ because @@ -223,11 +225,11 @@ def cert_verify(self, conn, url, verify, cert): cert_loc = verify if not cert_loc: - cert_loc = DEFAULT_CA_BUNDLE_PATH + cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH) if not cert_loc or not os.path.exists(cert_loc): raise IOError("Could not find a suitable TLS CA certificate bundle, " - "invalid path: {0}".format(cert_loc)) + "invalid path: {}".format(cert_loc)) conn.cert_reqs = 'CERT_REQUIRED' @@ -249,10 +251,10 @@ def cert_verify(self, conn, url, verify, cert): conn.key_file = None if conn.cert_file and not os.path.exists(conn.cert_file): raise IOError("Could not find the TLS certificate file, " - "invalid path: {0}".format(conn.cert_file)) + "invalid path: {}".format(conn.cert_file)) if conn.key_file and not os.path.exists(conn.key_file): raise IOError("Could not find the TLS key file, " - "invalid path: {0}".format(conn.key_file)) + "invalid path: {}".format(conn.key_file)) def build_response(self, req, resp): """Builds a :class:`Response ` object from a urllib3 @@ -304,6 +306,10 @@ def get_connection(self, url, proxies=None): if proxy: proxy = prepend_scheme_if_needed(proxy, 'http') + proxy_url = parse_url(proxy) + if not proxy_url.host: + raise InvalidProxyURL("Please check proxy URL. It is malformed" + " and could be missing the host.") proxy_manager = self.proxy_manager_for(proxy) conn = proxy_manager.connection_from_url(url) else: @@ -377,7 +383,7 @@ def proxy_headers(self, proxy): when subclassing the :class:`HTTPAdapter `. - :param proxies: The url of the proxy being used for this request. + :param proxy: The url of the proxy being used for this request. :rtype: dict """ headers = {} @@ -406,11 +412,14 @@ def send(self, request, stream=False, timeout=None, verify=True, cert=None, prox :rtype: requests.Response """ - conn = self.get_connection(request.url, proxies) + try: + conn = self.get_connection(request.url, proxies) + except LocationValueError as e: + raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) - self.add_headers(request) + self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) chunked = not (request.body is None or 'Content-Length' in request.headers) @@ -420,7 +429,7 @@ def send(self, request, stream=False, timeout=None, verify=True, cert=None, prox timeout = TimeoutSauce(connect=connect, read=read) except ValueError as e: # this may raise a string formatting error. - err = ("Invalid timeout {0}. Pass a (connect, read) " + err = ("Invalid timeout {}. Pass a (connect, read) " "timeout tuple, or a single float to set " "both timeouts to the same value".format(timeout)) raise ValueError(err) @@ -471,11 +480,10 @@ def send(self, request, stream=False, timeout=None, verify=True, cert=None, prox # Receive the response from the server try: - # For Python 2.7+ versions, use buffering of HTTP - # responses + # For Python 2.7, use buffering of HTTP responses r = low_conn.getresponse(buffering=True) except TypeError: - # For compatibility with Python 2.6 versions and back + # For compatibility with Python 3.3+ r = low_conn.getresponse() resp = HTTPResponse.from_httplib( diff --git a/src/oci/_vendor/requests/api.py b/src/oci/_vendor/requests/api.py index e9aca70587..4196597bbb 100644 --- a/src/oci/_vendor/requests/api.py +++ b/src/oci/_vendor/requests/api.py @@ -22,9 +22,11 @@ def request(method, url, **kwargs): :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. - :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. - :param data: (optional) Dictionary or list of tuples ``[(key, value)]`` (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. - :param json: (optional) json data to send in the body of the :class:`Request`. + :param params: (optional) Dictionary, list of tuples or bytes to send + in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. + :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload. @@ -51,7 +53,7 @@ def request(method, url, **kwargs): Usage:: >>> import requests - >>> req = requests.request('GET', 'http://httpbin.org/get') + >>> req = requests.request('GET', 'https://httpbin.org/get') """ @@ -66,7 +68,8 @@ def get(url, params=None, **kwargs): r"""Sends a GET request. :param url: URL for the new :class:`Request` object. - :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. + :param params: (optional) Dictionary, list of tuples or bytes to send + in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response @@ -106,7 +109,8 @@ def post(url, data=None, json=None, **kwargs): r"""Sends a POST request. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object @@ -120,7 +124,8 @@ def put(url, data=None, **kwargs): r"""Sends a PUT request. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object @@ -134,7 +139,8 @@ def patch(url, data=None, **kwargs): r"""Sends a PATCH request. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object diff --git a/src/oci/_vendor/requests/auth.py b/src/oci/_vendor/requests/auth.py index cc1e9049d8..dd524c52fc 100644 --- a/src/oci/_vendor/requests/auth.py +++ b/src/oci/_vendor/requests/auth.py @@ -42,7 +42,7 @@ def _basic_auth_str(username, password): if not isinstance(username, basestring): warnings.warn( "Non-string usernames will no longer be supported in Requests " - "3.0.0. Please convert the object you've passed in ({0!r}) to " + "3.0.0. Please convert the object you've passed in ({!r}) to " "a string or bytes object in the near future to avoid " "problems.".format(username), category=DeprecationWarning, @@ -52,7 +52,7 @@ def _basic_auth_str(username, password): if not isinstance(password, basestring): warnings.warn( "Non-string passwords will no longer be supported in Requests " - "3.0.0. Please convert the object you've passed in ({0!r}) to " + "3.0.0. Please convert the object you've passed in ({!r}) to " "a string or bytes object in the near future to avoid " "problems.".format(password), category=DeprecationWarning, @@ -157,6 +157,18 @@ def sha_utf8(x): x = x.encode('utf-8') return hashlib.sha1(x).hexdigest() hash_utf8 = sha_utf8 + elif _algorithm == 'SHA-256': + def sha256_utf8(x): + if isinstance(x, str): + x = x.encode('utf-8') + return hashlib.sha256(x).hexdigest() + hash_utf8 = sha256_utf8 + elif _algorithm == 'SHA-512': + def sha512_utf8(x): + if isinstance(x, str): + x = x.encode('utf-8') + return hashlib.sha512(x).hexdigest() + hash_utf8 = sha512_utf8 KD = lambda s, d: hash_utf8("%s:%s" % (s, d)) diff --git a/src/oci/_vendor/requests/compat.py b/src/oci/_vendor/requests/compat.py index 3789cf87b1..3ad3a9bf54 100644 --- a/src/oci/_vendor/requests/compat.py +++ b/src/oci/_vendor/requests/compat.py @@ -47,8 +47,8 @@ import cookielib from Cookie import Morsel from StringIO import StringIO + from collections import Callable, Mapping, MutableMapping, OrderedDict - from oci._vendor.urllib3.packages.ordered_dict import OrderedDict builtin_str = str bytes = str @@ -64,6 +64,7 @@ from http.cookies import Morsel from io import StringIO from collections import OrderedDict + from collections.abc import Callable, Mapping, MutableMapping builtin_str = str str = str diff --git a/src/oci/_vendor/requests/cookies.py b/src/oci/_vendor/requests/cookies.py index c0656b2aed..337e92ad35 100644 --- a/src/oci/_vendor/requests/cookies.py +++ b/src/oci/_vendor/requests/cookies.py @@ -16,10 +16,9 @@ import copy import time import calendar -import collections from ._internal_utils import to_native_string -from .compat import cookielib, urlparse, urlunparse, Morsel +from .compat import cookielib, urlparse, urlunparse, Morsel, MutableMapping try: import threading @@ -173,7 +172,7 @@ class CookieConflictError(RuntimeError): """ -class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping): +class RequestsCookieJar(cookielib.CookieJar, MutableMapping): """Compatibility class; is a cookielib.CookieJar, but exposes a dict interface. @@ -419,9 +418,14 @@ def __setstate__(self, state): def copy(self): """Return a copy of this RequestsCookieJar.""" new_cj = RequestsCookieJar() + new_cj.set_policy(self.get_policy()) new_cj.update(self) return new_cj + def get_policy(self): + """Return the CookiePolicy instance used.""" + return self._policy + def _copy_cookie_jar(jar): if jar is None: @@ -444,20 +448,21 @@ def create_cookie(name, value, **kwargs): By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). """ - result = dict( - version=0, - name=name, - value=value, - port=None, - domain='', - path='/', - secure=False, - expires=None, - discard=True, - comment=None, - comment_url=None, - rest={'HttpOnly': None}, - rfc2109=False,) + result = { + 'version': 0, + 'name': name, + 'value': value, + 'port': None, + 'domain': '', + 'path': '/', + 'secure': False, + 'expires': None, + 'discard': True, + 'comment': None, + 'comment_url': None, + 'rest': {'HttpOnly': None}, + 'rfc2109': False, + } badargs = set(kwargs) - set(result) if badargs: @@ -511,6 +516,7 @@ def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True): :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. + :rtype: CookieJar """ if cookiejar is None: cookiejar = RequestsCookieJar() @@ -529,6 +535,7 @@ def merge_cookies(cookiejar, cookies): :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. + :rtype: CookieJar """ if not isinstance(cookiejar, cookielib.CookieJar): raise ValueError('You can only merge into CookieJar') diff --git a/src/oci/_vendor/requests/exceptions.py b/src/oci/_vendor/requests/exceptions.py index b4acb5493f..47da7ff625 100644 --- a/src/oci/_vendor/requests/exceptions.py +++ b/src/oci/_vendor/requests/exceptions.py @@ -89,6 +89,10 @@ class InvalidHeader(RequestException, ValueError): """The header value provided was somehow invalid.""" +class InvalidProxyURL(InvalidURL): + """The proxy URL provided is invalid.""" + + class ChunkedEncodingError(RequestException): """The server declared chunked encoding but sent an invalid chunk.""" diff --git a/src/oci/_vendor/requests/help.py b/src/oci/_vendor/requests/help.py index 422c6a13c4..ec6860aff9 100644 --- a/src/oci/_vendor/requests/help.py +++ b/src/oci/_vendor/requests/help.py @@ -17,7 +17,7 @@ from . import __version__ as requests_version try: - from .packages.urllib3.contrib import pyopenssl + from oci._vendor.urllib3.contrib import pyopenssl except ImportError: pyopenssl = None OpenSSL = None @@ -93,8 +93,7 @@ def info(): 'version': getattr(idna, '__version__', ''), } - # OPENSSL_VERSION_NUMBER doesn't exist in the Python 2.6 ssl module. - system_ssl = getattr(ssl, 'OPENSSL_VERSION_NUMBER', None) + system_ssl = ssl.OPENSSL_VERSION_NUMBER system_ssl_info = { 'version': '%x' % system_ssl if system_ssl is not None else '' } diff --git a/src/oci/_vendor/requests/hooks.py b/src/oci/_vendor/requests/hooks.py index 9d818e9ea1..e6d233f7ad 100644 --- a/src/oci/_vendor/requests/hooks.py +++ b/src/oci/_vendor/requests/hooks.py @@ -19,14 +19,14 @@ def default_hooks(): - return dict((event, []) for event in HOOKS) + return {event: [] for event in HOOKS} # TODO: response is the only one def dispatch_hook(key, hooks, hook_data, **kwargs): """Dispatches a hook dictionary on a given piece of data.""" - hooks = hooks or dict() + hooks = hooks or {} hooks = hooks.get(key) if hooks: if hasattr(hooks, '__call__'): diff --git a/src/oci/_vendor/requests/models.py b/src/oci/_vendor/requests/models.py index 53c2b86233..a4ade1a66e 100644 --- a/src/oci/_vendor/requests/models.py +++ b/src/oci/_vendor/requests/models.py @@ -11,7 +11,6 @@ This module contains the primary objects that power Requests. """ -import collections import datetime import sys @@ -41,6 +40,7 @@ stream_decode_response_unicode, to_key_val_list, parse_header_links, iter_slices, guess_json_utf, super_len, check_header_validity) from .compat import ( + Callable, Mapping, cookielib, urlunparse, urlsplit, urlencode, str, bytes, is_py2, chardet, builtin_str, basestring) from .compat import json as complexjson @@ -159,8 +159,12 @@ def _encode_files(files, data): if isinstance(fp, (str, bytes, bytearray)): fdata = fp - else: + elif hasattr(fp, 'read'): fdata = fp.read() + elif fp is None: + continue + else: + fdata = fp rf = RequestField(name=k, data=fdata, filename=fn, headers=fh) rf.make_multipart(content_type=ft) @@ -178,10 +182,10 @@ def register_hook(self, event, hook): if event not in self.hooks: raise ValueError('Unsupported event specified, with event name "%s"' % (event)) - if isinstance(hook, collections.Callable): + if isinstance(hook, Callable): self.hooks[event].append(hook) elif hasattr(hook, '__iter__'): - self.hooks[event].extend(h for h in hook if isinstance(h, collections.Callable)) + self.hooks[event].extend(h for h in hook if isinstance(h, Callable)) def deregister_hook(self, event, hook): """Deregister a previously registered hook. @@ -204,9 +208,13 @@ class Request(RequestHooksMixin): :param url: URL to send. :param headers: dictionary of headers to send. :param files: dictionary of {filename: fileobject} files to multipart upload. - :param data: the body to attach to the request. If a dictionary is provided, form-encoding will take place. + :param data: the body to attach to the request. If a dictionary or + list of tuples ``[(key, value)]`` is provided, form-encoding will + take place. :param json: json for the body to attach to the request (if files or data is not specified). - :param params: dictionary of URL parameters to append to the URL. + :param params: URL parameters to append to the URL. If a dictionary or + list of tuples ``[(key, value)]`` is provided, form-encoding will + take place. :param auth: Auth handler or (user, pass) tuple. :param cookies: dictionary or CookieJar of cookies to attach to this request. :param hooks: dictionary of callback hooks, for internal usage. @@ -214,7 +222,7 @@ class Request(RequestHooksMixin): Usage:: >>> import requests - >>> req = requests.Request('GET', 'http://httpbin.org/get') + >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() """ @@ -274,7 +282,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): Usage:: >>> import requests - >>> req = requests.Request('GET', 'http://httpbin.org/get') + >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> r = req.prepare() @@ -465,7 +473,7 @@ def prepare_body(self, data, files, json=None): is_stream = all([ hasattr(data, '__iter__'), - not isinstance(data, (basestring, list, tuple, collections.Mapping)) + not isinstance(data, (basestring, list, tuple, Mapping)) ]) try: @@ -648,10 +656,7 @@ def __getstate__(self): if not self._content_consumed: self.content - return dict( - (attr, getattr(self, attr, None)) - for attr in self.__attrs__ - ) + return {attr: getattr(self, attr, None) for attr in self.__attrs__} def __setstate__(self, state): for name, value in state.items(): @@ -690,11 +695,11 @@ def __iter__(self): @property def ok(self): - """Returns True if :attr:`status_code` is less than 400. + """Returns True if :attr:`status_code` is less than 400, False if not. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If - the status code, is between 200 and 400, this will return True. This + the status code is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. """ try: @@ -780,7 +785,7 @@ def generate(): return chunks - def iter_lines(self, chunk_size=ITER_CHUNK_SIZE, decode_unicode=None, delimiter=None): + def iter_lines(self, chunk_size=ITER_CHUNK_SIZE, decode_unicode=False, delimiter=None): """Iterates over the response data, one line at a time. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. @@ -824,7 +829,7 @@ def content(self): if self.status_code == 0 or self.raw is None: self._content = None else: - self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() + self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b'' self._content_consumed = True # don't need to release the connection; that's been handled by urllib3 diff --git a/src/oci/_vendor/requests/sessions.py b/src/oci/_vendor/requests/sessions.py index ea7546d87e..09e1a91d75 100644 --- a/src/oci/_vendor/requests/sessions.py +++ b/src/oci/_vendor/requests/sessions.py @@ -12,19 +12,18 @@ requests (cookies, auth, proxies). """ import os -import platform +import sys import time -from collections import Mapping from datetime import timedelta from .auth import _basic_auth_str -from .compat import cookielib, is_py3, OrderedDict, urljoin, urlparse +from .compat import cookielib, is_py3, OrderedDict, urljoin, urlparse, Mapping from .cookies import ( cookiejar_from_dict, extract_cookies_to_jar, RequestsCookieJar, merge_cookies) from .models import Request, PreparedRequest, DEFAULT_REDIRECT_LIMIT from .hooks import default_hooks, dispatch_hook from ._internal_utils import to_native_string -from .utils import to_key_val_list, default_headers +from .utils import to_key_val_list, default_headers, DEFAULT_PORTS from .exceptions import ( TooManyRedirects, InvalidSchema, ChunkedEncodingError, ContentDecodingError) @@ -42,8 +41,8 @@ from .models import REDIRECT_STATI # Preferred clock, based on which one is more accurate on a given system. -if platform.system() == 'Windows': - try: # Python 3.3+ +if sys.platform == 'win32': + try: # Python 3.4+ preferred_clock = time.perf_counter except AttributeError: # Earlier than Python 3. preferred_clock = time.clock @@ -120,6 +119,31 @@ def get_redirect_target(self, resp): return to_native_string(location, 'utf8') return None + def should_strip_auth(self, old_url, new_url): + """Decide whether Authorization header should be removed when redirecting""" + old_parsed = urlparse(old_url) + new_parsed = urlparse(new_url) + if old_parsed.hostname != new_parsed.hostname: + return True + # Special case: allow http -> https redirect when using the standard + # ports. This isn't specified by RFC 7235, but is kept to avoid + # breaking backwards compatibility with older versions of requests + # that allowed any redirects on the same host. + if (old_parsed.scheme == 'http' and old_parsed.port in (80, None) + and new_parsed.scheme == 'https' and new_parsed.port in (443, None)): + return False + + # Handle default port usage corresponding to scheme. + changed_port = old_parsed.port != new_parsed.port + changed_scheme = old_parsed.scheme != new_parsed.scheme + default_port = (DEFAULT_PORTS.get(old_parsed.scheme, None), None) + if (not changed_scheme and old_parsed.port in default_port + and new_parsed.port in default_port): + return False + + # Standard case: root URI must match + return changed_port or changed_scheme + def resolve_redirects(self, resp, req, stream=False, timeout=None, verify=True, cert=None, proxies=None, yield_requests=False, **adapter_kwargs): """Receives a Response. Returns a generator of Responses or Requests.""" @@ -127,6 +151,7 @@ def resolve_redirects(self, resp, req, stream=False, timeout=None, hist = [] # keep track of history url = self.get_redirect_target(resp) + previous_fragment = urlparse(req.url).fragment while url: prepared_request = req.copy() @@ -151,8 +176,12 @@ def resolve_redirects(self, resp, req, stream=False, timeout=None, parsed_rurl = urlparse(resp.url) url = '%s:%s' % (to_native_string(parsed_rurl.scheme), url) - # The scheme should be lower case... + # Normalize url case and attach previous fragment if needed (RFC 7231 7.1.2) parsed = urlparse(url) + if parsed.fragment == '' and previous_fragment: + parsed = parsed._replace(fragment=previous_fragment) + elif parsed.fragment: + previous_fragment = parsed.fragment url = parsed.geturl() # Facilitate relative 'location' headers, as allowed by RFC 7231. @@ -236,14 +265,10 @@ def rebuild_auth(self, prepared_request, response): headers = prepared_request.headers url = prepared_request.url - if 'Authorization' in headers: + if 'Authorization' in headers and self.should_strip_auth(response.request.url, url): # If we get redirected to a new host, we should strip out any # authentication headers. - original_parsed = urlparse(response.request.url) - redirect_parsed = urlparse(url) - - if (original_parsed.hostname != redirect_parsed.hostname): - del headers['Authorization'] + del headers['Authorization'] # .netrc might have more auth for us on our new host. new_auth = get_netrc_auth(url) if self.trust_env else None @@ -299,7 +324,7 @@ def rebuild_method(self, prepared_request, response): """ method = prepared_request.method - # http://tools.ietf.org/html/rfc7231#section-6.4.4 + # https://tools.ietf.org/html/rfc7231#section-6.4.4 if response.status_code == codes.see_other and method != 'HEAD': method = 'GET' @@ -325,13 +350,13 @@ class Session(SessionRedirectMixin): >>> import requests >>> s = requests.Session() - >>> s.get('http://httpbin.org/get') + >>> s.get('https://httpbin.org/get') Or as a context manager:: >>> with requests.Session() as s: - >>> s.get('http://httpbin.org/get') + >>> s.get('https://httpbin.org/get') """ @@ -453,8 +478,8 @@ def request(self, method, url, :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. - :param data: (optional) Dictionary, bytes, or file-like object to send - in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the @@ -550,7 +575,8 @@ def post(self, url, data=None, json=None, **kwargs): r"""Sends a POST request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response @@ -562,7 +588,8 @@ def put(self, url, data=None, **kwargs): r"""Sends a PUT request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ @@ -573,7 +600,8 @@ def patch(self, url, data=None, **kwargs): r"""Sends a PATCH request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ @@ -700,7 +728,7 @@ def get_adapter(self, url): """ for (prefix, adapter) in self.adapters.items(): - if url.lower().startswith(prefix): + if url.lower().startswith(prefix.lower()): return adapter # Nothing matches :-/ @@ -723,7 +751,7 @@ def mount(self, prefix, adapter): self.adapters[key] = self.adapters.pop(key) def __getstate__(self): - state = dict((attr, getattr(self, attr, None)) for attr in self.__attrs__) + state = {attr: getattr(self, attr, None) for attr in self.__attrs__} return state def __setstate__(self, state): @@ -735,7 +763,12 @@ def session(): """ Returns a :class:`Session` for context-management. + .. deprecated:: 1.0.0 + + This method has been deprecated since version 1.0.0 and is only kept for + backwards compatibility. New code should use :class:`~requests.sessions.Session` + to create a session. This may be removed at a future date. + :rtype: Session """ - return Session() diff --git a/src/oci/_vendor/requests/status_codes.py b/src/oci/_vendor/requests/status_codes.py index 9f2e32bbd6..b85ebcc68e 100644 --- a/src/oci/_vendor/requests/status_codes.py +++ b/src/oci/_vendor/requests/status_codes.py @@ -4,6 +4,23 @@ # -*- coding: utf-8 -*- +r""" +The ``codes`` object defines a mapping from common names for HTTP statuses +to their numerical codes, accessible either as attributes or as dictionary +items. + +>>> requests.codes['temporary_redirect'] +307 +>>> requests.codes.teapot +418 +>>> requests.codes['\o/'] +200 + +Some codes have multiple names, and both upper- and lower-case versions of +the names are allowed. For example, ``codes.ok``, ``codes.OK``, and +``codes.okay`` all correspond to the HTTP status code 200. +""" + from .structures import LookupDict _codes = { @@ -88,8 +105,20 @@ codes = LookupDict(name='status_codes') -for code, titles in _codes.items(): - for title in titles: - setattr(codes, title, code) - if not title.startswith(('\\', '/')): - setattr(codes, title.upper(), code) +def _init(): + for code, titles in _codes.items(): + for title in titles: + setattr(codes, title, code) + if not title.startswith(('\\', '/')): + setattr(codes, title.upper(), code) + + def doc(code): + names = ', '.join('``%s``' % n for n in _codes[code]) + return '* %d: %s' % (code, names) + + global __doc__ + __doc__ = (__doc__ + '\n' + + '\n'.join(doc(code) for code in sorted(_codes)) + if __doc__ is not None else None) + +_init() diff --git a/src/oci/_vendor/requests/structures.py b/src/oci/_vendor/requests/structures.py index 24abc29d5a..705749c2d2 100644 --- a/src/oci/_vendor/requests/structures.py +++ b/src/oci/_vendor/requests/structures.py @@ -11,16 +11,14 @@ Data structures that power Requests. """ -import collections +from .compat import OrderedDict, Mapping, MutableMapping -from .compat import OrderedDict - -class CaseInsensitiveDict(collections.MutableMapping): +class CaseInsensitiveDict(MutableMapping): """A case-insensitive ``dict``-like object. Implements all methods and operations of - ``collections.MutableMapping`` as well as dict's ``copy``. Also + ``MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys are expected to be strings. The structure remembers the @@ -75,7 +73,7 @@ def lower_items(self): ) def __eq__(self, other): - if isinstance(other, collections.Mapping): + if isinstance(other, Mapping): other = CaseInsensitiveDict(other) else: return NotImplemented diff --git a/src/oci/_vendor/requests/utils.py b/src/oci/_vendor/requests/utils.py index b41d0d0cfd..a3a1350175 100644 --- a/src/oci/_vendor/requests/utils.py +++ b/src/oci/_vendor/requests/utils.py @@ -12,17 +12,17 @@ that are also useful for external consumption. """ -import cgi import codecs -import collections import contextlib import io import os -import platform import re import socket import struct +import sys +import tempfile import warnings +import zipfile from .__version__ import __version__ from . import certs @@ -32,7 +32,7 @@ from .compat import ( quote, urlparse, bytes, str, OrderedDict, unquote, getproxies, proxy_bypass, urlunparse, basestring, integer_types, is_py3, - proxy_bypass_environment, getproxies_environment) + proxy_bypass_environment, getproxies_environment, Mapping) from .cookies import cookiejar_from_dict from .structures import CaseInsensitiveDict from .exceptions import ( @@ -42,20 +42,28 @@ DEFAULT_CA_BUNDLE_PATH = certs.where() +DEFAULT_PORTS = {'http': 80, 'https': 443} -if platform.system() == 'Windows': + +if sys.platform == 'win32': # provide a proxy_bypass version on Windows without DNS lookups def proxy_bypass_registry(host): - if is_py3: - import winreg - else: - import _winreg as winreg + try: + if is_py3: + import winreg + else: + import _winreg as winreg + except ImportError: + return False + try: internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Internet Settings') - proxyEnable = winreg.QueryValueEx(internetSettings, - 'ProxyEnable')[0] + # ProxyEnable could be REG_SZ or REG_DWORD, normalizing it + proxyEnable = int(winreg.QueryValueEx(internetSettings, + 'ProxyEnable')[0]) + # ProxyOverride is almost always a string proxyOverride = winreg.QueryValueEx(internetSettings, 'ProxyOverride')[0] except OSError: @@ -171,10 +179,10 @@ def get_netrc_auth(url, raise_errors=False): for f in NETRC_FILES: try: - loc = os.path.expanduser('~/{0}'.format(f)) + loc = os.path.expanduser('~/{}'.format(f)) except KeyError: # os.path.expanduser can fail when $HOME is undefined and - # getpwuid fails. See http://bugs.python.org/issue20164 & + # getpwuid fails. See https://bugs.python.org/issue20164 & # https://github.com/requests/requests/issues/1846 return @@ -220,6 +228,38 @@ def guess_filename(obj): return os.path.basename(name) +def extract_zipped_paths(path): + """Replace nonexistent paths that look like they refer to a member of a zip + archive with the location of an extracted copy of the target, or else + just return the provided path unchanged. + """ + if os.path.exists(path): + # this is already a valid path, no need to do anything further + return path + + # find the first valid part of the provided path and treat that as a zip archive + # assume the rest of the path is the name of a member in the archive + archive, member = os.path.split(path) + while archive and not os.path.exists(archive): + archive, prefix = os.path.split(archive) + member = '/'.join([prefix, member]) + + if not zipfile.is_zipfile(archive): + return path + + zip_file = zipfile.ZipFile(archive) + if member not in zip_file.namelist(): + return path + + # we have a valid zip archive and a valid member of that archive + tmp = tempfile.gettempdir() + extracted_path = os.path.join(tmp, *member.split('/')) + if not os.path.exists(extracted_path): + extracted_path = zip_file.extract(member, path=tmp) + + return extracted_path + + def from_key_val_list(value): """Take an object and test to see if it can be represented as a dictionary. Unless it can not be represented as such, return an @@ -230,7 +270,7 @@ def from_key_val_list(value): >>> from_key_val_list([('key', 'val')]) OrderedDict([('key', 'val')]) >>> from_key_val_list('string') - ValueError: need more than 1 value to unpack + ValueError: cannot encode objects that are not 2-tuples >>> from_key_val_list({'key': 'val'}) OrderedDict([('key', 'val')]) @@ -266,7 +306,7 @@ def to_key_val_list(value): if isinstance(value, (str, bytes, bool, int)): raise ValueError('cannot encode objects that are not 2-tuples') - if isinstance(value, collections.Mapping): + if isinstance(value, Mapping): value = value.items() return list(value) @@ -411,6 +451,31 @@ def get_encodings_from_content(content): xml_re.findall(content)) +def _parse_content_type_header(header): + """Returns content type and parameters from given header + + :param header: string + :return: tuple containing content type and dictionary of + parameters + """ + + tokens = header.split(';') + content_type, params = tokens[0].strip(), tokens[1:] + params_dict = {} + items_to_strip = "\"' " + + for param in params: + param = param.strip() + if param: + key, value = param, True + index_of_equals = param.find("=") + if index_of_equals != -1: + key = param[:index_of_equals].strip(items_to_strip) + value = param[index_of_equals + 1:].strip(items_to_strip) + params_dict[key.lower()] = value + return content_type, params_dict + + def get_encoding_from_headers(headers): """Returns encodings from given HTTP Header Dict. @@ -423,7 +488,7 @@ def get_encoding_from_headers(headers): if not content_type: return None - content_type, params = cgi.parse_header(content_type) + content_type, params = _parse_content_type_header(content_type) if 'charset' in params: return params['charset'].strip("'\"") @@ -636,6 +701,8 @@ def should_bypass_proxies(url, no_proxy): :rtype: bool """ + # Prioritize lowercase environment variables over uppercase + # to keep a consistent behaviour with other http projects (curl, wget). get_proxy = lambda k: os.environ.get(k) or os.environ.get(k.upper()) # First check whether no_proxy is defined. If it is, check that the URL @@ -643,41 +710,43 @@ def should_bypass_proxies(url, no_proxy): no_proxy_arg = no_proxy if no_proxy is None: no_proxy = get_proxy('no_proxy') - netloc = urlparse(url).netloc + parsed = urlparse(url) + + if parsed.hostname is None: + # URLs don't always have hostnames, e.g. file:/// urls. + return True if no_proxy: # We need to check whether we match here. We need to see if we match - # the end of the netloc, both with and without the port. + # the end of the hostname, both with and without the port. no_proxy = ( host for host in no_proxy.replace(' ', '').split(',') if host ) - ip = netloc.split(':')[0] - if is_ipv4_address(ip): + if is_ipv4_address(parsed.hostname): for proxy_ip in no_proxy: if is_valid_cidr(proxy_ip): - if address_in_network(ip, proxy_ip): + if address_in_network(parsed.hostname, proxy_ip): return True - elif ip == proxy_ip: + elif parsed.hostname == proxy_ip: # If no_proxy ip was defined in plain IP notation instead of cidr notation & # matches the IP of the index return True else: + host_with_port = parsed.hostname + if parsed.port: + host_with_port += ':{}'.format(parsed.port) + for host in no_proxy: - if netloc.endswith(host) or netloc.split(':')[0].endswith(host): + if parsed.hostname.endswith(host) or host_with_port.endswith(host): # The URL does match something in no_proxy, so we don't want # to apply the proxies on this URL. return True - # If the system proxy settings indicate that this URL should be bypassed, - # don't proxy. - # The proxy_bypass function is incredibly buggy on OS X in early versions - # of Python 2.6, so allow this call to fail. Only catch the specific - # exceptions we've seen, though: this call failing in other ways can reveal - # legitimate problems. with set_environ('no_proxy', no_proxy_arg): + # parsed.hostname can be `None` in cases such as a file URI. try: - bypass = proxy_bypass(netloc) + bypass = proxy_bypass(parsed.hostname) except (TypeError, socket.gaierror): bypass = False @@ -747,7 +816,7 @@ def default_headers(): def parse_header_links(value): - """Return a dict of parsed link headers proxies. + """Return a list of parsed link headers proxies. i.e. Link: ; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" @@ -758,6 +827,10 @@ def parse_header_links(value): replace_chars = ' \'"' + value = value.strip(replace_chars) + if not value: + return links + for val in re.split(', *<', value): try: url, params = val.split(';', 1) diff --git a/src/oci/_vendor/six.py b/src/oci/_vendor/six.py index 6bf4fd3810..89b2188fd6 100644 --- a/src/oci/_vendor/six.py +++ b/src/oci/_vendor/six.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2017 Benjamin Peterson +# Copyright (c) 2010-2018 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ import types __author__ = "Benjamin Peterson " -__version__ = "1.11.0" +__version__ = "1.12.0" # Useful for very coarse version differentiation. @@ -844,10 +844,71 @@ def wrapper(cls): orig_vars.pop(slots_var) orig_vars.pop('__dict__', None) orig_vars.pop('__weakref__', None) + if hasattr(cls, '__qualname__'): + orig_vars['__qualname__'] = cls.__qualname__ return metaclass(cls.__name__, cls.__bases__, orig_vars) return wrapper +def ensure_binary(s, encoding='utf-8', errors='strict'): + """Coerce **s** to six.binary_type. + + For Python 2: + - `unicode` -> encoded to `str` + - `str` -> `str` + + For Python 3: + - `str` -> encoded to `bytes` + - `bytes` -> `bytes` + """ + if isinstance(s, text_type): + return s.encode(encoding, errors) + elif isinstance(s, binary_type): + return s + else: + raise TypeError("not expecting type '%s'" % type(s)) + + +def ensure_str(s, encoding='utf-8', errors='strict'): + """Coerce *s* to `str`. + + For Python 2: + - `unicode` -> encoded to `str` + - `str` -> `str` + + For Python 3: + - `str` -> `str` + - `bytes` -> decoded to `str` + """ + if not isinstance(s, (text_type, binary_type)): + raise TypeError("not expecting type '%s'" % type(s)) + if PY2 and isinstance(s, text_type): + s = s.encode(encoding, errors) + elif PY3 and isinstance(s, binary_type): + s = s.decode(encoding, errors) + return s + + +def ensure_text(s, encoding='utf-8', errors='strict'): + """Coerce *s* to six.text_type. + + For Python 2: + - `unicode` -> `unicode` + - `str` -> `unicode` + + For Python 3: + - `str` -> `str` + - `bytes` -> decoded to `str` + """ + if isinstance(s, binary_type): + return s.decode(encoding, errors) + elif isinstance(s, text_type): + return s + else: + raise TypeError("not expecting type '%s'" % type(s)) + + + def python_2_unicode_compatible(klass): """ A decorator that defines __unicode__ and __str__ methods under Python 2. diff --git a/src/oci/_vendor/urllib3/__init__.py b/src/oci/_vendor/urllib3/__init__.py index 717391302b..04950bd60a 100644 --- a/src/oci/_vendor/urllib3/__init__.py +++ b/src/oci/_vendor/urllib3/__init__.py @@ -27,16 +27,11 @@ # Set default logging handler to avoid "No handler found" warnings. import logging -try: # Python 2.7+ - from logging import NullHandler -except ImportError: - class NullHandler(logging.Handler): - def emit(self, record): - pass +from logging import NullHandler __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' __license__ = 'MIT' -__version__ = '1.22' +__version__ = '1.24.1' __all__ = ( 'HTTPConnectionPool', diff --git a/src/oci/_vendor/urllib3/_collections.py b/src/oci/_vendor/urllib3/_collections.py index 7f2c19e04a..f59b059d78 100644 --- a/src/oci/_vendor/urllib3/_collections.py +++ b/src/oci/_vendor/urllib3/_collections.py @@ -3,7 +3,10 @@ # Copyright 2008-2016 Andrey Petrov and contributors from __future__ import absolute_import -from collections import Mapping, MutableMapping +try: + from collections.abc import Mapping, MutableMapping +except ImportError: + from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available @@ -15,10 +18,8 @@ def __exit__(self, exc_type, exc_value, traceback): pass -try: # Python 2.7+ - from collections import OrderedDict -except ImportError: - from .packages.ordered_dict import OrderedDict +from collections import OrderedDict +from .exceptions import InvalidHeader from .packages.six import iterkeys, itervalues, PY3 @@ -309,13 +310,22 @@ def from_httplib(cls, message): # Python 2 # python2.7 does not expose a proper API for exporting multiheaders # efficiently. This function re-reads raw lines from the message # object and extracts the multiheaders properly. + obs_fold_continued_leaders = (' ', '\t') headers = [] for line in message.headers: - if line.startswith((' ', '\t')): - key, value = headers[-1] - headers[-1] = (key, value + '\r\n' + line.rstrip()) - continue + if line.startswith(obs_fold_continued_leaders): + if not headers: + # We received a header line that starts with OWS as described + # in RFC-7230 S3.2.4. This indicates a multiline header, but + # there exists no previous header to which we can attach it. + raise InvalidHeader( + 'Header continuation with no previous header: %s' % line + ) + else: + key, value = headers[-1] + headers[-1] = (key, value + ' ' + line.strip()) + continue key, value = line.split(':', 1) headers.append((key, value.strip())) diff --git a/src/oci/_vendor/urllib3/connection.py b/src/oci/_vendor/urllib3/connection.py index cb4017540c..362a319360 100644 --- a/src/oci/_vendor/urllib3/connection.py +++ b/src/oci/_vendor/urllib3/connection.py @@ -6,7 +6,6 @@ import datetime import logging import os -import sys import socket from socket import error as SocketError, timeout as SocketTimeout import warnings @@ -60,10 +59,11 @@ class ConnectionError(Exception): 'https': 443, } -# When updating RECENT_DATE, move it to -# within two years of the current date, and no -# earlier than 6 months ago. -RECENT_DATE = datetime.date(2016, 1, 1) +# When updating RECENT_DATE, move it to within two years of the current date, +# and not less than 6 months ago. +# Example: if Today is 2018-01-01, then RECENT_DATE should be any date on or +# after 2016-01-01 (today - 2 years) AND before 2017-07-01 (today - 6 months) +RECENT_DATE = datetime.date(2017, 6, 30) class DummyConnection(object): @@ -81,9 +81,6 @@ class HTTPConnection(_HTTPConnection, object): - ``strict``: See the documentation on :class:`urllib3.connectionpool.HTTPConnectionPool` - ``source_address``: Set the source address for the current connection. - - .. note:: This is ignored for Python 2.6. It is only applied for 2.7 and 3.x - - ``socket_options``: Set specific options on the underlying socket. If not specified, then defaults are loaded from ``HTTPConnection.default_socket_options`` which includes disabling Nagle's algorithm (sets TCP_NODELAY to 1) unless the connection is behind a proxy. @@ -111,23 +108,44 @@ def __init__(self, *args, **kw): if six.PY3: # Python 3 kw.pop('strict', None) - # Pre-set source_address in case we have an older Python like 2.6. + # Pre-set source_address. self.source_address = kw.get('source_address') - if sys.version_info < (2, 7): # Python 2.6 - # _HTTPConnection on Python 2.6 will balk at this keyword arg, but - # not newer versions. We can still use it when creating a - # connection though, so we pop it *after* we have saved it as - # self.source_address. - kw.pop('source_address', None) - #: The socket options provided by the user. If no options are #: provided, we use the default options. self.socket_options = kw.pop('socket_options', self.default_socket_options) - # Superclass also sets self.source_address in Python 2.7+. _HTTPConnection.__init__(self, *args, **kw) + @property + def host(self): + """ + Getter method to remove any trailing dots that indicate the hostname is an FQDN. + + In general, SSL certificates don't include the trailing dot indicating a + fully-qualified domain name, and thus, they don't validate properly when + checked against a domain name that includes the dot. In addition, some + servers may not expect to receive the trailing dot when provided. + + However, the hostname with trailing dot is critical to DNS resolution; doing a + lookup with the trailing dot will properly only resolve the appropriate FQDN, + whereas a lookup without a trailing dot will search the system's search domain + list. Thus, it's important to keep the original host around for use only in + those cases where it's appropriate (i.e., when doing DNS lookup to establish the + actual TCP connection across which we're going to send HTTP requests). + """ + return self._dns_host.rstrip('.') + + @host.setter + def host(self, value): + """ + Setter for the `host` property. + + We assume that only urllib3 uses the _dns_host attribute; httplib itself + only uses `host`, and it seems reasonable that other libraries follow suit. + """ + self._dns_host = value + def _new_conn(self): """ Establish a socket connection and set nodelay settings on it. @@ -142,7 +160,7 @@ def _new_conn(self): try: conn = connection.create_connection( - (self.host, self.port), self.timeout, **extra_kw) + (self._dns_host, self.port), self.timeout, **extra_kw) except SocketTimeout as e: raise ConnectTimeoutError( @@ -157,10 +175,7 @@ def _new_conn(self): def _prepare_conn(self, conn): self.sock = conn - # the _tunnel_host attribute was added in python 2.6.3 (via - # http://hg.python.org/cpython/rev/0f57b30a152f) so pythons 2.6(0-2) do - # not have them. - if getattr(self, '_tunnel_host', None): + if self._tunnel_host: # TODO: Fix tunnel so it doesn't depend on self.sock state. self._tunnel() # Mark this connection as not reusable @@ -191,13 +206,13 @@ def request_chunked(self, method, url, body=None, headers=None): self.endheaders() if body is not None: - stringish_types = six.string_types + (six.binary_type,) + stringish_types = six.string_types + (bytes,) if isinstance(body, stringish_types): body = (body,) for chunk in body: if not chunk: continue - if not isinstance(chunk, six.binary_type): + if not isinstance(chunk, bytes): chunk = chunk.encode('utf8') len_str = hex(len(chunk))[2:] self.send(len_str.encode('utf-8')) @@ -216,7 +231,7 @@ class HTTPSConnection(HTTPConnection): def __init__(self, host, port=None, key_file=None, cert_file=None, strict=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, - ssl_context=None, **kw): + ssl_context=None, server_hostname=None, **kw): HTTPConnection.__init__(self, host, port, strict=strict, timeout=timeout, **kw) @@ -224,6 +239,7 @@ def __init__(self, host, port=None, key_file=None, cert_file=None, self.key_file = key_file self.cert_file = cert_file self.ssl_context = ssl_context + self.server_hostname = server_hostname # Required property for Google AppEngine 1.9.0 which otherwise causes # HTTPS requests to go out as HTTP. (See Issue #356) @@ -244,6 +260,7 @@ def connect(self): keyfile=self.key_file, certfile=self.cert_file, ssl_context=self.ssl_context, + server_hostname=self.server_hostname ) @@ -286,12 +303,9 @@ def set_cert(self, key_file=None, cert_file=None, def connect(self): # Add certificate verification conn = self._new_conn() - hostname = self.host - if getattr(self, '_tunnel_host', None): - # _tunnel_host was added in Python 2.6.3 - # (See: http://hg.python.org/cpython/rev/0f57b30a152f) + if self._tunnel_host: self.sock = conn # Calls self._set_hostport(), so self.host is # self._tunnel_host below. @@ -302,6 +316,10 @@ def connect(self): # Override the host with the one we're requesting data from. hostname = self._tunnel_host + server_hostname = hostname + if self.server_hostname is not None: + server_hostname = self.server_hostname + is_time_off = datetime.date.today() < RECENT_DATE if is_time_off: warnings.warn(( @@ -326,7 +344,7 @@ def connect(self): certfile=self.cert_file, ca_certs=self.ca_certs, ca_cert_dir=self.ca_cert_dir, - server_hostname=hostname, + server_hostname=server_hostname, ssl_context=context) if self.assert_fingerprint: @@ -347,7 +365,7 @@ def connect(self): 'for details.)'.format(hostname)), SubjectAltNameWarning ) - _match_hostname(cert, self.assert_hostname or hostname) + _match_hostname(cert, self.assert_hostname or server_hostname) self.is_verified = ( context.verify_mode == ssl.CERT_REQUIRED or diff --git a/src/oci/_vendor/urllib3/connectionpool.py b/src/oci/_vendor/urllib3/connectionpool.py index 23fd9757df..1c5b20cea0 100644 --- a/src/oci/_vendor/urllib3/connectionpool.py +++ b/src/oci/_vendor/urllib3/connectionpool.py @@ -44,13 +44,10 @@ from .util.response import assert_header_parsing from .util.retry import Retry from .util.timeout import Timeout -from .util.url import get_host, Url +from .util.url import get_host, Url, NORMALIZABLE_SCHEMES +from .util.queue import LifoQueue -if six.PY2: - # Queue is imported for side effects on MS Windows - import Queue as _unused_module_Queue # noqa: F401 - xrange = six.moves.xrange log = logging.getLogger(__name__) @@ -66,13 +63,13 @@ class ConnectionPool(object): """ scheme = None - QueueCls = queue.LifoQueue + QueueCls = LifoQueue def __init__(self, host, port=None): if not host: raise LocationValueError("No host specified.") - self.host = _ipv6_host(host).lower() + self.host = _ipv6_host(host, self.scheme) self._proxy_host = host.lower() self.port = port @@ -96,7 +93,7 @@ def close(self): # This is taken from http://hg.python.org/cpython/file/7aaba721ebc0/Lib/socket.py#l252 -_blocking_errnos = set([errno.EAGAIN, errno.EWOULDBLOCK]) +_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK} class HTTPConnectionPool(ConnectionPool, RequestMethods): @@ -208,8 +205,8 @@ def _new_conn(self): Return a fresh :class:`HTTPConnection`. """ self.num_connections += 1 - log.debug("Starting new HTTP connection (%d): %s", - self.num_connections, self.host) + log.debug("Starting new HTTP connection (%d): %s:%s", + self.num_connections, self.host, self.port or "80") conn = self.ConnectionCls(host=self.host, port=self.port, timeout=self.timeout.connect_timeout, @@ -320,7 +317,7 @@ def _raise_timeout(self, err, url, timeout_value): # Catch possible read timeouts thrown as SSL errors. If not the # case, rethrow the original. We need to do this because of: # http://bugs.python.org/issue10272 - if 'timed out' in str(err) or 'did not complete (read)' in str(err): # Python 2.6 + if 'timed out' in str(err) or 'did not complete (read)' in str(err): # Python < 2.7.4 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) def _make_request(self, conn, method, url, timeout=_Default, chunked=False, @@ -382,7 +379,7 @@ def _make_request(self, conn, method, url, timeout=_Default, chunked=False, try: try: # Python 2.7, use buffering of HTTP responses httplib_response = conn.getresponse(buffering=True) - except TypeError: # Python 2.6 and older, Python 3 + except TypeError: # Python 3 try: httplib_response = conn.getresponse() except Exception as e: @@ -415,6 +412,8 @@ def close(self): """ Close all pooled connections and disable the pool. """ + if self.pool is None: + return # Disable access to the pool old_pool, self.pool = self.pool, None @@ -438,7 +437,7 @@ def is_same_host(self, url): # TODO: Add optional support for socket.gethostbyname checking. scheme, host, port = get_host(url) - host = _ipv6_host(host).lower() + host = _ipv6_host(host, self.scheme) # Use explicit default port for comparison when none is given if self.port and not port: @@ -806,17 +805,7 @@ def _prepare_proxy(self, conn): Establish tunnel connection early, because otherwise httplib would improperly set Host: header to proxy's IP:port. """ - # Python 2.7+ - try: - set_tunnel = conn.set_tunnel - except AttributeError: # Platform-specific: Python 2.6 - set_tunnel = conn._set_tunnel - - if sys.version_info <= (2, 6, 4) and not self.proxy_headers: # Python 2.6.4 and older - set_tunnel(self._proxy_host, self.port) - else: - set_tunnel(self._proxy_host, self.port, self.proxy_headers) - + conn.set_tunnel(self._proxy_host, self.port, self.proxy_headers) conn.connect() def _new_conn(self): @@ -824,8 +813,8 @@ def _new_conn(self): Return a fresh :class:`httplib.HTTPSConnection`. """ self.num_connections += 1 - log.debug("Starting new HTTPS connection (%d): %s", - self.num_connections, self.host) + log.debug("Starting new HTTPS connection (%d): %s:%s", + self.num_connections, self.host, self.port or "443") if not self.ConnectionCls or self.ConnectionCls is DummyConnection: raise SSLError("Can't connect to HTTPS URL because the SSL " @@ -890,7 +879,7 @@ def connection_from_url(url, **kw): return HTTPConnectionPool(host, port=port, **kw) -def _ipv6_host(host): +def _ipv6_host(host, scheme): """ Process IPv6 address literals """ @@ -906,4 +895,6 @@ def _ipv6_host(host): # percent sign might be URIencoded, convert it back into ASCII if host.startswith('[') and host.endswith(']'): host = host.replace('%25', '%').strip('[]') + if scheme in NORMALIZABLE_SCHEMES: + host = host.lower() return host diff --git a/src/oci/_vendor/urllib3/contrib/_appengine_environ.py b/src/oci/_vendor/urllib3/contrib/_appengine_environ.py new file mode 100644 index 0000000000..66ea240445 --- /dev/null +++ b/src/oci/_vendor/urllib3/contrib/_appengine_environ.py @@ -0,0 +1,34 @@ +# coding: utf-8 +# Modified Work: Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright 2008-2016 Andrey Petrov and contributors + +""" +This module provides means to detect the App Engine environment. +""" + +import os + + +def is_appengine(): + return (is_local_appengine() or + is_prod_appengine() or + is_prod_appengine_mvms()) + + +def is_appengine_sandbox(): + return is_appengine() and not is_prod_appengine_mvms() + + +def is_local_appengine(): + return ('APPENGINE_RUNTIME' in os.environ and + 'Development/' in os.environ['SERVER_SOFTWARE']) + + +def is_prod_appengine(): + return ('APPENGINE_RUNTIME' in os.environ and + 'Google App Engine/' in os.environ['SERVER_SOFTWARE'] and + not is_prod_appengine_mvms()) + + +def is_prod_appengine_mvms(): + return os.environ.get('GAE_VM', False) == 'true' diff --git a/src/oci/_vendor/urllib3/contrib/_securetransport/low_level.py b/src/oci/_vendor/urllib3/contrib/_securetransport/low_level.py index c4785a8e32..7de82a1807 100644 --- a/src/oci/_vendor/urllib3/contrib/_securetransport/low_level.py +++ b/src/oci/_vendor/urllib3/contrib/_securetransport/low_level.py @@ -115,6 +115,9 @@ def _cert_array_from_pem(pem_bundle): Given a bundle of certs in PEM format, turns them into a CFArray of certs that can be used to validate a cert chain. """ + # Normalize the PEM bundle's line endings. + pem_bundle = pem_bundle.replace(b"\r\n", b"\n") + der_certs = [ base64.b64decode(match.group(1)) for match in _PEM_CERTS_RE.finditer(pem_bundle) @@ -187,8 +190,8 @@ def _temporary_keychain(): # some random bytes to password-protect the keychain we're creating, so we # ask for 40 random bytes. random_bytes = os.urandom(40) - filename = base64.b64encode(random_bytes[:8]).decode('utf-8') - password = base64.b64encode(random_bytes[8:]) # Must be valid UTF-8 + filename = base64.b16encode(random_bytes[:8]).decode('utf-8') + password = base64.b16encode(random_bytes[8:]) # Must be valid UTF-8 tempdirectory = tempfile.mkdtemp() keychain_path = os.path.join(tempdirectory, filename).encode('utf-8') diff --git a/src/oci/_vendor/urllib3/contrib/appengine.py b/src/oci/_vendor/urllib3/contrib/appengine.py index e017569415..78a49b8597 100644 --- a/src/oci/_vendor/urllib3/contrib/appengine.py +++ b/src/oci/_vendor/urllib3/contrib/appengine.py @@ -43,8 +43,8 @@ """ from __future__ import absolute_import +import io import logging -import os import warnings from ..packages.six.moves.urllib.parse import urljoin @@ -57,11 +57,11 @@ SSLError ) -from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse from ..util.timeout import Timeout from ..util.retry import Retry +from . import _appengine_environ try: from google.appengine.api import urlfetch @@ -240,12 +240,21 @@ def _urlfetch_response_to_http_response(self, urlfetch_resp, **response_kw): encodings.remove('chunked') urlfetch_resp.headers['transfer-encoding'] = ','.join(encodings) - return HTTPResponse( + original_response = HTTPResponse( # In order for decoding to work, we must present the content as # a file-like object. - body=BytesIO(urlfetch_resp.content), + body=io.BytesIO(urlfetch_resp.content), + msg=urlfetch_resp.header_msg, + headers=urlfetch_resp.headers, + status=urlfetch_resp.status_code, + **response_kw + ) + + return HTTPResponse( + body=io.BytesIO(urlfetch_resp.content), headers=urlfetch_resp.headers, status=urlfetch_resp.status_code, + original_response=original_response, **response_kw ) @@ -275,26 +284,10 @@ def _get_retries(self, retries, redirect): return retries -def is_appengine(): - return (is_local_appengine() or - is_prod_appengine() or - is_prod_appengine_mvms()) - - -def is_appengine_sandbox(): - return is_appengine() and not is_prod_appengine_mvms() - - -def is_local_appengine(): - return ('APPENGINE_RUNTIME' in os.environ and - 'Development/' in os.environ['SERVER_SOFTWARE']) - - -def is_prod_appengine(): - return ('APPENGINE_RUNTIME' in os.environ and - 'Google App Engine/' in os.environ['SERVER_SOFTWARE'] and - not is_prod_appengine_mvms()) - +# Alias methods from _appengine_environ to maintain public API interface. -def is_prod_appengine_mvms(): - return os.environ.get('GAE_VM', False) == 'true' +is_appengine = _appengine_environ.is_appengine +is_appengine_sandbox = _appengine_environ.is_appengine_sandbox +is_local_appengine = _appengine_environ.is_local_appengine +is_prod_appengine = _appengine_environ.is_prod_appengine +is_prod_appengine_mvms = _appengine_environ.is_prod_appengine_mvms diff --git a/src/oci/_vendor/urllib3/contrib/ntlmpool.py b/src/oci/_vendor/urllib3/contrib/ntlmpool.py index 14507233b4..2cc790b5a1 100644 --- a/src/oci/_vendor/urllib3/contrib/ntlmpool.py +++ b/src/oci/_vendor/urllib3/contrib/ntlmpool.py @@ -47,8 +47,7 @@ def _new_conn(self): log.debug('Starting NTLM HTTPS connection no. %d: https://%s%s', self.num_connections, self.host, self.authurl) - headers = {} - headers['Connection'] = 'Keep-Alive' + headers = {'Connection': 'Keep-Alive'} req_header = 'Authorization' resp_header = 'www-authenticate' diff --git a/src/oci/_vendor/urllib3/contrib/pyopenssl.py b/src/oci/_vendor/urllib3/contrib/pyopenssl.py index 1af764292c..514d08a651 100644 --- a/src/oci/_vendor/urllib3/contrib/pyopenssl.py +++ b/src/oci/_vendor/urllib3/contrib/pyopenssl.py @@ -51,6 +51,12 @@ from cryptography import x509 from cryptography.hazmat.backends.openssl import backend as openssl_backend from cryptography.hazmat.backends.openssl.x509 import _Certificate +try: + from cryptography.x509 import UnsupportedExtension +except ImportError: + # UnsupportedExtension is gone in cryptography >= 2.1.0 + class UnsupportedExtension(Exception): + pass from socket import timeout, error as SocketError from io import BytesIO @@ -161,6 +167,9 @@ def _dnsname_to_stdlib(name): from ASCII bytes. We need to idna-encode that string to get it back, and then on Python 3 we also need to convert to unicode via UTF-8 (the stdlib uses PyUnicode_FromStringAndSize on it, which decodes via UTF-8). + + If the name cannot be idna-encoded then we return None signalling that + the name given should be skipped. """ def idna_encode(name): """ @@ -170,14 +179,19 @@ def idna_encode(name): """ from oci._vendor import idna - for prefix in [u'*.', u'.']: - if name.startswith(prefix): - name = name[len(prefix):] - return prefix.encode('ascii') + idna.encode(name) - return idna.encode(name) + try: + for prefix in [u'*.', u'.']: + if name.startswith(prefix): + name = name[len(prefix):] + return prefix.encode('ascii') + idna.encode(name) + return idna.encode(name) + except idna.core.IDNAError: + return None name = idna_encode(name) - if sys.version_info >= (3, 0): + if name is None: + return None + elif sys.version_info >= (3, 0): name = name.decode('utf-8') return name @@ -203,7 +217,7 @@ def get_subj_alt_name(peer_cert): except x509.ExtensionNotFound: # No such extension, return the empty list. return [] - except (x509.DuplicateExtension, x509.UnsupportedExtension, + except (x509.DuplicateExtension, UnsupportedExtension, x509.UnsupportedGeneralNameType, UnicodeError) as e: # A problem has been found with the quality of the certificate. Assume # no SAN field is present. @@ -221,9 +235,10 @@ def get_subj_alt_name(peer_cert): # Sadly the DNS names need to be idna encoded and then, on Python 3, UTF-8 # decoded. This is pretty frustrating, but that's what the standard library # does with certificates, and so we need to attempt to do the same. + # We also want to skip over names which cannot be idna encoded. names = [ - ('DNS', _dnsname_to_stdlib(name)) - for name in ext.get_values_for_type(x509.DNSName) + ('DNS', name) for name in map(_dnsname_to_stdlib, ext.get_values_for_type(x509.DNSName)) + if name is not None ] names.extend( ('IP Address', str(name)) @@ -271,8 +286,7 @@ def recv(self, *args, **kwargs): else: raise except OpenSSL.SSL.WantReadError: - rd = util.wait_for_read(self.socket, self.socket.gettimeout()) - if not rd: + if not util.wait_for_read(self.socket, self.socket.gettimeout()): raise timeout('The read operation timed out') else: return self.recv(*args, **kwargs) @@ -293,8 +307,7 @@ def recv_into(self, *args, **kwargs): else: raise except OpenSSL.SSL.WantReadError: - rd = util.wait_for_read(self.socket, self.socket.gettimeout()) - if not rd: + if not util.wait_for_read(self.socket, self.socket.gettimeout()): raise timeout('The read operation timed out') else: return self.recv_into(*args, **kwargs) @@ -307,8 +320,7 @@ def _send_until_done(self, data): try: return self.connection.send(data) except OpenSSL.SSL.WantWriteError: - wr = util.wait_for_write(self.socket, self.socket.gettimeout()) - if not wr: + if not util.wait_for_write(self.socket, self.socket.gettimeout()): raise timeout() continue except OpenSSL.SSL.SysCallError as e: @@ -422,7 +434,7 @@ def load_verify_locations(self, cafile=None, capath=None, cadata=None): self._ctx.load_verify_locations(BytesIO(cadata)) def load_cert_chain(self, certfile, keyfile=None, password=None): - self._ctx.use_certificate_file(certfile) + self._ctx.use_certificate_chain_file(certfile) if password is not None: self._ctx.set_passwd_cb(lambda max_length, prompt_twice, userdata: password) self._ctx.use_privatekey_file(keyfile or certfile) @@ -444,8 +456,7 @@ def wrap_socket(self, sock, server_side=False, try: cnx.do_handshake() except OpenSSL.SSL.WantReadError: - rd = util.wait_for_read(sock, sock.gettimeout()) - if not rd: + if not util.wait_for_read(sock, sock.gettimeout()): raise timeout('select timed out') continue except OpenSSL.SSL.Error as e: diff --git a/src/oci/_vendor/urllib3/contrib/securetransport.py b/src/oci/_vendor/urllib3/contrib/securetransport.py index 9e7cdf867d..87c9e5a8b0 100644 --- a/src/oci/_vendor/urllib3/contrib/securetransport.py +++ b/src/oci/_vendor/urllib3/contrib/securetransport.py @@ -55,11 +55,6 @@ _fileobject = None from ..packages.backports.makefile import backport_makefile -try: - memoryview(b'') -except NameError: - raise ImportError("SecureTransport only works on Pythons with memoryview") - __all__ = ['inject_into_urllib3', 'extract_from_urllib3'] # SNI always works @@ -92,7 +87,7 @@ SSL_WRITE_BLOCKSIZE = 16384 # This is our equivalent of util.ssl_.DEFAULT_CIPHERS, but expanded out to -# individual cipher suites. We need to do this becuase this is how +# individual cipher suites. We need to do this because this is how # SecureTransport wants them. CIPHER_SUITES = [ SecurityConst.TLS_AES_256_GCM_SHA384, @@ -199,21 +194,18 @@ def _read_callback(connection_id, data_buffer, data_length_pointer): timeout = wrapped_socket.gettimeout() error = None read_count = 0 - buffer = (ctypes.c_char * requested_length).from_address(data_buffer) - buffer_view = memoryview(buffer) try: while read_count < requested_length: if timeout is None or timeout >= 0: - readables = util.wait_for_read([base_socket], timeout) - if not readables: + if not util.wait_for_read(base_socket, timeout): raise socket.error(errno.EAGAIN, 'timed out') - # We need to tell ctypes that we have a buffer that can be - # written to. Upsettingly, we do that like this: - chunk_size = base_socket.recv_into( - buffer_view[read_count:requested_length] + remaining = requested_length - read_count + buffer = (ctypes.c_char * remaining).from_address( + data_buffer + read_count ) + chunk_size = base_socket.recv_into(buffer, remaining) read_count += chunk_size if not chunk_size: if not read_count: @@ -223,7 +215,8 @@ def _read_callback(connection_id, data_buffer, data_length_pointer): error = e.errno if error is not None and error != errno.EAGAIN: - if error == errno.ECONNRESET: + data_length_pointer[0] = read_count + if error == errno.ECONNRESET or error == errno.EPIPE: return SecurityConst.errSSLClosedAbort raise @@ -261,8 +254,7 @@ def _write_callback(connection_id, data_buffer, data_length_pointer): try: while sent < bytes_to_write: if timeout is None or timeout >= 0: - writables = util.wait_for_write([base_socket], timeout) - if not writables: + if not util.wait_for_write(base_socket, timeout): raise socket.error(errno.EAGAIN, 'timed out') chunk_sent = base_socket.send(data) sent += chunk_sent @@ -274,11 +266,13 @@ def _write_callback(connection_id, data_buffer, data_length_pointer): error = e.errno if error is not None and error != errno.EAGAIN: - if error == errno.ECONNRESET: + data_length_pointer[0] = sent + if error == errno.ECONNRESET or error == errno.EPIPE: return SecurityConst.errSSLClosedAbort raise data_length_pointer[0] = sent + if sent != bytes_to_write: return SecurityConst.errSSLWouldBlock @@ -403,7 +397,7 @@ def _custom_validate(self, verify, trust_bundle): if trust: CoreFoundation.CFRelease(trust) - if cert_array is None: + if cert_array is not None: CoreFoundation.CFRelease(cert_array) # Ok, now we can look at what the result was. diff --git a/src/oci/_vendor/urllib3/contrib/socks.py b/src/oci/_vendor/urllib3/contrib/socks.py index 6d3bf1443d..728440a39b 100644 --- a/src/oci/_vendor/urllib3/contrib/socks.py +++ b/src/oci/_vendor/urllib3/contrib/socks.py @@ -45,6 +45,7 @@ # Socks is not needed for OCI Python SDK so there is no need to # warn the end user of the vendored package. pass + from socket import error as SocketError, timeout as SocketTimeout from ..connection import ( @@ -159,6 +160,10 @@ def __init__(self, proxy_url, username=None, password=None, num_pools=10, headers=None, **connection_pool_kw): parsed = parse_url(proxy_url) + if username is None and password is None and parsed.auth is not None: + split = parsed.auth.split(':') + if len(split) == 2: + username, password = split if parsed.scheme == 'socks5': socks_version = socks.PROXY_TYPE_SOCKS5 rdns = False diff --git a/src/oci/_vendor/urllib3/exceptions.py b/src/oci/_vendor/urllib3/exceptions.py index 083606ed93..2ffde4ee92 100644 --- a/src/oci/_vendor/urllib3/exceptions.py +++ b/src/oci/_vendor/urllib3/exceptions.py @@ -158,7 +158,7 @@ class ResponseError(HTTPError): class SecurityWarning(HTTPWarning): - "Warned when perfoming security reducing actions" + "Warned when performing security reducing actions" pass diff --git a/src/oci/_vendor/urllib3/fields.py b/src/oci/_vendor/urllib3/fields.py index 8e3774d654..7acbea61fa 100644 --- a/src/oci/_vendor/urllib3/fields.py +++ b/src/oci/_vendor/urllib3/fields.py @@ -125,7 +125,7 @@ def _render_parts(self, header_parts): 'Content-Disposition' fields. :param header_parts: - A sequence of (k, v) typles or a :class:`dict` of (k, v) to format + A sequence of (k, v) tuples or a :class:`dict` of (k, v) to format as `k1="v1"; k2="v2"; ...`. """ parts = [] diff --git a/src/oci/_vendor/urllib3/filepost.py b/src/oci/_vendor/urllib3/filepost.py index a5a9c49700..6be2664da1 100644 --- a/src/oci/_vendor/urllib3/filepost.py +++ b/src/oci/_vendor/urllib3/filepost.py @@ -3,9 +3,10 @@ # Copyright 2008-2016 Andrey Petrov and contributors from __future__ import absolute_import +import binascii import codecs +import os -from uuid import uuid4 from io import BytesIO from .packages import six @@ -19,7 +20,10 @@ def choose_boundary(): """ Our embarrassingly-simple replacement for mimetools.choose_boundary. """ - return uuid4().hex + boundary = binascii.hexlify(os.urandom(16)) + if six.PY3: + boundary = boundary.decode('ascii') + return boundary def iter_field_objects(fields): @@ -69,7 +73,7 @@ def encode_multipart_formdata(fields, boundary=None): :param boundary: If not specified, then a random boundary will be generated using - :func:`mimetools.choose_boundary`. + :func:`urllib3.filepost.choose_boundary`. """ body = BytesIO() if boundary is None: diff --git a/src/oci/_vendor/urllib3/packages/backports/makefile.py b/src/oci/_vendor/urllib3/packages/backports/makefile.py index d921346d5e..283cbae455 100644 --- a/src/oci/_vendor/urllib3/packages/backports/makefile.py +++ b/src/oci/_vendor/urllib3/packages/backports/makefile.py @@ -20,7 +20,7 @@ def backport_makefile(self, mode="r", buffering=None, encoding=None, """ Backport of ``socket.makefile`` from Python 3.5. """ - if not set(mode) <= set(["r", "w", "b"]): + if not set(mode) <= {"r", "w", "b"}: raise ValueError( "invalid mode %r (only r, w, b allowed)" % (mode,) ) diff --git a/src/oci/_vendor/urllib3/packages/ordered_dict.py b/src/oci/_vendor/urllib3/packages/ordered_dict.py deleted file mode 100644 index cd18005991..0000000000 --- a/src/oci/_vendor/urllib3/packages/ordered_dict.py +++ /dev/null @@ -1,259 +0,0 @@ -# coding: utf-8 -# Modified Work: Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. -# Copyright 2008-2016 Andrey Petrov and contributors - -try: - from thread import get_ident as _get_ident -except ImportError: - from dummy_thread import get_ident as _get_ident - -try: - from _abcoll import KeysView, ValuesView, ItemsView -except ImportError: - pass - - -class OrderedDict(dict): - 'Dictionary that remembers insertion order' - # An inherited dict maps keys to values. - # The inherited dict provides __getitem__, __len__, __contains__, and get. - # The remaining methods are order-aware. - # Big-O running times for all methods are the same as for regular dictionaries. - - # The internal self.__map dictionary maps keys to links in a doubly linked list. - # The circular doubly linked list starts and ends with a sentinel element. - # The sentinel element never gets deleted (this simplifies the algorithm). - # Each link is stored as a list of length three: [PREV, NEXT, KEY]. - - def __init__(self, *args, **kwds): - '''Initialize an ordered dictionary. Signature is the same as for - regular dictionaries, but keyword arguments are not recommended - because their insertion order is arbitrary. - - ''' - if len(args) > 1: - raise TypeError('expected at most 1 arguments, got %d' % len(args)) - try: - self.__root - except AttributeError: - self.__root = root = [] # sentinel node - root[:] = [root, root, None] - self.__map = {} - self.__update(*args, **kwds) - - def __setitem__(self, key, value, dict_setitem=dict.__setitem__): - 'od.__setitem__(i, y) <==> od[i]=y' - # Setting a new item creates a new link which goes at the end of the linked - # list, and the inherited dictionary is updated with the new key/value pair. - if key not in self: - root = self.__root - last = root[0] - last[1] = root[0] = self.__map[key] = [last, root, key] - dict_setitem(self, key, value) - - def __delitem__(self, key, dict_delitem=dict.__delitem__): - 'od.__delitem__(y) <==> del od[y]' - # Deleting an existing item uses self.__map to find the link which is - # then removed by updating the links in the predecessor and successor nodes. - dict_delitem(self, key) - link_prev, link_next, key = self.__map.pop(key) - link_prev[1] = link_next - link_next[0] = link_prev - - def __iter__(self): - 'od.__iter__() <==> iter(od)' - root = self.__root - curr = root[1] - while curr is not root: - yield curr[2] - curr = curr[1] - - def __reversed__(self): - 'od.__reversed__() <==> reversed(od)' - root = self.__root - curr = root[0] - while curr is not root: - yield curr[2] - curr = curr[0] - - def clear(self): - 'od.clear() -> None. Remove all items from od.' - try: - for node in self.__map.itervalues(): - del node[:] - root = self.__root - root[:] = [root, root, None] - self.__map.clear() - except AttributeError: - pass - dict.clear(self) - - def popitem(self, last=True): - '''od.popitem() -> (k, v), return and remove a (key, value) pair. - Pairs are returned in LIFO order if last is true or FIFO order if false. - - ''' - if not self: - raise KeyError('dictionary is empty') - root = self.__root - if last: - link = root[0] - link_prev = link[0] - link_prev[1] = root - root[0] = link_prev - else: - link = root[1] - link_next = link[1] - root[1] = link_next - link_next[0] = root - key = link[2] - del self.__map[key] - value = dict.pop(self, key) - return key, value - - # -- the following methods do not depend on the internal structure -- - - def keys(self): - 'od.keys() -> list of keys in od' - return list(self) - - def values(self): - 'od.values() -> list of values in od' - return [self[key] for key in self] - - def items(self): - 'od.items() -> list of (key, value) pairs in od' - return [(key, self[key]) for key in self] - - def iterkeys(self): - 'od.iterkeys() -> an iterator over the keys in od' - return iter(self) - - def itervalues(self): - 'od.itervalues -> an iterator over the values in od' - for k in self: - yield self[k] - - def iteritems(self): - 'od.iteritems -> an iterator over the (key, value) items in od' - for k in self: - yield (k, self[k]) - - def update(*args, **kwds): - '''od.update(E, **F) -> None. Update od from dict/iterable E and F. - - If E is a dict instance, does: for k in E: od[k] = E[k] - If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] - Or if E is an iterable of items, does: for k, v in E: od[k] = v - In either case, this is followed by: for k, v in F.items(): od[k] = v - - ''' - if len(args) > 2: - raise TypeError('update() takes at most 2 positional ' - 'arguments (%d given)' % (len(args),)) - elif not args: - raise TypeError('update() takes at least 1 argument (0 given)') - self = args[0] - # Make progressively weaker assumptions about "other" - other = () - if len(args) == 2: - other = args[1] - if isinstance(other, dict): - for key in other: - self[key] = other[key] - elif hasattr(other, 'keys'): - for key in other.keys(): - self[key] = other[key] - else: - for key, value in other: - self[key] = value - for key, value in kwds.items(): - self[key] = value - - __update = update # let subclasses override update without breaking __init__ - - __marker = object() - - def pop(self, key, default=__marker): - '''od.pop(k[,d]) -> v, remove specified key and return the corresponding value. - If key is not found, d is returned if given, otherwise KeyError is raised. - - ''' - if key in self: - result = self[key] - del self[key] - return result - if default is self.__marker: - raise KeyError(key) - return default - - def setdefault(self, key, default=None): - 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' - if key in self: - return self[key] - self[key] = default - return default - - def __repr__(self, _repr_running={}): - 'od.__repr__() <==> repr(od)' - call_key = id(self), _get_ident() - if call_key in _repr_running: - return '...' - _repr_running[call_key] = 1 - try: - if not self: - return '%s()' % (self.__class__.__name__,) - return '%s(%r)' % (self.__class__.__name__, self.items()) - finally: - del _repr_running[call_key] - - def __reduce__(self): - 'Return state information for pickling' - items = [[k, self[k]] for k in self] - inst_dict = vars(self).copy() - for k in vars(OrderedDict()): - inst_dict.pop(k, None) - if inst_dict: - return (self.__class__, (items,), inst_dict) - return self.__class__, (items,) - - def copy(self): - 'od.copy() -> a shallow copy of od' - return self.__class__(self) - - @classmethod - def fromkeys(cls, iterable, value=None): - '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S - and values equal to v (which defaults to None). - - ''' - d = cls() - for key in iterable: - d[key] = value - return d - - def __eq__(self, other): - '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive - while comparison to a regular mapping is order-insensitive. - - ''' - if isinstance(other, OrderedDict): - return len(self)==len(other) and self.items() == other.items() - return dict.__eq__(self, other) - - def __ne__(self, other): - return not self == other - - # -- the following methods are only used in Python 2.7 -- - - def viewkeys(self): - "od.viewkeys() -> a set-like object providing a view on od's keys" - return KeysView(self) - - def viewvalues(self): - "od.viewvalues() -> an object providing a view on od's values" - return ValuesView(self) - - def viewitems(self): - "od.viewitems() -> a set-like object providing a view on od's items" - return ItemsView(self) diff --git a/src/oci/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py b/src/oci/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py index 163390b6c6..ca1d867935 100644 --- a/src/oci/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py +++ b/src/oci/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py @@ -13,8 +13,7 @@ # ipaddress has been backported to 2.6+ in pypi. If it is installed on the # system, use it to handle IPAddress ServerAltnames (this was added in # python-3.5) otherwise only do DNS matching. This allows -# backports.ssl_match_hostname to continue to be used all the way back to -# python-2.4. +# backports.ssl_match_hostname to continue to be used in Python 2.7. try: import ipaddress except ImportError: diff --git a/src/oci/_vendor/urllib3/poolmanager.py b/src/oci/_vendor/urllib3/poolmanager.py index 54ec3a0f27..29be8759cf 100644 --- a/src/oci/_vendor/urllib3/poolmanager.py +++ b/src/oci/_vendor/urllib3/poolmanager.py @@ -51,6 +51,7 @@ 'key__socks_options', # dict 'key_assert_hostname', # bool or string 'key_assert_fingerprint', # str + 'key_server_hostname', #str ) #: The namedtuple class used to construct keys for the connection pool. @@ -316,8 +317,9 @@ def urlopen(self, method, url, redirect=True, **kw): kw['assert_same_host'] = False kw['redirect'] = False + if 'headers' not in kw: - kw['headers'] = self.headers + kw['headers'] = self.headers.copy() if self.proxy is not None and u.scheme == "http": response = conn.urlopen(method, url, **kw) @@ -339,6 +341,14 @@ def urlopen(self, method, url, redirect=True, **kw): if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect) + # Strip headers marked as unsafe to forward to the redirected location. + # Check remove_headers_on_redirect to avoid a potential network call within + # conn.is_same_host() which may use socket.gethostbyname() in the future. + if (retries.remove_headers_on_redirect + and not conn.is_same_host(redirect_location)): + for header in retries.remove_headers_on_redirect: + kw['headers'].pop(header, None) + try: retries = retries.increment(method, url, response=response, _pool=conn) except MaxRetryError: @@ -362,7 +372,7 @@ class ProxyManager(PoolManager): The URL of the proxy to be used. :param proxy_headers: - A dictionary contaning headers that will be sent to the proxy. In case + A dictionary containing headers that will be sent to the proxy. In case of HTTP they are being sent with each request, while in the HTTPS/CONNECT case they are sent only once. Could be used for proxy authentication. diff --git a/src/oci/_vendor/urllib3/request.py b/src/oci/_vendor/urllib3/request.py index 5bbe6b9ed5..b95b7a85e2 100644 --- a/src/oci/_vendor/urllib3/request.py +++ b/src/oci/_vendor/urllib3/request.py @@ -40,7 +40,7 @@ class RequestMethods(object): explicitly. """ - _encode_url_methods = set(['DELETE', 'GET', 'HEAD', 'OPTIONS']) + _encode_url_methods = {'DELETE', 'GET', 'HEAD', 'OPTIONS'} def __init__(self, headers=None): self.headers = headers or {} @@ -48,8 +48,8 @@ def __init__(self, headers=None): def urlopen(self, method, url, body=None, headers=None, encode_multipart=True, multipart_boundary=None, **kw): # Abstract - raise NotImplemented("Classes extending RequestMethods must implement " - "their own ``urlopen`` method.") + raise NotImplementedError("Classes extending RequestMethods must implement " + "their own ``urlopen`` method.") def request(self, method, url, fields=None, headers=None, **urlopen_kw): """ @@ -64,6 +64,8 @@ def request(self, method, url, fields=None, headers=None, **urlopen_kw): """ method = method.upper() + urlopen_kw['request_url'] = url + if method in self._encode_url_methods: return self.request_encode_url(method, url, fields=fields, headers=headers, @@ -121,7 +123,7 @@ def request_encode_body(self, method, url, fields=None, headers=None, } When uploading a file, providing a filename (the first parameter of the - tuple) is optional but recommended to best mimick behavior of browsers. + tuple) is optional but recommended to best mimic behavior of browsers. Note that if ``headers`` are supplied, the 'Content-Type' header will be overwritten because it depends on the dynamic random boundary string diff --git a/src/oci/_vendor/urllib3/response.py b/src/oci/_vendor/urllib3/response.py index 405b61dac4..0a72cdf0b3 100644 --- a/src/oci/_vendor/urllib3/response.py +++ b/src/oci/_vendor/urllib3/response.py @@ -15,7 +15,7 @@ BodyNotHttplibCompatible, ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked, IncompleteRead, InvalidHeader ) -from .packages.six import string_types as basestring, binary_type, PY3 +from .packages.six import string_types as basestring, PY3 from .packages.six.moves import http_client as httplib from .connection import HTTPException, BaseSSLError from .util.response import is_fp_closed, is_response_to_head @@ -27,7 +27,7 @@ class DeflateDecoder(object): def __init__(self): self._first_try = True - self._data = binary_type() + self._data = b'' self._obj = zlib.decompressobj() def __getattr__(self, name): @@ -56,21 +56,69 @@ def decompress(self, data): self._data = None +class GzipDecoderState(object): + + FIRST_MEMBER = 0 + OTHER_MEMBERS = 1 + SWALLOW_DATA = 2 + + class GzipDecoder(object): def __init__(self): self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS) + self._state = GzipDecoderState.FIRST_MEMBER def __getattr__(self, name): return getattr(self._obj, name) def decompress(self, data): - if not data: - return data - return self._obj.decompress(data) + ret = bytearray() + if self._state == GzipDecoderState.SWALLOW_DATA or not data: + return bytes(ret) + while True: + try: + ret += self._obj.decompress(data) + except zlib.error: + previous_state = self._state + # Ignore data after the first error + self._state = GzipDecoderState.SWALLOW_DATA + if previous_state == GzipDecoderState.OTHER_MEMBERS: + # Allow trailing garbage acceptable in other gzip clients + return bytes(ret) + raise + data = self._obj.unused_data + if not data: + return bytes(ret) + self._state = GzipDecoderState.OTHER_MEMBERS + self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS) + + +class MultiDecoder(object): + """ + From RFC7231: + If one or more encodings have been applied to a representation, the + sender that applied the encodings MUST generate a Content-Encoding + header field that lists the content codings in the order in which + they were applied. + """ + + def __init__(self, modes): + self._decoders = [_get_decoder(m.strip()) for m in modes.split(',')] + + def flush(self): + return self._decoders[0].flush() + + def decompress(self, data): + for d in reversed(self._decoders): + data = d.decompress(data) + return data def _get_decoder(mode): + if ',' in mode: + return MultiDecoder(mode) + if mode == 'gzip': return GzipDecoder() @@ -93,9 +141,8 @@ class is also compatible with the Python standard library's :mod:`io` If True, the response's body will be preloaded during construction. :param decode_content: - If True, attempts to decode specific content-encoding's based on headers - (like 'gzip' and 'deflate') will be skipped and raw data will be used - instead. + If True, will attempt to decode the body based on the + 'content-encoding' header. :param original_response: When this HTTPResponse wrapper is generated from an httplib.HTTPResponse @@ -116,8 +163,9 @@ class is also compatible with the Python standard library's :mod:`io` def __init__(self, body='', headers=None, status=0, version=0, reason=None, strict=0, preload_content=True, decode_content=True, - original_response=None, pool=None, connection=None, - retries=None, enforce_content_length=False, request_method=None): + original_response=None, pool=None, connection=None, msg=None, + retries=None, enforce_content_length=False, + request_method=None, request_url=None): if isinstance(headers, HTTPHeaderDict): self.headers = headers @@ -136,8 +184,10 @@ def __init__(self, body='', headers=None, status=0, version=0, reason=None, self._fp = None self._original_response = original_response self._fp_bytes_read = 0 + self.msg = msg + self._request_url = request_url - if body and isinstance(body, (basestring, binary_type)): + if body and isinstance(body, (basestring, bytes)): self._body = body self._pool = pool @@ -195,6 +245,9 @@ def data(self): def connection(self): return self._connection + def isclosed(self): + return is_fp_closed(self._fp) + def tell(self): """ Obtain the number of bytes pulled over the wire so far. May differ from @@ -209,18 +262,18 @@ def _init_length(self, request_method): """ length = self.headers.get('content-length') - if length is not None and self.chunked: - # This Response will fail with an IncompleteRead if it can't be - # received as chunked. This method falls back to attempt reading - # the response before raising an exception. - log.warning("Received response with both Content-Length and " - "Transfer-Encoding set. This is expressly forbidden " - "by RFC 7230 sec 3.3.2. Ignoring Content-Length and " - "attempting to process response as Transfer-Encoding: " - "chunked.") - return None - - elif length is not None: + if length is not None: + if self.chunked: + # This Response will fail with an IncompleteRead if it can't be + # received as chunked. This method falls back to attempt reading + # the response before raising an exception. + log.warning("Received response with both Content-Length and " + "Transfer-Encoding set. This is expressly forbidden " + "by RFC 7230 sec 3.3.2. Ignoring Content-Length and " + "attempting to process response as Transfer-Encoding: " + "chunked.") + return None + try: # RFC 7230 section 3.3.2 specifies multiple content lengths can # be sent in a single Content-Length header @@ -258,8 +311,13 @@ def _init_decoder(self): # Note: content-encoding value should be case-insensitive, per RFC 7230 # Section 3.2 content_encoding = self.headers.get('content-encoding', '').lower() - if self._decoder is None and content_encoding in self.CONTENT_DECODERS: - self._decoder = _get_decoder(content_encoding) + if self._decoder is None: + if content_encoding in self.CONTENT_DECODERS: + self._decoder = _get_decoder(content_encoding) + elif ',' in content_encoding: + encodings = [e.strip() for e in content_encoding.split(',') if e.strip() in self.CONTENT_DECODERS] + if len(encodings): + self._decoder = _get_decoder(content_encoding) def _decode(self, data, decode_content, flush_decoder): """ @@ -577,6 +635,11 @@ def read_chunked(self, amt=None, decode_content=None): Similar to :meth:`HTTPResponse.read`, but with an additional parameter: ``decode_content``. + :param amt: + How much of the content to read. If specified, caching is skipped + because it doesn't make sense to cache partial content as the full + response. + :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. @@ -592,12 +655,17 @@ def read_chunked(self, amt=None, decode_content=None): "Body should be httplib.HTTPResponse like. " "It should have have an fp attribute which returns raw chunks.") - # Don't bother reading the body of a HEAD request. - if self._original_response and is_response_to_head(self._original_response): - self._original_response.close() - return - with self._error_catcher(): + # Don't bother reading the body of a HEAD request. + if self._original_response and is_response_to_head(self._original_response): + self._original_response.close() + return + + # If a response is already read and closed + # then return immediately. + if self._fp.fp is None: + return + while True: self._update_chunk_length() if self.chunk_left == 0: @@ -628,3 +696,14 @@ def read_chunked(self, amt=None, decode_content=None): # We read everything; close the "file". if self._original_response: self._original_response.close() + + def geturl(self): + """ + Returns the URL that was the source of this response. + If the request that generated this response redirected, this method + will return the final redirect location. + """ + if self.retries is not None and len(self.retries.history): + return self.retries.history[-1].redirect_location + else: + return self._request_url diff --git a/src/oci/_vendor/urllib3/util/connection.py b/src/oci/_vendor/urllib3/util/connection.py index b073818fb6..c9208f93b9 100644 --- a/src/oci/_vendor/urllib3/util/connection.py +++ b/src/oci/_vendor/urllib3/util/connection.py @@ -4,8 +4,8 @@ from __future__ import absolute_import import socket -from .wait import wait_for_read -from .selectors import HAS_SELECT, SelectorError +from .wait import NoWayToWaitForSocketError, wait_for_read +from ..contrib import _appengine_environ def is_connection_dropped(conn): # Platform-specific @@ -23,14 +23,11 @@ def is_connection_dropped(conn): # Platform-specific return False if sock is None: # Connection already closed (such as by httplib). return True - - if not HAS_SELECT: - return False - try: - return bool(wait_for_read(sock, timeout=0.0)) - except SelectorError: - return True + # Returns True if readable, which here means it's been dropped + return wait_for_read(sock, timeout=0.0) + except NoWayToWaitForSocketError: # Platform-specific: AppEngine + return False # This function is copied from socket.py in the Python 2.7 standard @@ -113,6 +110,13 @@ def _has_ipv6(host): sock = None has_ipv6 = False + # App Engine doesn't support IPV6 sockets and actually has a quota on the + # number of sockets that can be used, so just early out here instead of + # creating a socket needlessly. + # See https://github.com/urllib3/urllib3/issues/1446 + if _appengine_environ.is_appengine_sandbox(): + return False + if socket.has_ipv6: # has_ipv6 returns true if cPython was compiled with IPv6 support. # It does not tell us if the system has IPv6 support enabled. To diff --git a/src/oci/_vendor/urllib3/util/queue.py b/src/oci/_vendor/urllib3/util/queue.py new file mode 100644 index 0000000000..8b963d1fe5 --- /dev/null +++ b/src/oci/_vendor/urllib3/util/queue.py @@ -0,0 +1,25 @@ +# coding: utf-8 +# Modified Work: Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright 2008-2016 Andrey Petrov and contributors + +import collections +from ..packages import six +from ..packages.six.moves import queue + +if six.PY2: + # Queue is imported for side effects on MS Windows. See issue #229. + import Queue as _unused_module_Queue # noqa: F401 + + +class LifoQueue(queue.Queue): + def _init(self, _): + self.queue = collections.deque() + + def _qsize(self, len=len): + return len(self.queue) + + def _put(self, item): + self.queue.append(item) + + def _get(self): + return self.queue.pop() diff --git a/src/oci/_vendor/urllib3/util/response.py b/src/oci/_vendor/urllib3/util/response.py index cf50ac0c67..79d7c6e077 100644 --- a/src/oci/_vendor/urllib3/util/response.py +++ b/src/oci/_vendor/urllib3/util/response.py @@ -63,8 +63,14 @@ def assert_header_parsing(headers): get_payload = getattr(headers, 'get_payload', None) unparsed_data = None - if get_payload: # Platform-specific: Python 3. - unparsed_data = get_payload() + if get_payload: + # get_payload is actually email.message.Message.get_payload; + # we're only interested in the result if it's not a multipart message + if not headers.is_multipart(): + payload = get_payload() + + if isinstance(payload, (bytes, str)): + unparsed_data = payload if defects or unparsed_data: raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data) diff --git a/src/oci/_vendor/urllib3/util/retry.py b/src/oci/_vendor/urllib3/util/retry.py index 15a74f60ed..da61f58928 100644 --- a/src/oci/_vendor/urllib3/util/retry.py +++ b/src/oci/_vendor/urllib3/util/retry.py @@ -23,6 +23,7 @@ log = logging.getLogger(__name__) + # Data structure for representing the metadata of requests that result in a retry. RequestHistory = namedtuple('RequestHistory', ["method", "url", "error", "status", "redirect_location"]) @@ -118,7 +119,7 @@ class Retry(object): (most errors are resolved immediately by a second try without a delay). urllib3 will sleep for:: - {backoff factor} * (2 ^ ({number of total retries} - 1)) + {backoff factor} * (2 ** ({number of total retries} - 1)) seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer @@ -143,6 +144,10 @@ class Retry(object): Whether to respect Retry-After header on status codes defined as :attr:`Retry.RETRY_AFTER_STATUS_CODES` or not. + :param iterable remove_headers_on_redirect: + Sequence of headers to remove from the request when a response + indicating a redirect is returned before firing off the redirected + request. """ DEFAULT_METHOD_WHITELIST = frozenset([ @@ -150,13 +155,16 @@ class Retry(object): RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503]) + DEFAULT_REDIRECT_HEADERS_BLACKLIST = frozenset(['Authorization']) + #: Maximum backoff time. BACKOFF_MAX = 120 def __init__(self, total=10, connect=None, read=None, redirect=None, status=None, method_whitelist=DEFAULT_METHOD_WHITELIST, status_forcelist=None, backoff_factor=0, raise_on_redirect=True, raise_on_status=True, - history=None, respect_retry_after_header=True): + history=None, respect_retry_after_header=True, + remove_headers_on_redirect=DEFAULT_REDIRECT_HEADERS_BLACKLIST): self.total = total self.connect = connect @@ -175,6 +183,7 @@ def __init__(self, total=10, connect=None, read=None, redirect=None, status=None self.raise_on_status = raise_on_status self.history = history or tuple() self.respect_retry_after_header = respect_retry_after_header + self.remove_headers_on_redirect = remove_headers_on_redirect def new(self, **kw): params = dict( @@ -186,6 +195,7 @@ def new(self, **kw): raise_on_redirect=self.raise_on_redirect, raise_on_status=self.raise_on_status, history=self.history, + remove_headers_on_redirect=self.remove_headers_on_redirect ) params.update(kw) return type(self)(**params) diff --git a/src/oci/_vendor/urllib3/util/selectors.py b/src/oci/_vendor/urllib3/util/selectors.py deleted file mode 100644 index 1218eacbbb..0000000000 --- a/src/oci/_vendor/urllib3/util/selectors.py +++ /dev/null @@ -1,585 +0,0 @@ -# coding: utf-8 -# Modified Work: Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. -# Copyright 2008-2016 Andrey Petrov and contributors - -# Backport of selectors.py from Python 3.5+ to support Python < 3.4 -# Also has the behavior specified in PEP 475 which is to retry syscalls -# in the case of an EINTR error. This module is required because selectors34 -# does not follow this behavior and instead returns that no dile descriptor -# events have occurred rather than retry the syscall. The decision to drop -# support for select.devpoll is made to maintain 100% test coverage. - -import errno -import math -import select -import socket -import sys -import time -from collections import namedtuple, Mapping - -try: - monotonic = time.monotonic -except (AttributeError, ImportError): # Python 3.3< - monotonic = time.time - -EVENT_READ = (1 << 0) -EVENT_WRITE = (1 << 1) - -HAS_SELECT = True # Variable that shows whether the platform has a selector. -_SYSCALL_SENTINEL = object() # Sentinel in case a system call returns None. -_DEFAULT_SELECTOR = None - - -class SelectorError(Exception): - def __init__(self, errcode): - super(SelectorError, self).__init__() - self.errno = errcode - - def __repr__(self): - return "".format(self.errno) - - def __str__(self): - return self.__repr__() - - -def _fileobj_to_fd(fileobj): - """ Return a file descriptor from a file object. If - given an integer will simply return that integer back. """ - if isinstance(fileobj, int): - fd = fileobj - else: - try: - fd = int(fileobj.fileno()) - except (AttributeError, TypeError, ValueError): - raise ValueError("Invalid file object: {0!r}".format(fileobj)) - if fd < 0: - raise ValueError("Invalid file descriptor: {0}".format(fd)) - return fd - - -# Determine which function to use to wrap system calls because Python 3.5+ -# already handles the case when system calls are interrupted. -if sys.version_info >= (3, 5): - def _syscall_wrapper(func, _, *args, **kwargs): - """ This is the short-circuit version of the below logic - because in Python 3.5+ all system calls automatically restart - and recalculate their timeouts. """ - try: - return func(*args, **kwargs) - except (OSError, IOError, select.error) as e: - errcode = None - if hasattr(e, "errno"): - errcode = e.errno - raise SelectorError(errcode) -else: - def _syscall_wrapper(func, recalc_timeout, *args, **kwargs): - """ Wrapper function for syscalls that could fail due to EINTR. - All functions should be retried if there is time left in the timeout - in accordance with PEP 475. """ - timeout = kwargs.get("timeout", None) - if timeout is None: - expires = None - recalc_timeout = False - else: - timeout = float(timeout) - if timeout < 0.0: # Timeout less than 0 treated as no timeout. - expires = None - else: - expires = monotonic() + timeout - - args = list(args) - if recalc_timeout and "timeout" not in kwargs: - raise ValueError( - "Timeout must be in args or kwargs to be recalculated") - - result = _SYSCALL_SENTINEL - while result is _SYSCALL_SENTINEL: - try: - result = func(*args, **kwargs) - # OSError is thrown by select.select - # IOError is thrown by select.epoll.poll - # select.error is thrown by select.poll.poll - # Aren't we thankful for Python 3.x rework for exceptions? - except (OSError, IOError, select.error) as e: - # select.error wasn't a subclass of OSError in the past. - errcode = None - if hasattr(e, "errno"): - errcode = e.errno - elif hasattr(e, "args"): - errcode = e.args[0] - - # Also test for the Windows equivalent of EINTR. - is_interrupt = (errcode == errno.EINTR or (hasattr(errno, "WSAEINTR") and - errcode == errno.WSAEINTR)) - - if is_interrupt: - if expires is not None: - current_time = monotonic() - if current_time > expires: - raise OSError(errno=errno.ETIMEDOUT) - if recalc_timeout: - if "timeout" in kwargs: - kwargs["timeout"] = expires - current_time - continue - if errcode: - raise SelectorError(errcode) - else: - raise - return result - - -SelectorKey = namedtuple('SelectorKey', ['fileobj', 'fd', 'events', 'data']) - - -class _SelectorMapping(Mapping): - """ Mapping of file objects to selector keys """ - - def __init__(self, selector): - self._selector = selector - - def __len__(self): - return len(self._selector._fd_to_key) - - def __getitem__(self, fileobj): - try: - fd = self._selector._fileobj_lookup(fileobj) - return self._selector._fd_to_key[fd] - except KeyError: - raise KeyError("{0!r} is not registered.".format(fileobj)) - - def __iter__(self): - return iter(self._selector._fd_to_key) - - -class BaseSelector(object): - """ Abstract Selector class - - A selector supports registering file objects to be monitored - for specific I/O events. - - A file object is a file descriptor or any object with a - `fileno()` method. An arbitrary object can be attached to the - file object which can be used for example to store context info, - a callback, etc. - - A selector can use various implementations (select(), poll(), epoll(), - and kqueue()) depending on the platform. The 'DefaultSelector' class uses - the most efficient implementation for the current platform. - """ - def __init__(self): - # Maps file descriptors to keys. - self._fd_to_key = {} - - # Read-only mapping returned by get_map() - self._map = _SelectorMapping(self) - - def _fileobj_lookup(self, fileobj): - """ Return a file descriptor from a file object. - This wraps _fileobj_to_fd() to do an exhaustive - search in case the object is invalid but we still - have it in our map. Used by unregister() so we can - unregister an object that was previously registered - even if it is closed. It is also used by _SelectorMapping - """ - try: - return _fileobj_to_fd(fileobj) - except ValueError: - - # Search through all our mapped keys. - for key in self._fd_to_key.values(): - if key.fileobj is fileobj: - return key.fd - - # Raise ValueError after all. - raise - - def register(self, fileobj, events, data=None): - """ Register a file object for a set of events to monitor. """ - if (not events) or (events & ~(EVENT_READ | EVENT_WRITE)): - raise ValueError("Invalid events: {0!r}".format(events)) - - key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data) - - if key.fd in self._fd_to_key: - raise KeyError("{0!r} (FD {1}) is already registered" - .format(fileobj, key.fd)) - - self._fd_to_key[key.fd] = key - return key - - def unregister(self, fileobj): - """ Unregister a file object from being monitored. """ - try: - key = self._fd_to_key.pop(self._fileobj_lookup(fileobj)) - except KeyError: - raise KeyError("{0!r} is not registered".format(fileobj)) - - # Getting the fileno of a closed socket on Windows errors with EBADF. - except socket.error as e: # Platform-specific: Windows. - if e.errno != errno.EBADF: - raise - else: - for key in self._fd_to_key.values(): - if key.fileobj is fileobj: - self._fd_to_key.pop(key.fd) - break - else: - raise KeyError("{0!r} is not registered".format(fileobj)) - return key - - def modify(self, fileobj, events, data=None): - """ Change a registered file object monitored events and data. """ - # NOTE: Some subclasses optimize this operation even further. - try: - key = self._fd_to_key[self._fileobj_lookup(fileobj)] - except KeyError: - raise KeyError("{0!r} is not registered".format(fileobj)) - - if events != key.events: - self.unregister(fileobj) - key = self.register(fileobj, events, data) - - elif data != key.data: - # Use a shortcut to update the data. - key = key._replace(data=data) - self._fd_to_key[key.fd] = key - - return key - - def select(self, timeout=None): - """ Perform the actual selection until some monitored file objects - are ready or the timeout expires. """ - raise NotImplementedError() - - def close(self): - """ Close the selector. This must be called to ensure that all - underlying resources are freed. """ - self._fd_to_key.clear() - self._map = None - - def get_key(self, fileobj): - """ Return the key associated with a registered file object. """ - mapping = self.get_map() - if mapping is None: - raise RuntimeError("Selector is closed") - try: - return mapping[fileobj] - except KeyError: - raise KeyError("{0!r} is not registered".format(fileobj)) - - def get_map(self): - """ Return a mapping of file objects to selector keys """ - return self._map - - def _key_from_fd(self, fd): - """ Return the key associated to a given file descriptor - Return None if it is not found. """ - try: - return self._fd_to_key[fd] - except KeyError: - return None - - def __enter__(self): - return self - - def __exit__(self, *args): - self.close() - - -# Almost all platforms have select.select() -if hasattr(select, "select"): - class SelectSelector(BaseSelector): - """ Select-based selector. """ - def __init__(self): - super(SelectSelector, self).__init__() - self._readers = set() - self._writers = set() - - def register(self, fileobj, events, data=None): - key = super(SelectSelector, self).register(fileobj, events, data) - if events & EVENT_READ: - self._readers.add(key.fd) - if events & EVENT_WRITE: - self._writers.add(key.fd) - return key - - def unregister(self, fileobj): - key = super(SelectSelector, self).unregister(fileobj) - self._readers.discard(key.fd) - self._writers.discard(key.fd) - return key - - def _select(self, r, w, timeout=None): - """ Wrapper for select.select because timeout is a positional arg """ - return select.select(r, w, [], timeout) - - def select(self, timeout=None): - # Selecting on empty lists on Windows errors out. - if not len(self._readers) and not len(self._writers): - return [] - - timeout = None if timeout is None else max(timeout, 0.0) - ready = [] - r, w, _ = _syscall_wrapper(self._select, True, self._readers, - self._writers, timeout) - r = set(r) - w = set(w) - for fd in r | w: - events = 0 - if fd in r: - events |= EVENT_READ - if fd in w: - events |= EVENT_WRITE - - key = self._key_from_fd(fd) - if key: - ready.append((key, events & key.events)) - return ready - - -if hasattr(select, "poll"): - class PollSelector(BaseSelector): - """ Poll-based selector """ - def __init__(self): - super(PollSelector, self).__init__() - self._poll = select.poll() - - def register(self, fileobj, events, data=None): - key = super(PollSelector, self).register(fileobj, events, data) - event_mask = 0 - if events & EVENT_READ: - event_mask |= select.POLLIN - if events & EVENT_WRITE: - event_mask |= select.POLLOUT - self._poll.register(key.fd, event_mask) - return key - - def unregister(self, fileobj): - key = super(PollSelector, self).unregister(fileobj) - self._poll.unregister(key.fd) - return key - - def _wrap_poll(self, timeout=None): - """ Wrapper function for select.poll.poll() so that - _syscall_wrapper can work with only seconds. """ - if timeout is not None: - if timeout <= 0: - timeout = 0 - else: - # select.poll.poll() has a resolution of 1 millisecond, - # round away from zero to wait *at least* timeout seconds. - timeout = math.ceil(timeout * 1e3) - - result = self._poll.poll(timeout) - return result - - def select(self, timeout=None): - ready = [] - fd_events = _syscall_wrapper(self._wrap_poll, True, timeout=timeout) - for fd, event_mask in fd_events: - events = 0 - if event_mask & ~select.POLLIN: - events |= EVENT_WRITE - if event_mask & ~select.POLLOUT: - events |= EVENT_READ - - key = self._key_from_fd(fd) - if key: - ready.append((key, events & key.events)) - - return ready - - -if hasattr(select, "epoll"): - class EpollSelector(BaseSelector): - """ Epoll-based selector """ - def __init__(self): - super(EpollSelector, self).__init__() - self._epoll = select.epoll() - - def fileno(self): - return self._epoll.fileno() - - def register(self, fileobj, events, data=None): - key = super(EpollSelector, self).register(fileobj, events, data) - events_mask = 0 - if events & EVENT_READ: - events_mask |= select.EPOLLIN - if events & EVENT_WRITE: - events_mask |= select.EPOLLOUT - _syscall_wrapper(self._epoll.register, False, key.fd, events_mask) - return key - - def unregister(self, fileobj): - key = super(EpollSelector, self).unregister(fileobj) - try: - _syscall_wrapper(self._epoll.unregister, False, key.fd) - except SelectorError: - # This can occur when the fd was closed since registry. - pass - return key - - def select(self, timeout=None): - if timeout is not None: - if timeout <= 0: - timeout = 0.0 - else: - # select.epoll.poll() has a resolution of 1 millisecond - # but luckily takes seconds so we don't need a wrapper - # like PollSelector. Just for better rounding. - timeout = math.ceil(timeout * 1e3) * 1e-3 - timeout = float(timeout) - else: - timeout = -1.0 # epoll.poll() must have a float. - - # We always want at least 1 to ensure that select can be called - # with no file descriptors registered. Otherwise will fail. - max_events = max(len(self._fd_to_key), 1) - - ready = [] - fd_events = _syscall_wrapper(self._epoll.poll, True, - timeout=timeout, - maxevents=max_events) - for fd, event_mask in fd_events: - events = 0 - if event_mask & ~select.EPOLLIN: - events |= EVENT_WRITE - if event_mask & ~select.EPOLLOUT: - events |= EVENT_READ - - key = self._key_from_fd(fd) - if key: - ready.append((key, events & key.events)) - return ready - - def close(self): - self._epoll.close() - super(EpollSelector, self).close() - - -if hasattr(select, "kqueue"): - class KqueueSelector(BaseSelector): - """ Kqueue / Kevent-based selector """ - def __init__(self): - super(KqueueSelector, self).__init__() - self._kqueue = select.kqueue() - - def fileno(self): - return self._kqueue.fileno() - - def register(self, fileobj, events, data=None): - key = super(KqueueSelector, self).register(fileobj, events, data) - if events & EVENT_READ: - kevent = select.kevent(key.fd, - select.KQ_FILTER_READ, - select.KQ_EV_ADD) - - _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0) - - if events & EVENT_WRITE: - kevent = select.kevent(key.fd, - select.KQ_FILTER_WRITE, - select.KQ_EV_ADD) - - _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0) - - return key - - def unregister(self, fileobj): - key = super(KqueueSelector, self).unregister(fileobj) - if key.events & EVENT_READ: - kevent = select.kevent(key.fd, - select.KQ_FILTER_READ, - select.KQ_EV_DELETE) - try: - _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0) - except SelectorError: - pass - if key.events & EVENT_WRITE: - kevent = select.kevent(key.fd, - select.KQ_FILTER_WRITE, - select.KQ_EV_DELETE) - try: - _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0) - except SelectorError: - pass - - return key - - def select(self, timeout=None): - if timeout is not None: - timeout = max(timeout, 0) - - max_events = len(self._fd_to_key) * 2 - ready_fds = {} - - kevent_list = _syscall_wrapper(self._kqueue.control, True, - None, max_events, timeout) - - for kevent in kevent_list: - fd = kevent.ident - event_mask = kevent.filter - events = 0 - if event_mask == select.KQ_FILTER_READ: - events |= EVENT_READ - if event_mask == select.KQ_FILTER_WRITE: - events |= EVENT_WRITE - - key = self._key_from_fd(fd) - if key: - if key.fd not in ready_fds: - ready_fds[key.fd] = (key, events & key.events) - else: - old_events = ready_fds[key.fd][1] - ready_fds[key.fd] = (key, (events | old_events) & key.events) - - return list(ready_fds.values()) - - def close(self): - self._kqueue.close() - super(KqueueSelector, self).close() - - -if not hasattr(select, 'select'): # Platform-specific: AppEngine - HAS_SELECT = False - - -def _can_allocate(struct): - """ Checks that select structs can be allocated by the underlying - operating system, not just advertised by the select module. We don't - check select() because we'll be hopeful that most platforms that - don't have it available will not advertise it. (ie: GAE) """ - try: - # select.poll() objects won't fail until used. - if struct == 'poll': - p = select.poll() - p.poll(0) - - # All others will fail on allocation. - else: - getattr(select, struct)().close() - return True - except (OSError, AttributeError) as e: - return False - - -# Choose the best implementation, roughly: -# kqueue == epoll > poll > select. Devpoll not supported. (See above) -# select() also can't accept a FD > FD_SETSIZE (usually around 1024) -def DefaultSelector(): - """ This function serves as a first call for DefaultSelector to - detect if the select module is being monkey-patched incorrectly - by eventlet, greenlet, and preserve proper behavior. """ - global _DEFAULT_SELECTOR - if _DEFAULT_SELECTOR is None: - if _can_allocate('kqueue'): - _DEFAULT_SELECTOR = KqueueSelector - elif _can_allocate('epoll'): - _DEFAULT_SELECTOR = EpollSelector - elif _can_allocate('poll'): - _DEFAULT_SELECTOR = PollSelector - elif hasattr(select, 'select'): - _DEFAULT_SELECTOR = SelectSelector - else: # Platform-specific: AppEngine - raise ValueError('Platform does not have a selector') - return _DEFAULT_SELECTOR() diff --git a/src/oci/_vendor/urllib3/util/ssl_.py b/src/oci/_vendor/urllib3/util/ssl_.py index 911d5cdc18..052f7c2b3e 100644 --- a/src/oci/_vendor/urllib3/util/ssl_.py +++ b/src/oci/_vendor/urllib3/util/ssl_.py @@ -6,11 +6,13 @@ import errno import warnings import hmac +import socket from binascii import hexlify, unhexlify from hashlib import md5, sha1, sha256 from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning +from ..packages import six SSLContext = None @@ -57,6 +59,26 @@ def _const_compare_digest_backport(a, b): OP_NO_SSLv2, OP_NO_SSLv3 = 0x1000000, 0x2000000 OP_NO_COMPRESSION = 0x20000 + +# Python 2.7 doesn't have inet_pton on non-Linux so we fallback on inet_aton in +# those cases. This means that we can only detect IPv4 addresses in this case. +if hasattr(socket, 'inet_pton'): + inet_pton = socket.inet_pton +else: + # Maybe we can use ipaddress if the user has urllib3[secure]? + try: + import ipaddress + + def inet_pton(_, host): + if isinstance(host, bytes): + host = host.decode('ascii') + return ipaddress.ip_address(host) + + except ImportError: # Platform-specific: Non-Linux + def inet_pton(_, host): + return socket.inet_aton(host) + + # A secure default. # Sources for more information on TLS ciphers: # @@ -96,10 +118,7 @@ def _const_compare_digest_backport(a, b): except ImportError: import sys - class SSLContext(object): # Platform-specific: Python 2 & 3.1 - supports_set_ciphers = ((2, 7) <= sys.version_info < (3,) or - (3, 2) <= sys.version_info) - + class SSLContext(object): # Platform-specific: Python 2 def __init__(self, protocol_version): self.protocol = protocol_version # Use default values from a real SSLContext @@ -122,12 +141,6 @@ def load_verify_locations(self, cafile=None, capath=None): raise SSLError("CA directories not supported in older Pythons") def set_ciphers(self, cipher_suite): - if not self.supports_set_ciphers: - raise TypeError( - 'Your version of Python does not support setting ' - 'a custom cipher suite. Please upgrade to Python ' - '2.7, 3.2, or later if you need this functionality.' - ) self.ciphers = cipher_suite def wrap_socket(self, socket, server_hostname=None, server_side=False): @@ -148,10 +161,7 @@ def wrap_socket(self, socket, server_hostname=None, server_side=False): 'ssl_version': self.protocol, 'server_side': server_side, } - if self.supports_set_ciphers: # Platform-specific: Python 2.7+ - return wrap_socket(socket, ciphers=self.ciphers, **kwargs) - else: # Platform-specific: Python 2.6 - return wrap_socket(socket, **kwargs) + return wrap_socket(socket, ciphers=self.ciphers, **kwargs) def assert_fingerprint(cert, fingerprint): @@ -187,7 +197,7 @@ def resolve_cert_reqs(candidate): the wrap_socket function/method from the ssl module. Defaults to :data:`ssl.CERT_NONE`. If given a string it is assumed to be the name of the constant in the - :mod:`ssl` module or its abbrevation. + :mod:`ssl` module or its abbreviation. (So you can specify `REQUIRED` instead of `CERT_REQUIRED`. If it's neither `None` nor a string we assume it is already the numeric constant which can directly be passed to wrap_socket. @@ -257,6 +267,8 @@ def create_urllib3_context(ssl_version=None, cert_reqs=None, """ context = SSLContext(ssl_version or ssl.PROTOCOL_SSLv23) + context.set_ciphers(ciphers or DEFAULT_CIPHERS) + # Setting the default here, as we may have no ssl module on import cert_reqs = ssl.CERT_REQUIRED if cert_reqs is None else cert_reqs @@ -272,9 +284,6 @@ def create_urllib3_context(ssl_version=None, cert_reqs=None, context.options |= options - if getattr(context, 'supports_set_ciphers', True): # Platform-specific: Python 2.6 - context.set_ciphers(ciphers or DEFAULT_CIPHERS) - context.verify_mode = cert_reqs if getattr(context, 'check_hostname', None) is not None: # Platform-specific: Python 3.2 # We do our own verification, including fingerprints and alternative @@ -297,8 +306,7 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None, A pre-made :class:`SSLContext` object. If none is provided, one will be created using :func:`create_urllib3_context`. :param ciphers: - A string of ciphers we wish the client to support. This is not - supported on Python 2.6 as the ssl module does not support it. + A string of ciphers we wish the client to support. :param ca_cert_dir: A directory containing CA certificates in multiple separate files, as supported by OpenSSL's -CApath flag or the capath argument to @@ -315,7 +323,7 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None, if ca_certs or ca_cert_dir: try: context.load_verify_locations(ca_certs, ca_cert_dir) - except IOError as e: # Platform-specific: Python 2.6, 2.7, 3.2 + except IOError as e: # Platform-specific: Python 2.7 raise SSLError(e) # Py33 raises FileNotFoundError which subclasses OSError # These are not equivalent unless we check the errno attribute @@ -329,17 +337,49 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None, if certfile: context.load_cert_chain(certfile, keyfile) - if HAS_SNI: # Platform-specific: OpenSSL with enabled SNI - return context.wrap_socket(sock, server_hostname=server_hostname) - - warnings.warn( - 'An HTTPS request has been made, but the SNI (Subject Name ' - 'Indication) extension to TLS is not available on this platform. ' - 'This may cause the server to present an incorrect TLS ' - 'certificate, which can cause validation failures. You can upgrade to ' - 'a newer version of Python to solve this. For more information, see ' - 'https://urllib3.readthedocs.io/en/latest/advanced-usage.html' - '#ssl-warnings', - SNIMissingWarning - ) + + # If we detect server_hostname is an IP address then the SNI + # extension should not be used according to RFC3546 Section 3.1 + # We shouldn't warn the user if SNI isn't available but we would + # not be using SNI anyways due to IP address for server_hostname. + if ((server_hostname is not None and not is_ipaddress(server_hostname)) + or IS_SECURETRANSPORT): + if HAS_SNI and server_hostname is not None: + return context.wrap_socket(sock, server_hostname=server_hostname) + + warnings.warn( + 'An HTTPS request has been made, but the SNI (Server Name ' + 'Indication) extension to TLS is not available on this platform. ' + 'This may cause the server to present an incorrect TLS ' + 'certificate, which can cause validation failures. You can upgrade to ' + 'a newer version of Python to solve this. For more information, see ' + 'https://urllib3.readthedocs.io/en/latest/advanced-usage.html' + '#ssl-warnings', + SNIMissingWarning + ) + return context.wrap_socket(sock) + + +def is_ipaddress(hostname): + """Detects whether the hostname given is an IP address. + + :param str hostname: Hostname to examine. + :return: True if the hostname is an IP address, False otherwise. + """ + if six.PY3 and isinstance(hostname, bytes): + # IDN A-label bytes are ASCII compatible. + hostname = hostname.decode('ascii') + + families = [socket.AF_INET] + if hasattr(socket, 'AF_INET6'): + families.append(socket.AF_INET6) + + for af in families: + try: + inet_pton(af, hostname) + except (socket.error, ValueError, OSError): + pass + else: + return True + return False diff --git a/src/oci/_vendor/urllib3/util/wait.py b/src/oci/_vendor/urllib3/util/wait.py index 5066750181..c855be996f 100644 --- a/src/oci/_vendor/urllib3/util/wait.py +++ b/src/oci/_vendor/urllib3/util/wait.py @@ -2,43 +2,153 @@ # Modified Work: Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. # Copyright 2008-2016 Andrey Petrov and contributors -from .selectors import ( - HAS_SELECT, - DefaultSelector, - EVENT_READ, - EVENT_WRITE -) - - -def _wait_for_io_events(socks, events, timeout=None): - """ Waits for IO events to be available from a list of sockets - or optionally a single socket if passed in. Returns a list of - sockets that can be interacted with immediately. """ - if not HAS_SELECT: - raise ValueError('Platform does not have a selector') - if not isinstance(socks, list): - # Probably just a single socket. - if hasattr(socks, "fileno"): - socks = [socks] - # Otherwise it might be a non-list iterable. +import errno +from functools import partial +import select +import sys +try: + from time import monotonic +except ImportError: + from time import time as monotonic + +__all__ = ["NoWayToWaitForSocketError", "wait_for_read", "wait_for_write"] + + +class NoWayToWaitForSocketError(Exception): + pass + + +# How should we wait on sockets? +# +# There are two types of APIs you can use for waiting on sockets: the fancy +# modern stateful APIs like epoll/kqueue, and the older stateless APIs like +# select/poll. The stateful APIs are more efficient when you have a lots of +# sockets to keep track of, because you can set them up once and then use them +# lots of times. But we only ever want to wait on a single socket at a time +# and don't want to keep track of state, so the stateless APIs are actually +# more efficient. So we want to use select() or poll(). +# +# Now, how do we choose between select() and poll()? On traditional Unixes, +# select() has a strange calling convention that makes it slow, or fail +# altogether, for high-numbered file descriptors. The point of poll() is to fix +# that, so on Unixes, we prefer poll(). +# +# On Windows, there is no poll() (or at least Python doesn't provide a wrapper +# for it), but that's OK, because on Windows, select() doesn't have this +# strange calling convention; plain select() works fine. +# +# So: on Windows we use select(), and everywhere else we use poll(). We also +# fall back to select() in case poll() is somehow broken or missing. + +if sys.version_info >= (3, 5): + # Modern Python, that retries syscalls by default + def _retry_on_intr(fn, timeout): + return fn(timeout) +else: + # Old and broken Pythons. + def _retry_on_intr(fn, timeout): + if timeout is None: + deadline = float("inf") else: - socks = list(socks) - with DefaultSelector() as selector: - for sock in socks: - selector.register(sock, events) - return [key[0].fileobj for key in - selector.select(timeout) if key[1] & events] - - -def wait_for_read(socks, timeout=None): - """ Waits for reading to be available from a list of sockets - or optionally a single socket if passed in. Returns a list of - sockets that can be read from immediately. """ - return _wait_for_io_events(socks, EVENT_READ, timeout) - - -def wait_for_write(socks, timeout=None): - """ Waits for writing to be available from a list of sockets - or optionally a single socket if passed in. Returns a list of - sockets that can be written to immediately. """ - return _wait_for_io_events(socks, EVENT_WRITE, timeout) + deadline = monotonic() + timeout + + while True: + try: + return fn(timeout) + # OSError for 3 <= pyver < 3.5, select.error for pyver <= 2.7 + except (OSError, select.error) as e: + # 'e.args[0]' incantation works for both OSError and select.error + if e.args[0] != errno.EINTR: + raise + else: + timeout = deadline - monotonic() + if timeout < 0: + timeout = 0 + if timeout == float("inf"): + timeout = None + continue + + +def select_wait_for_socket(sock, read=False, write=False, timeout=None): + if not read and not write: + raise RuntimeError("must specify at least one of read=True, write=True") + rcheck = [] + wcheck = [] + if read: + rcheck.append(sock) + if write: + wcheck.append(sock) + # When doing a non-blocking connect, most systems signal success by + # marking the socket writable. Windows, though, signals success by marked + # it as "exceptional". We paper over the difference by checking the write + # sockets for both conditions. (The stdlib selectors module does the same + # thing.) + fn = partial(select.select, rcheck, wcheck, wcheck) + rready, wready, xready = _retry_on_intr(fn, timeout) + return bool(rready or wready or xready) + + +def poll_wait_for_socket(sock, read=False, write=False, timeout=None): + if not read and not write: + raise RuntimeError("must specify at least one of read=True, write=True") + mask = 0 + if read: + mask |= select.POLLIN + if write: + mask |= select.POLLOUT + poll_obj = select.poll() + poll_obj.register(sock, mask) + + # For some reason, poll() takes timeout in milliseconds + def do_poll(t): + if t is not None: + t *= 1000 + return poll_obj.poll(t) + + return bool(_retry_on_intr(do_poll, timeout)) + + +def null_wait_for_socket(*args, **kwargs): + raise NoWayToWaitForSocketError("no select-equivalent available") + + +def _have_working_poll(): + # Apparently some systems have a select.poll that fails as soon as you try + # to use it, either due to strange configuration or broken monkeypatching + # from libraries like eventlet/greenlet. + try: + poll_obj = select.poll() + _retry_on_intr(poll_obj.poll, 0) + except (AttributeError, OSError): + return False + else: + return True + + +def wait_for_socket(*args, **kwargs): + # We delay choosing which implementation to use until the first time we're + # called. We could do it at import time, but then we might make the wrong + # decision if someone goes wild with monkeypatching select.poll after + # we're imported. + global wait_for_socket + if _have_working_poll(): + wait_for_socket = poll_wait_for_socket + elif hasattr(select, "select"): + wait_for_socket = select_wait_for_socket + else: # Platform-specific: Appengine. + wait_for_socket = null_wait_for_socket + return wait_for_socket(*args, **kwargs) + + +def wait_for_read(sock, timeout=None): + """ Waits for reading to be available on a given socket. + Returns True if the socket is readable, or False if the timeout expired. + """ + return wait_for_socket(sock, read=True, timeout=timeout) + + +def wait_for_write(sock, timeout=None): + """ Waits for writing to be available on a given socket. + Returns True if the socket is readable, or False if the timeout expired. + """ + return wait_for_socket(sock, write=True, timeout=timeout) diff --git a/src/oci/container_engine/container_engine_client.py b/src/oci/container_engine/container_engine_client.py index 15affec112..1a54c12c80 100644 --- a/src/oci/container_engine/container_engine_client.py +++ b/src/oci/container_engine/container_engine_client.py @@ -17,7 +17,9 @@ class ContainerEngineClient(object): """ - Container Engine for Kubernetes API + API for the Container Engine for Kubernetes service. Use this API to build, deploy, + and manage cloud-native applications. For more information, see + [Overview of Container Engine for Kubernetes](/iaas/Content/ContEng/Concepts/contengoverview.htm). """ def __init__(self, config, **kwargs): @@ -74,6 +76,7 @@ def __init__(self, config, **kwargs): 'service_endpoint': kwargs.get('service_endpoint'), 'timeout': kwargs.get('timeout'), 'base_path': '/20180222', + 'service_endpoint_template': 'https://containerengine.{region}.{secondLevelDomain}', 'skip_deserialization': kwargs.get('skip_deserialization', False) } self.base_client = BaseClient("container_engine", config, signer, container_engine_type_mapping, **base_client_init_kwargs) @@ -924,10 +927,17 @@ def list_clusters(self, compartment_id, **kwargs): The name to filter on. :param int limit: (optional) - The maximum number of items to return in a paginated \"List\" call. + For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. + 1 is the minimum, 1000 is the maximum. For important details about how pagination works, + see `List Pagination`__. + + __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine :param str page: (optional) - The value of the `opc-next-page` response header from the previous \"List\" call. + For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call. + For important details about how pagination works, see `List Pagination`__. + + __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine :param str sort_order: (optional) The optional order in which to sort the results. @@ -1049,10 +1059,17 @@ def list_node_pools(self, compartment_id, **kwargs): The name to filter on. :param int limit: (optional) - The maximum number of items to return in a paginated \"List\" call. + For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. + 1 is the minimum, 1000 is the maximum. For important details about how pagination works, + see `List Pagination`__. + + __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine :param str page: (optional) - The value of the `opc-next-page` response header from the previous \"List\" call. + For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call. + For important details about how pagination works, see `List Pagination`__. + + __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine :param str sort_order: (optional) The optional order in which to sort the results. @@ -1344,10 +1361,17 @@ def list_work_requests(self, compartment_id, **kwargs): Allowed values are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED" :param int limit: (optional) - The maximum number of items to return in a paginated \"List\" call. + For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. + 1 is the minimum, 1000 is the maximum. For important details about how pagination works, + see `List Pagination`__. + + __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine :param str page: (optional) - The value of the `opc-next-page` response header from the previous \"List\" call. + For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call. + For important details about how pagination works, see `List Pagination`__. + + __ https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine :param str sort_order: (optional) The optional order in which to sort the results. diff --git a/src/oci/container_engine/models/cluster.py b/src/oci/container_engine/models/cluster.py index 5b3d3c011e..2f533e4689 100644 --- a/src/oci/container_engine/models/cluster.py +++ b/src/oci/container_engine/models/cluster.py @@ -9,7 +9,7 @@ @init_model_state_from_kwargs class Cluster(object): """ - A Kubernetes cluster. + A Kubernetes cluster. Avoid entering confidential information. """ #: A constant which can be used with the lifecycle_state property of a Cluster. diff --git a/src/oci/container_engine/models/create_node_pool_details.py b/src/oci/container_engine/models/create_node_pool_details.py index 1a9fd8deaa..1ca3c171dc 100644 --- a/src/oci/container_engine/models/create_node_pool_details.py +++ b/src/oci/container_engine/models/create_node_pool_details.py @@ -33,6 +33,10 @@ def __init__(self, **kwargs): The value to assign to the kubernetes_version property of this CreateNodePoolDetails. :type kubernetes_version: str + :param node_metadata: + The value to assign to the node_metadata property of this CreateNodePoolDetails. + :type node_metadata: dict(str, str) + :param node_image_name: The value to assign to the node_image_name property of this CreateNodePoolDetails. :type node_image_name: str @@ -63,6 +67,7 @@ def __init__(self, **kwargs): 'cluster_id': 'str', 'name': 'str', 'kubernetes_version': 'str', + 'node_metadata': 'dict(str, str)', 'node_image_name': 'str', 'node_shape': 'str', 'initial_node_labels': 'list[KeyValue]', @@ -76,6 +81,7 @@ def __init__(self, **kwargs): 'cluster_id': 'clusterId', 'name': 'name', 'kubernetes_version': 'kubernetesVersion', + 'node_metadata': 'nodeMetadata', 'node_image_name': 'nodeImageName', 'node_shape': 'nodeShape', 'initial_node_labels': 'initialNodeLabels', @@ -88,6 +94,7 @@ def __init__(self, **kwargs): self._cluster_id = None self._name = None self._kubernetes_version = None + self._node_metadata = None self._node_image_name = None self._node_shape = None self._initial_node_labels = None @@ -191,6 +198,30 @@ def kubernetes_version(self, kubernetes_version): """ self._kubernetes_version = kubernetes_version + @property + def node_metadata(self): + """ + Gets the node_metadata of this CreateNodePoolDetails. + A list of key/value pairs to add to each underlying OCI instance in the node pool. + + + :return: The node_metadata of this CreateNodePoolDetails. + :rtype: dict(str, str) + """ + return self._node_metadata + + @node_metadata.setter + def node_metadata(self, node_metadata): + """ + Sets the node_metadata of this CreateNodePoolDetails. + A list of key/value pairs to add to each underlying OCI instance in the node pool. + + + :param node_metadata: The node_metadata of this CreateNodePoolDetails. + :type: dict(str, str) + """ + self._node_metadata = node_metadata + @property def node_image_name(self): """ diff --git a/src/oci/container_engine/models/node_pool.py b/src/oci/container_engine/models/node_pool.py index 70b9c951bb..31891261d9 100644 --- a/src/oci/container_engine/models/node_pool.py +++ b/src/oci/container_engine/models/node_pool.py @@ -9,7 +9,7 @@ @init_model_state_from_kwargs class NodePool(object): """ - A pool of compute nodes attached to a cluster. + A pool of compute nodes attached to a cluster. Avoid entering confidential information. """ def __init__(self, **kwargs): @@ -37,6 +37,10 @@ def __init__(self, **kwargs): The value to assign to the kubernetes_version property of this NodePool. :type kubernetes_version: str + :param node_metadata: + The value to assign to the node_metadata property of this NodePool. + :type node_metadata: dict(str, str) + :param node_image_id: The value to assign to the node_image_id property of this NodePool. :type node_image_id: str @@ -76,6 +80,7 @@ def __init__(self, **kwargs): 'cluster_id': 'str', 'name': 'str', 'kubernetes_version': 'str', + 'node_metadata': 'dict(str, str)', 'node_image_id': 'str', 'node_image_name': 'str', 'node_shape': 'str', @@ -92,6 +97,7 @@ def __init__(self, **kwargs): 'cluster_id': 'clusterId', 'name': 'name', 'kubernetes_version': 'kubernetesVersion', + 'node_metadata': 'nodeMetadata', 'node_image_id': 'nodeImageId', 'node_image_name': 'nodeImageName', 'node_shape': 'nodeShape', @@ -107,6 +113,7 @@ def __init__(self, **kwargs): self._cluster_id = None self._name = None self._kubernetes_version = None + self._node_metadata = None self._node_image_id = None self._node_image_name = None self._node_shape = None @@ -236,6 +243,30 @@ def kubernetes_version(self, kubernetes_version): """ self._kubernetes_version = kubernetes_version + @property + def node_metadata(self): + """ + Gets the node_metadata of this NodePool. + A list of key/value pairs to add to each underlying OCI instance in the node pool. + + + :return: The node_metadata of this NodePool. + :rtype: dict(str, str) + """ + return self._node_metadata + + @node_metadata.setter + def node_metadata(self, node_metadata): + """ + Sets the node_metadata of this NodePool. + A list of key/value pairs to add to each underlying OCI instance in the node pool. + + + :param node_metadata: The node_metadata of this NodePool. + :type: dict(str, str) + """ + self._node_metadata = node_metadata + @property def node_image_id(self): """ diff --git a/src/oci/database/database_client.py b/src/oci/database/database_client.py index 43ba377b23..a21cca6567 100644 --- a/src/oci/database/database_client.py +++ b/src/oci/database/database_client.py @@ -321,7 +321,7 @@ def create_autonomous_database(self, create_autonomous_database_details, **kwarg Creates a new Autonomous Database. - :param CreateAutonomousDatabaseDetails create_autonomous_database_details: (required) + :param CreateAutonomousDatabaseBase create_autonomous_database_details: (required) Request to create a new Autonomous Database. :param str opc_retry_token: (optional) diff --git a/src/oci/database/database_client_composite_operations.py b/src/oci/database/database_client_composite_operations.py index f8299d4e00..41c29144ee 100644 --- a/src/oci/database/database_client_composite_operations.py +++ b/src/oci/database/database_client_composite_operations.py @@ -102,7 +102,7 @@ def create_autonomous_database_and_wait_for_state(self, create_autonomous_databa Calls :py:func:`~oci.database.DatabaseClient.create_autonomous_database` and waits for the :py:class:`~oci.database.models.AutonomousDatabase` acted upon to enter the given state(s). - :param CreateAutonomousDatabaseDetails create_autonomous_database_details: (required) + :param CreateAutonomousDatabaseBase create_autonomous_database_details: (required) Request to create a new Autonomous Database. :param list[str] wait_for_states: diff --git a/src/oci/database/models/__init__.py b/src/oci/database/models/__init__.py index 67ce4741a6..4af971e070 100644 --- a/src/oci/database/models/__init__.py +++ b/src/oci/database/models/__init__.py @@ -19,6 +19,8 @@ from .create_autonomous_data_warehouse_backup_details import CreateAutonomousDataWarehouseBackupDetails from .create_autonomous_data_warehouse_details import CreateAutonomousDataWarehouseDetails from .create_autonomous_database_backup_details import CreateAutonomousDatabaseBackupDetails +from .create_autonomous_database_base import CreateAutonomousDatabaseBase +from .create_autonomous_database_clone_details import CreateAutonomousDatabaseCloneDetails from .create_autonomous_database_details import CreateAutonomousDatabaseDetails from .create_backup_details import CreateBackupDetails from .create_data_guard_association_details import CreateDataGuardAssociationDetails @@ -91,6 +93,8 @@ "CreateAutonomousDataWarehouseBackupDetails": CreateAutonomousDataWarehouseBackupDetails, "CreateAutonomousDataWarehouseDetails": CreateAutonomousDataWarehouseDetails, "CreateAutonomousDatabaseBackupDetails": CreateAutonomousDatabaseBackupDetails, + "CreateAutonomousDatabaseBase": CreateAutonomousDatabaseBase, + "CreateAutonomousDatabaseCloneDetails": CreateAutonomousDatabaseCloneDetails, "CreateAutonomousDatabaseDetails": CreateAutonomousDatabaseDetails, "CreateBackupDetails": CreateBackupDetails, "CreateDataGuardAssociationDetails": CreateDataGuardAssociationDetails, diff --git a/src/oci/database/models/autonomous_database.py b/src/oci/database/models/autonomous_database.py index b93657f755..786abca31b 100644 --- a/src/oci/database/models/autonomous_database.py +++ b/src/oci/database/models/autonomous_database.py @@ -137,6 +137,10 @@ def __init__(self, **kwargs): Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type license_model: str + :param used_data_storage_size_in_tbs: + The value to assign to the used_data_storage_size_in_tbs property of this AutonomousDatabase. + :type used_data_storage_size_in_tbs: int + :param freeform_tags: The value to assign to the freeform_tags property of this AutonomousDatabase. :type freeform_tags: dict(str, str) @@ -169,6 +173,7 @@ def __init__(self, **kwargs): 'service_console_url': 'str', 'connection_strings': 'AutonomousDatabaseConnectionStrings', 'license_model': 'str', + 'used_data_storage_size_in_tbs': 'int', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', 'db_version': 'str', @@ -188,6 +193,7 @@ def __init__(self, **kwargs): 'service_console_url': 'serviceConsoleUrl', 'connection_strings': 'connectionStrings', 'license_model': 'licenseModel', + 'used_data_storage_size_in_tbs': 'usedDataStorageSizeInTBs', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', 'db_version': 'dbVersion', @@ -206,6 +212,7 @@ def __init__(self, **kwargs): self._service_console_url = None self._connection_strings = None self._license_model = None + self._used_data_storage_size_in_tbs = None self._freeform_tags = None self._defined_tags = None self._db_version = None @@ -519,6 +526,30 @@ def license_model(self, license_model): license_model = 'UNKNOWN_ENUM_VALUE' self._license_model = license_model + @property + def used_data_storage_size_in_tbs(self): + """ + Gets the used_data_storage_size_in_tbs of this AutonomousDatabase. + The amount of storage that has been used, in terabytes. + + + :return: The used_data_storage_size_in_tbs of this AutonomousDatabase. + :rtype: int + """ + return self._used_data_storage_size_in_tbs + + @used_data_storage_size_in_tbs.setter + def used_data_storage_size_in_tbs(self, used_data_storage_size_in_tbs): + """ + Sets the used_data_storage_size_in_tbs of this AutonomousDatabase. + The amount of storage that has been used, in terabytes. + + + :param used_data_storage_size_in_tbs: The used_data_storage_size_in_tbs of this AutonomousDatabase. + :type: int + """ + self._used_data_storage_size_in_tbs = used_data_storage_size_in_tbs + @property def freeform_tags(self): """ diff --git a/src/oci/database/models/autonomous_database_summary.py b/src/oci/database/models/autonomous_database_summary.py index f1310c71c7..c26a6e19c6 100644 --- a/src/oci/database/models/autonomous_database_summary.py +++ b/src/oci/database/models/autonomous_database_summary.py @@ -139,6 +139,10 @@ def __init__(self, **kwargs): Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type license_model: str + :param used_data_storage_size_in_tbs: + The value to assign to the used_data_storage_size_in_tbs property of this AutonomousDatabaseSummary. + :type used_data_storage_size_in_tbs: int + :param freeform_tags: The value to assign to the freeform_tags property of this AutonomousDatabaseSummary. :type freeform_tags: dict(str, str) @@ -171,6 +175,7 @@ def __init__(self, **kwargs): 'service_console_url': 'str', 'connection_strings': 'AutonomousDatabaseConnectionStrings', 'license_model': 'str', + 'used_data_storage_size_in_tbs': 'int', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', 'db_version': 'str', @@ -190,6 +195,7 @@ def __init__(self, **kwargs): 'service_console_url': 'serviceConsoleUrl', 'connection_strings': 'connectionStrings', 'license_model': 'licenseModel', + 'used_data_storage_size_in_tbs': 'usedDataStorageSizeInTBs', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', 'db_version': 'dbVersion', @@ -208,6 +214,7 @@ def __init__(self, **kwargs): self._service_console_url = None self._connection_strings = None self._license_model = None + self._used_data_storage_size_in_tbs = None self._freeform_tags = None self._defined_tags = None self._db_version = None @@ -521,6 +528,30 @@ def license_model(self, license_model): license_model = 'UNKNOWN_ENUM_VALUE' self._license_model = license_model + @property + def used_data_storage_size_in_tbs(self): + """ + Gets the used_data_storage_size_in_tbs of this AutonomousDatabaseSummary. + The amount of storage that has been used, in terabytes. + + + :return: The used_data_storage_size_in_tbs of this AutonomousDatabaseSummary. + :rtype: int + """ + return self._used_data_storage_size_in_tbs + + @used_data_storage_size_in_tbs.setter + def used_data_storage_size_in_tbs(self, used_data_storage_size_in_tbs): + """ + Sets the used_data_storage_size_in_tbs of this AutonomousDatabaseSummary. + The amount of storage that has been used, in terabytes. + + + :param used_data_storage_size_in_tbs: The used_data_storage_size_in_tbs of this AutonomousDatabaseSummary. + :type: int + """ + self._used_data_storage_size_in_tbs = used_data_storage_size_in_tbs + @property def freeform_tags(self): """ diff --git a/src/oci/database/models/create_autonomous_database_base.py b/src/oci/database/models/create_autonomous_database_base.py new file mode 100644 index 0000000000..cf1d27ff3a --- /dev/null +++ b/src/oci/database/models/create_autonomous_database_base.py @@ -0,0 +1,477 @@ +# coding: utf-8 +# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CreateAutonomousDatabaseBase(object): + """ + Details to create an Oracle Autonomous Database. + + **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. + """ + + #: A constant which can be used with the db_workload property of a CreateAutonomousDatabaseBase. + #: This constant has a value of "OLTP" + DB_WORKLOAD_OLTP = "OLTP" + + #: A constant which can be used with the db_workload property of a CreateAutonomousDatabaseBase. + #: This constant has a value of "DW" + DB_WORKLOAD_DW = "DW" + + #: A constant which can be used with the license_model property of a CreateAutonomousDatabaseBase. + #: This constant has a value of "LICENSE_INCLUDED" + LICENSE_MODEL_LICENSE_INCLUDED = "LICENSE_INCLUDED" + + #: A constant which can be used with the license_model property of a CreateAutonomousDatabaseBase. + #: This constant has a value of "BRING_YOUR_OWN_LICENSE" + LICENSE_MODEL_BRING_YOUR_OWN_LICENSE = "BRING_YOUR_OWN_LICENSE" + + #: A constant which can be used with the source property of a CreateAutonomousDatabaseBase. + #: This constant has a value of "NONE" + SOURCE_NONE = "NONE" + + #: A constant which can be used with the source property of a CreateAutonomousDatabaseBase. + #: This constant has a value of "DATABASE" + SOURCE_DATABASE = "DATABASE" + + def __init__(self, **kwargs): + """ + Initializes a new CreateAutonomousDatabaseBase object with values from keyword arguments. This class has the following subclasses and if you are using this class as input + to a service operations then you should favor using a subclass over the base class: + + * :class:`~oci.database.models.CreateAutonomousDatabaseCloneDetails` + * :class:`~oci.database.models.CreateAutonomousDatabaseDetails` + + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param compartment_id: + The value to assign to the compartment_id property of this CreateAutonomousDatabaseBase. + :type compartment_id: str + + :param db_name: + The value to assign to the db_name property of this CreateAutonomousDatabaseBase. + :type db_name: str + + :param cpu_core_count: + The value to assign to the cpu_core_count property of this CreateAutonomousDatabaseBase. + :type cpu_core_count: int + + :param db_workload: + The value to assign to the db_workload property of this CreateAutonomousDatabaseBase. + Allowed values for this property are: "OLTP", "DW" + :type db_workload: str + + :param data_storage_size_in_tbs: + The value to assign to the data_storage_size_in_tbs property of this CreateAutonomousDatabaseBase. + :type data_storage_size_in_tbs: int + + :param admin_password: + The value to assign to the admin_password property of this CreateAutonomousDatabaseBase. + :type admin_password: str + + :param display_name: + The value to assign to the display_name property of this CreateAutonomousDatabaseBase. + :type display_name: str + + :param license_model: + The value to assign to the license_model property of this CreateAutonomousDatabaseBase. + Allowed values for this property are: "LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE" + :type license_model: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this CreateAutonomousDatabaseBase. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this CreateAutonomousDatabaseBase. + :type defined_tags: dict(str, dict(str, object)) + + :param source: + The value to assign to the source property of this CreateAutonomousDatabaseBase. + Allowed values for this property are: "NONE", "DATABASE" + :type source: str + + """ + self.swagger_types = { + 'compartment_id': 'str', + 'db_name': 'str', + 'cpu_core_count': 'int', + 'db_workload': 'str', + 'data_storage_size_in_tbs': 'int', + 'admin_password': 'str', + 'display_name': 'str', + 'license_model': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'source': 'str' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId', + 'db_name': 'dbName', + 'cpu_core_count': 'cpuCoreCount', + 'db_workload': 'dbWorkload', + 'data_storage_size_in_tbs': 'dataStorageSizeInTBs', + 'admin_password': 'adminPassword', + 'display_name': 'displayName', + 'license_model': 'licenseModel', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'source': 'source' + } + + self._compartment_id = None + self._db_name = None + self._cpu_core_count = None + self._db_workload = None + self._data_storage_size_in_tbs = None + self._admin_password = None + self._display_name = None + self._license_model = None + self._freeform_tags = None + self._defined_tags = None + self._source = None + + @staticmethod + def get_subtype(object_dictionary): + """ + Given the hash representation of a subtype of this class, + use the info in the hash to return the class of the subtype. + """ + type = object_dictionary['source'] + + if type == 'DATABASE': + return 'CreateAutonomousDatabaseCloneDetails' + + if type == 'NONE': + return 'CreateAutonomousDatabaseDetails' + else: + return 'CreateAutonomousDatabaseBase' + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this CreateAutonomousDatabaseBase. + The `OCID`__ of the compartment of the autonomous database. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :return: The compartment_id of this CreateAutonomousDatabaseBase. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CreateAutonomousDatabaseBase. + The `OCID`__ of the compartment of the autonomous database. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :param compartment_id: The compartment_id of this CreateAutonomousDatabaseBase. + :type: str + """ + self._compartment_id = compartment_id + + @property + def db_name(self): + """ + **[Required]** Gets the db_name of this CreateAutonomousDatabaseBase. + The database name. The name must begin with an alphabetic character and can contain a maximum of 14 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. + + + :return: The db_name of this CreateAutonomousDatabaseBase. + :rtype: str + """ + return self._db_name + + @db_name.setter + def db_name(self, db_name): + """ + Sets the db_name of this CreateAutonomousDatabaseBase. + The database name. The name must begin with an alphabetic character and can contain a maximum of 14 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. + + + :param db_name: The db_name of this CreateAutonomousDatabaseBase. + :type: str + """ + self._db_name = db_name + + @property + def cpu_core_count(self): + """ + **[Required]** Gets the cpu_core_count of this CreateAutonomousDatabaseBase. + The number of CPU Cores to be made available to the database. + + + :return: The cpu_core_count of this CreateAutonomousDatabaseBase. + :rtype: int + """ + return self._cpu_core_count + + @cpu_core_count.setter + def cpu_core_count(self, cpu_core_count): + """ + Sets the cpu_core_count of this CreateAutonomousDatabaseBase. + The number of CPU Cores to be made available to the database. + + + :param cpu_core_count: The cpu_core_count of this CreateAutonomousDatabaseBase. + :type: int + """ + self._cpu_core_count = cpu_core_count + + @property + def db_workload(self): + """ + Gets the db_workload of this CreateAutonomousDatabaseBase. + The autonomous database workload type. + + Allowed values for this property are: "OLTP", "DW" + + + :return: The db_workload of this CreateAutonomousDatabaseBase. + :rtype: str + """ + return self._db_workload + + @db_workload.setter + def db_workload(self, db_workload): + """ + Sets the db_workload of this CreateAutonomousDatabaseBase. + The autonomous database workload type. + + + :param db_workload: The db_workload of this CreateAutonomousDatabaseBase. + :type: str + """ + allowed_values = ["OLTP", "DW"] + if not value_allowed_none_or_none_sentinel(db_workload, allowed_values): + raise ValueError( + "Invalid value for `db_workload`, must be None or one of {0}" + .format(allowed_values) + ) + self._db_workload = db_workload + + @property + def data_storage_size_in_tbs(self): + """ + **[Required]** Gets the data_storage_size_in_tbs of this CreateAutonomousDatabaseBase. + The size, in terabytes, of the data volume that will be created and attached to the database. This storage can later be scaled up if needed. + + + :return: The data_storage_size_in_tbs of this CreateAutonomousDatabaseBase. + :rtype: int + """ + return self._data_storage_size_in_tbs + + @data_storage_size_in_tbs.setter + def data_storage_size_in_tbs(self, data_storage_size_in_tbs): + """ + Sets the data_storage_size_in_tbs of this CreateAutonomousDatabaseBase. + The size, in terabytes, of the data volume that will be created and attached to the database. This storage can later be scaled up if needed. + + + :param data_storage_size_in_tbs: The data_storage_size_in_tbs of this CreateAutonomousDatabaseBase. + :type: int + """ + self._data_storage_size_in_tbs = data_storage_size_in_tbs + + @property + def admin_password(self): + """ + **[Required]** Gets the admin_password of this CreateAutonomousDatabaseBase. + The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. + + + :return: The admin_password of this CreateAutonomousDatabaseBase. + :rtype: str + """ + return self._admin_password + + @admin_password.setter + def admin_password(self, admin_password): + """ + Sets the admin_password of this CreateAutonomousDatabaseBase. + The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. + + + :param admin_password: The admin_password of this CreateAutonomousDatabaseBase. + :type: str + """ + self._admin_password = admin_password + + @property + def display_name(self): + """ + Gets the display_name of this CreateAutonomousDatabaseBase. + The user-friendly name for the Autonomous Database. The name does not have to be unique. + + + :return: The display_name of this CreateAutonomousDatabaseBase. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this CreateAutonomousDatabaseBase. + The user-friendly name for the Autonomous Database. The name does not have to be unique. + + + :param display_name: The display_name of this CreateAutonomousDatabaseBase. + :type: str + """ + self._display_name = display_name + + @property + def license_model(self): + """ + Gets the license_model of this CreateAutonomousDatabaseBase. + The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE. + + Allowed values for this property are: "LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE" + + + :return: The license_model of this CreateAutonomousDatabaseBase. + :rtype: str + """ + return self._license_model + + @license_model.setter + def license_model(self, license_model): + """ + Sets the license_model of this CreateAutonomousDatabaseBase. + The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE. + + + :param license_model: The license_model of this CreateAutonomousDatabaseBase. + :type: str + """ + allowed_values = ["LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE"] + if not value_allowed_none_or_none_sentinel(license_model, allowed_values): + raise ValueError( + "Invalid value for `license_model`, must be None or one of {0}" + .format(allowed_values) + ) + self._license_model = license_model + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this CreateAutonomousDatabaseBase. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + For more information, see `Resource Tags`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this CreateAutonomousDatabaseBase. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this CreateAutonomousDatabaseBase. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + For more information, see `Resource Tags`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this CreateAutonomousDatabaseBase. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this CreateAutonomousDatabaseBase. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this CreateAutonomousDatabaseBase. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this CreateAutonomousDatabaseBase. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this CreateAutonomousDatabaseBase. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def source(self): + """ + Gets the source of this CreateAutonomousDatabaseBase. + The source of the database: Use NONE for creating a new Autonomous Database. Use DATABASE for creating a new Autonomous Database by cloning an existing Autonomous Database. + + Allowed values for this property are: "NONE", "DATABASE" + + + :return: The source of this CreateAutonomousDatabaseBase. + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """ + Sets the source of this CreateAutonomousDatabaseBase. + The source of the database: Use NONE for creating a new Autonomous Database. Use DATABASE for creating a new Autonomous Database by cloning an existing Autonomous Database. + + + :param source: The source of this CreateAutonomousDatabaseBase. + :type: str + """ + allowed_values = ["NONE", "DATABASE"] + if not value_allowed_none_or_none_sentinel(source, allowed_values): + raise ValueError( + "Invalid value for `source`, must be None or one of {0}" + .format(allowed_values) + ) + self._source = source + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/database/models/create_autonomous_database_clone_details.py b/src/oci/database/models/create_autonomous_database_clone_details.py new file mode 100644 index 0000000000..911dc53b55 --- /dev/null +++ b/src/oci/database/models/create_autonomous_database_clone_details.py @@ -0,0 +1,203 @@ +# coding: utf-8 +# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + +from .create_autonomous_database_base import CreateAutonomousDatabaseBase +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CreateAutonomousDatabaseCloneDetails(CreateAutonomousDatabaseBase): + """ + Details to create an Oracle Autonomous Database by cloning an existing Autonomous Database. + """ + + #: A constant which can be used with the clone_type property of a CreateAutonomousDatabaseCloneDetails. + #: This constant has a value of "FULL" + CLONE_TYPE_FULL = "FULL" + + #: A constant which can be used with the clone_type property of a CreateAutonomousDatabaseCloneDetails. + #: This constant has a value of "METADATA" + CLONE_TYPE_METADATA = "METADATA" + + def __init__(self, **kwargs): + """ + Initializes a new CreateAutonomousDatabaseCloneDetails object with values from keyword arguments. The default value of the :py:attr:`~oci.database.models.CreateAutonomousDatabaseCloneDetails.source` attribute + of this class is ``DATABASE`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param compartment_id: + The value to assign to the compartment_id property of this CreateAutonomousDatabaseCloneDetails. + :type compartment_id: str + + :param db_name: + The value to assign to the db_name property of this CreateAutonomousDatabaseCloneDetails. + :type db_name: str + + :param cpu_core_count: + The value to assign to the cpu_core_count property of this CreateAutonomousDatabaseCloneDetails. + :type cpu_core_count: int + + :param db_workload: + The value to assign to the db_workload property of this CreateAutonomousDatabaseCloneDetails. + Allowed values for this property are: "OLTP", "DW" + :type db_workload: str + + :param data_storage_size_in_tbs: + The value to assign to the data_storage_size_in_tbs property of this CreateAutonomousDatabaseCloneDetails. + :type data_storage_size_in_tbs: int + + :param admin_password: + The value to assign to the admin_password property of this CreateAutonomousDatabaseCloneDetails. + :type admin_password: str + + :param display_name: + The value to assign to the display_name property of this CreateAutonomousDatabaseCloneDetails. + :type display_name: str + + :param license_model: + The value to assign to the license_model property of this CreateAutonomousDatabaseCloneDetails. + Allowed values for this property are: "LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE" + :type license_model: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this CreateAutonomousDatabaseCloneDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this CreateAutonomousDatabaseCloneDetails. + :type defined_tags: dict(str, dict(str, object)) + + :param source: + The value to assign to the source property of this CreateAutonomousDatabaseCloneDetails. + Allowed values for this property are: "NONE", "DATABASE" + :type source: str + + :param source_id: + The value to assign to the source_id property of this CreateAutonomousDatabaseCloneDetails. + :type source_id: str + + :param clone_type: + The value to assign to the clone_type property of this CreateAutonomousDatabaseCloneDetails. + Allowed values for this property are: "FULL", "METADATA" + :type clone_type: str + + """ + self.swagger_types = { + 'compartment_id': 'str', + 'db_name': 'str', + 'cpu_core_count': 'int', + 'db_workload': 'str', + 'data_storage_size_in_tbs': 'int', + 'admin_password': 'str', + 'display_name': 'str', + 'license_model': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'source': 'str', + 'source_id': 'str', + 'clone_type': 'str' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId', + 'db_name': 'dbName', + 'cpu_core_count': 'cpuCoreCount', + 'db_workload': 'dbWorkload', + 'data_storage_size_in_tbs': 'dataStorageSizeInTBs', + 'admin_password': 'adminPassword', + 'display_name': 'displayName', + 'license_model': 'licenseModel', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'source': 'source', + 'source_id': 'sourceId', + 'clone_type': 'cloneType' + } + + self._compartment_id = None + self._db_name = None + self._cpu_core_count = None + self._db_workload = None + self._data_storage_size_in_tbs = None + self._admin_password = None + self._display_name = None + self._license_model = None + self._freeform_tags = None + self._defined_tags = None + self._source = None + self._source_id = None + self._clone_type = None + self._source = 'DATABASE' + + @property + def source_id(self): + """ + **[Required]** Gets the source_id of this CreateAutonomousDatabaseCloneDetails. + The `OCID`__ of the source Autonomous Database that you will clone to create a new Autonomous Database. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :return: The source_id of this CreateAutonomousDatabaseCloneDetails. + :rtype: str + """ + return self._source_id + + @source_id.setter + def source_id(self, source_id): + """ + Sets the source_id of this CreateAutonomousDatabaseCloneDetails. + The `OCID`__ of the source Autonomous Database that you will clone to create a new Autonomous Database. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :param source_id: The source_id of this CreateAutonomousDatabaseCloneDetails. + :type: str + """ + self._source_id = source_id + + @property + def clone_type(self): + """ + **[Required]** Gets the clone_type of this CreateAutonomousDatabaseCloneDetails. + The clone type. + + Allowed values for this property are: "FULL", "METADATA" + + + :return: The clone_type of this CreateAutonomousDatabaseCloneDetails. + :rtype: str + """ + return self._clone_type + + @clone_type.setter + def clone_type(self, clone_type): + """ + Sets the clone_type of this CreateAutonomousDatabaseCloneDetails. + The clone type. + + + :param clone_type: The clone_type of this CreateAutonomousDatabaseCloneDetails. + :type: str + """ + allowed_values = ["FULL", "METADATA"] + if not value_allowed_none_or_none_sentinel(clone_type, allowed_values): + raise ValueError( + "Invalid value for `clone_type`, must be None or one of {0}" + .format(allowed_values) + ) + self._clone_type = clone_type + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/database/models/create_autonomous_database_details.py b/src/oci/database/models/create_autonomous_database_details.py index b4b47f0e0e..c693fcb88c 100644 --- a/src/oci/database/models/create_autonomous_database_details.py +++ b/src/oci/database/models/create_autonomous_database_details.py @@ -1,38 +1,21 @@ # coding: utf-8 # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. - +from .create_autonomous_database_base import CreateAutonomousDatabaseBase from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 from oci.decorators import init_model_state_from_kwargs @init_model_state_from_kwargs -class CreateAutonomousDatabaseDetails(object): +class CreateAutonomousDatabaseDetails(CreateAutonomousDatabaseBase): """ Details to create an Oracle Autonomous Database. - - **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. """ - #: A constant which can be used with the db_workload property of a CreateAutonomousDatabaseDetails. - #: This constant has a value of "OLTP" - DB_WORKLOAD_OLTP = "OLTP" - - #: A constant which can be used with the db_workload property of a CreateAutonomousDatabaseDetails. - #: This constant has a value of "DW" - DB_WORKLOAD_DW = "DW" - - #: A constant which can be used with the license_model property of a CreateAutonomousDatabaseDetails. - #: This constant has a value of "LICENSE_INCLUDED" - LICENSE_MODEL_LICENSE_INCLUDED = "LICENSE_INCLUDED" - - #: A constant which can be used with the license_model property of a CreateAutonomousDatabaseDetails. - #: This constant has a value of "BRING_YOUR_OWN_LICENSE" - LICENSE_MODEL_BRING_YOUR_OWN_LICENSE = "BRING_YOUR_OWN_LICENSE" - def __init__(self, **kwargs): """ - Initializes a new CreateAutonomousDatabaseDetails object with values from keyword arguments. + Initializes a new CreateAutonomousDatabaseDetails object with values from keyword arguments. The default value of the :py:attr:`~oci.database.models.CreateAutonomousDatabaseDetails.source` attribute + of this class is ``NONE`` and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class): :param compartment_id: @@ -77,6 +60,11 @@ def __init__(self, **kwargs): The value to assign to the defined_tags property of this CreateAutonomousDatabaseDetails. :type defined_tags: dict(str, dict(str, object)) + :param source: + The value to assign to the source property of this CreateAutonomousDatabaseDetails. + Allowed values for this property are: "NONE", "DATABASE" + :type source: str + """ self.swagger_types = { 'compartment_id': 'str', @@ -88,7 +76,8 @@ def __init__(self, **kwargs): 'display_name': 'str', 'license_model': 'str', 'freeform_tags': 'dict(str, str)', - 'defined_tags': 'dict(str, dict(str, object))' + 'defined_tags': 'dict(str, dict(str, object))', + 'source': 'str' } self.attribute_map = { @@ -101,7 +90,8 @@ def __init__(self, **kwargs): 'display_name': 'displayName', 'license_model': 'licenseModel', 'freeform_tags': 'freeformTags', - 'defined_tags': 'definedTags' + 'defined_tags': 'definedTags', + 'source': 'source' } self._compartment_id = None @@ -114,286 +104,8 @@ def __init__(self, **kwargs): self._license_model = None self._freeform_tags = None self._defined_tags = None - - @property - def compartment_id(self): - """ - **[Required]** Gets the compartment_id of this CreateAutonomousDatabaseDetails. - The `OCID`__ of the compartment of the autonomous database. - - __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm - - - :return: The compartment_id of this CreateAutonomousDatabaseDetails. - :rtype: str - """ - return self._compartment_id - - @compartment_id.setter - def compartment_id(self, compartment_id): - """ - Sets the compartment_id of this CreateAutonomousDatabaseDetails. - The `OCID`__ of the compartment of the autonomous database. - - __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm - - - :param compartment_id: The compartment_id of this CreateAutonomousDatabaseDetails. - :type: str - """ - self._compartment_id = compartment_id - - @property - def db_name(self): - """ - **[Required]** Gets the db_name of this CreateAutonomousDatabaseDetails. - The database name. The name must begin with an alphabetic character and can contain a maximum of 14 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. - - - :return: The db_name of this CreateAutonomousDatabaseDetails. - :rtype: str - """ - return self._db_name - - @db_name.setter - def db_name(self, db_name): - """ - Sets the db_name of this CreateAutonomousDatabaseDetails. - The database name. The name must begin with an alphabetic character and can contain a maximum of 14 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. - - - :param db_name: The db_name of this CreateAutonomousDatabaseDetails. - :type: str - """ - self._db_name = db_name - - @property - def cpu_core_count(self): - """ - **[Required]** Gets the cpu_core_count of this CreateAutonomousDatabaseDetails. - The number of CPU Cores to be made available to the database. - - - :return: The cpu_core_count of this CreateAutonomousDatabaseDetails. - :rtype: int - """ - return self._cpu_core_count - - @cpu_core_count.setter - def cpu_core_count(self, cpu_core_count): - """ - Sets the cpu_core_count of this CreateAutonomousDatabaseDetails. - The number of CPU Cores to be made available to the database. - - - :param cpu_core_count: The cpu_core_count of this CreateAutonomousDatabaseDetails. - :type: int - """ - self._cpu_core_count = cpu_core_count - - @property - def db_workload(self): - """ - Gets the db_workload of this CreateAutonomousDatabaseDetails. - The autonomous database workload type. - - Allowed values for this property are: "OLTP", "DW" - - - :return: The db_workload of this CreateAutonomousDatabaseDetails. - :rtype: str - """ - return self._db_workload - - @db_workload.setter - def db_workload(self, db_workload): - """ - Sets the db_workload of this CreateAutonomousDatabaseDetails. - The autonomous database workload type. - - - :param db_workload: The db_workload of this CreateAutonomousDatabaseDetails. - :type: str - """ - allowed_values = ["OLTP", "DW"] - if not value_allowed_none_or_none_sentinel(db_workload, allowed_values): - raise ValueError( - "Invalid value for `db_workload`, must be None or one of {0}" - .format(allowed_values) - ) - self._db_workload = db_workload - - @property - def data_storage_size_in_tbs(self): - """ - **[Required]** Gets the data_storage_size_in_tbs of this CreateAutonomousDatabaseDetails. - The size, in terabytes, of the data volume that will be created and attached to the database. This storage can later be scaled up if needed. - - - :return: The data_storage_size_in_tbs of this CreateAutonomousDatabaseDetails. - :rtype: int - """ - return self._data_storage_size_in_tbs - - @data_storage_size_in_tbs.setter - def data_storage_size_in_tbs(self, data_storage_size_in_tbs): - """ - Sets the data_storage_size_in_tbs of this CreateAutonomousDatabaseDetails. - The size, in terabytes, of the data volume that will be created and attached to the database. This storage can later be scaled up if needed. - - - :param data_storage_size_in_tbs: The data_storage_size_in_tbs of this CreateAutonomousDatabaseDetails. - :type: int - """ - self._data_storage_size_in_tbs = data_storage_size_in_tbs - - @property - def admin_password(self): - """ - **[Required]** Gets the admin_password of this CreateAutonomousDatabaseDetails. - The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. - - - :return: The admin_password of this CreateAutonomousDatabaseDetails. - :rtype: str - """ - return self._admin_password - - @admin_password.setter - def admin_password(self, admin_password): - """ - Sets the admin_password of this CreateAutonomousDatabaseDetails. - The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. - - - :param admin_password: The admin_password of this CreateAutonomousDatabaseDetails. - :type: str - """ - self._admin_password = admin_password - - @property - def display_name(self): - """ - Gets the display_name of this CreateAutonomousDatabaseDetails. - The user-friendly name for the Autonomous Database. The name does not have to be unique. - - - :return: The display_name of this CreateAutonomousDatabaseDetails. - :rtype: str - """ - return self._display_name - - @display_name.setter - def display_name(self, display_name): - """ - Sets the display_name of this CreateAutonomousDatabaseDetails. - The user-friendly name for the Autonomous Database. The name does not have to be unique. - - - :param display_name: The display_name of this CreateAutonomousDatabaseDetails. - :type: str - """ - self._display_name = display_name - - @property - def license_model(self): - """ - Gets the license_model of this CreateAutonomousDatabaseDetails. - The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE. - - Allowed values for this property are: "LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE" - - - :return: The license_model of this CreateAutonomousDatabaseDetails. - :rtype: str - """ - return self._license_model - - @license_model.setter - def license_model(self, license_model): - """ - Sets the license_model of this CreateAutonomousDatabaseDetails. - The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE. - - - :param license_model: The license_model of this CreateAutonomousDatabaseDetails. - :type: str - """ - allowed_values = ["LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE"] - if not value_allowed_none_or_none_sentinel(license_model, allowed_values): - raise ValueError( - "Invalid value for `license_model`, must be None or one of {0}" - .format(allowed_values) - ) - self._license_model = license_model - - @property - def freeform_tags(self): - """ - Gets the freeform_tags of this CreateAutonomousDatabaseDetails. - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - For more information, see `Resource Tags`__. - - Example: `{\"Department\": \"Finance\"}` - - __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm - - - :return: The freeform_tags of this CreateAutonomousDatabaseDetails. - :rtype: dict(str, str) - """ - return self._freeform_tags - - @freeform_tags.setter - def freeform_tags(self, freeform_tags): - """ - Sets the freeform_tags of this CreateAutonomousDatabaseDetails. - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - For more information, see `Resource Tags`__. - - Example: `{\"Department\": \"Finance\"}` - - __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm - - - :param freeform_tags: The freeform_tags of this CreateAutonomousDatabaseDetails. - :type: dict(str, str) - """ - self._freeform_tags = freeform_tags - - @property - def defined_tags(self): - """ - Gets the defined_tags of this CreateAutonomousDatabaseDetails. - Defined tags for this resource. Each key is predefined and scoped to a namespace. - For more information, see `Resource Tags`__. - - Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` - - __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm - - - :return: The defined_tags of this CreateAutonomousDatabaseDetails. - :rtype: dict(str, dict(str, object)) - """ - return self._defined_tags - - @defined_tags.setter - def defined_tags(self, defined_tags): - """ - Sets the defined_tags of this CreateAutonomousDatabaseDetails. - Defined tags for this resource. Each key is predefined and scoped to a namespace. - For more information, see `Resource Tags`__. - - Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` - - __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm - - - :param defined_tags: The defined_tags of this CreateAutonomousDatabaseDetails. - :type: dict(str, dict(str, object)) - """ - self._defined_tags = defined_tags + self._source = None + self._source = 'NONE' def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/resource_manager/resource_manager_client.py b/src/oci/resource_manager/resource_manager_client.py index c630af2974..a8421bfaf6 100644 --- a/src/oci/resource_manager/resource_manager_client.py +++ b/src/oci/resource_manager/resource_manager_client.py @@ -17,7 +17,7 @@ class ResourceManagerClient(object): """ - Oracle Resource Manager API. + API for the Resource Manager service. Use this API to install, configure, and manage resources via the "infrastructure-as-code" model. For more information, see [Overview of Resource Manager](/iaas/Content/ResourceManager/Concepts/resourcemanager.htm). """ def __init__(self, config, **kwargs): diff --git a/src/oci/version.py b/src/oci/version.py index 089b07042b..7759aa05fe 100644 --- a/src/oci/version.py +++ b/src/oci/version.py @@ -1,4 +1,4 @@ # coding: utf-8 # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. -__version__ = "2.2.2" +__version__ = "2.2.3"