py2docfx 0.1.16.dev2064350__py3-none-any.whl → 0.1.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py2docfx/convert_prepare/environment.py +1 -3
- py2docfx/convert_prepare/get_source.py +1 -6
- py2docfx/convert_prepare/package_info.py +1 -1
- py2docfx/docfx_yaml/miss_reference.py +1 -1
- py2docfx/docfx_yaml/parameter_utils.py +58 -6
- py2docfx/docfx_yaml/tests/roots/test-translator-typing/code_with_typing.py +14 -0
- py2docfx/docfx_yaml/tests/roots/test-translator-typing/conf.py +18 -0
- py2docfx/docfx_yaml/tests/test_translator_typing.py +39 -0
- py2docfx/docfx_yaml/utils.py +2 -2
- py2docfx/venv/basevenv/Lib/site-packages/certifi/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/certifi/core.py +1 -32
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/cli/__main__.py +62 -2
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/constant.py +17 -0
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/legacy.py +1 -3
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/md.py +19 -14
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/utils.py +6 -0
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/version.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/packaging/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/packaging/_elffile.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/_manylinux.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/_parser.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/_tokenizer.py +5 -4
- py2docfx/venv/basevenv/Lib/site-packages/packaging/licenses/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/packaging/markers.py +53 -22
- py2docfx/venv/basevenv/Lib/site-packages/packaging/metadata.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/specifiers.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/tags.py +39 -0
- py2docfx/venv/basevenv/Lib/site-packages/pkg_resources/__init__.py +6 -7
- py2docfx/venv/basevenv/Lib/site-packages/pygments/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/pygments/lexers/_sql_builtins.py +106 -0
- py2docfx/venv/basevenv/Lib/site-packages/pygments/lexers/scripting.py +5 -3
- py2docfx/venv/basevenv/Lib/site-packages/pygments/lexers/sql.py +24 -118
- py2docfx/venv/basevenv/Lib/site-packages/requests/__version__.py +2 -2
- py2docfx/venv/basevenv/Lib/site-packages/requests/compat.py +12 -0
- py2docfx/venv/basevenv/Lib/site-packages/requests/models.py +3 -1
- py2docfx/venv/basevenv/Lib/site-packages/requests/utils.py +6 -16
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/__init__.py +0 -38
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_discovery.py +33 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build_scripts.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/config.py +0 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_unix.py +63 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/unix.py +5 -6
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_entry_points.py +4 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_normalization.py +0 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_path.py +12 -3
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_reqs.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_scripts.py +361 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_shutil.py +6 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/build_meta.py +25 -37
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/bdist_egg.py +9 -11
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/bdist_wheel.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/build_ext.py +29 -28
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/develop.py +39 -179
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/easy_install.py +17 -2352
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/editable_wheel.py +14 -31
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/egg_info.py +0 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/install.py +3 -55
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/install_scripts.py +5 -11
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/sdist.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/compat/py310.py +11 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/dist.py +10 -12
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/installer.py +34 -29
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/contexts.py +0 -14
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/fixtures.py +235 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/integration/test_pbr.py +20 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_build_meta.py +0 -24
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_develop.py +1 -64
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_dist.py +2 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_dist_info.py +0 -63
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_editable_install.py +15 -41
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_egg_info.py +3 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_scripts.py +12 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_wheel.py +12 -36
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_windows_wrappers.py +3 -4
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/wheel.py +49 -24
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/__init__.py +6 -0
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/arabic_stemmer.py +798 -797
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/armenian_stemmer.py +212 -213
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/basestemmer.py +20 -54
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/basque_stemmer.py +202 -228
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/catalan_stemmer.py +370 -375
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/danish_stemmer.py +63 -61
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/dutch_porter_stemmer.py +466 -0
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/dutch_stemmer.py +1217 -343
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/english_stemmer.py +295 -264
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/esperanto_stemmer.py +588 -0
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/estonian_stemmer.py +850 -0
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/finnish_stemmer.py +144 -143
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/french_stemmer.py +308 -246
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/german_stemmer.py +224 -167
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/greek_stemmer.py +1314 -1313
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/hindi_stemmer.py +39 -38
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/hungarian_stemmer.py +231 -256
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/indonesian_stemmer.py +61 -64
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/irish_stemmer.py +101 -106
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/italian_stemmer.py +272 -272
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/lithuanian_stemmer.py +233 -240
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/nepali_stemmer.py +108 -134
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/norwegian_stemmer.py +108 -63
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/porter_stemmer.py +101 -108
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/portuguese_stemmer.py +241 -250
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/romanian_stemmer.py +332 -296
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/russian_stemmer.py +178 -179
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/serbian_stemmer.py +2331 -2332
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/spanish_stemmer.py +254 -259
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/swedish_stemmer.py +143 -70
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/tamil_stemmer.py +638 -1491
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/turkish_stemmer.py +326 -292
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/yiddish_stemmer.py +245 -246
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/_version.py +2 -2
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/connection.py +87 -38
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/contrib/emscripten/fetch.py +20 -0
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/poolmanager.py +17 -1
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/response.py +53 -24
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/util/request.py +12 -4
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/util/ssl_.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/_version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/_base_async.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/transport/_aiohttp.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/transport/_base_async.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/transport/_requests_asyncio.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/rest/_aiohttp.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/core/rest/_requests_asyncio.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/tracing/opentelemetry.py +13 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/utils/_pipeline_transport_rest_shared_async.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/utils/_utils.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_constants.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/default.py +23 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/environment.py +12 -16
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/service_fabric.py +22 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/user_password.py +10 -6
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/vscode.py +13 -4
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/auth_code_redirect_handler.py +3 -5
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/msal_client.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_persistent_cache.py +3 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/azd_cli.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/azure_cli.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/azure_powershell.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/chained.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/default.py +22 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/environment.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/service_fabric.py +17 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/vscode.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/certifi/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/certifi/core.py +1 -32
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/cli/__main__.py +62 -2
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/constant.py +17 -0
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/legacy.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/md.py +19 -14
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/utils.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/__about__.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/__init__.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/fernet.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/_oid.py +35 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/backends/openssl/backend.py +33 -10
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +14 -5
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +2 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +3 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +49 -45
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +2 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +10 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +3 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +8 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +3 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +6 -4
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +9 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +7 -6
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +79 -12
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +9 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/openssl/binding.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +5 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +4 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/_serialization.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +12 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +16 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +47 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +16 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +16 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +14 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +14 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +14 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +6 -6
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/ciphers/base.py +5 -4
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +18 -18
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/hashes.py +5 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +5 -4
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +7 -4
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/padding.py +7 -121
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +2 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +21 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +48 -6
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +68 -18
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +3 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/utils.py +15 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/__init__.py +3 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/base.py +39 -6
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/extensions.py +100 -49
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/name.py +27 -15
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/ocsp.py +60 -25
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/oid.py +2 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/verification.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/bidi.py +17 -4
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/client_info.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/gapic_v1/client_info.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_base.py +13 -4
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_streaming.py +7 -6
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_streaming_async.py +8 -5
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_unary.py +7 -6
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_unary_async.py +7 -6
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/_default.py +2 -36
- py2docfx/venv/venv1/Lib/site-packages/google/auth/_helpers.py +240 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/aio/_helpers.py +62 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/aio/transport/aiohttp.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/compute_engine/_metadata.py +5 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/compute_engine/credentials.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/identity_pool.py +91 -2
- py2docfx/venv/venv1/Lib/site-packages/google/auth/impersonated_credentials.py +75 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/__init__.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/_aiohttp_requests.py +8 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/_http_client.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/requests.py +4 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/urllib3.py +15 -5
- py2docfx/venv/venv1/Lib/site-packages/google/auth/version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/oauth2/id_token.py +12 -0
- py2docfx/venv/venv1/Lib/site-packages/google/oauth2/webauthn_types.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/any.py +15 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/any_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/api_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/compiler/plugin_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor.py +15 -2
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor_pb2.py +258 -113
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor_pool.py +22 -8
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/duration_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/empty_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/field_mask_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/decoder.py +106 -23
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/field_mask.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/python_edition_defaults.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/python_message.py +21 -18
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/testing_refleaks.py +8 -2
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/well_known_types.py +60 -43
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/json_format.py +4 -5
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/message_factory.py +16 -0
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/runtime_version.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/source_context_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/struct_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/text_format.py +11 -7
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/timestamp_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/type_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/wrappers_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/rpc/error_details_pb2.py +29 -23
- py2docfx/venv/venv1/Lib/site-packages/google/rpc/error_details_pb2.pyi +41 -2
- py2docfx/venv/venv1/Lib/site-packages/msal/application.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/msal/individual_cache.py +9 -5
- py2docfx/venv/venv1/Lib/site-packages/msal/managed_identity.py +4 -5
- py2docfx/venv/venv1/Lib/site-packages/msal/sku.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/msal/throttled_http_client.py +58 -30
- py2docfx/venv/venv1/Lib/site-packages/opencensus/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/__init__.py +138 -138
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/exporter.py +93 -93
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/processor.py +63 -63
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/protocol.py +206 -206
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/storage.py +205 -205
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/transport.py +355 -355
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/utils.py +79 -79
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/version.py +15 -15
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/log_exporter/__init__.py +314 -314
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/__init__.py +190 -190
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/__init__.py +62 -62
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/cpu.py +50 -50
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/http_requests.py +176 -176
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/memory.py +42 -42
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/process.py +87 -87
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/statsbeat/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/statsbeat/state.py +50 -50
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/statsbeat/statsbeat.py +100 -100
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/statsbeat/statsbeat_metrics.py +480 -480
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/trace_exporter/__init__.py +236 -236
- py2docfx/venv/venv1/Lib/site-packages/packaging/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/packaging/_elffile.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/packaging/_manylinux.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/packaging/_parser.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/packaging/_tokenizer.py +5 -4
- py2docfx/venv/venv1/Lib/site-packages/packaging/licenses/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/packaging/markers.py +53 -22
- py2docfx/venv/venv1/Lib/site-packages/packaging/metadata.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/packaging/specifiers.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/packaging/tags.py +39 -0
- py2docfx/venv/venv1/Lib/site-packages/pkg_resources/__init__.py +6 -7
- py2docfx/venv/venv1/Lib/site-packages/requests/__version__.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/requests/compat.py +12 -0
- py2docfx/venv/venv1/Lib/site-packages/requests/models.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/requests/utils.py +6 -16
- py2docfx/venv/venv1/Lib/site-packages/rsa/__init__.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/rsa/asn1.py +52 -52
- py2docfx/venv/venv1/Lib/site-packages/rsa/cli.py +321 -321
- py2docfx/venv/venv1/Lib/site-packages/rsa/common.py +184 -184
- py2docfx/venv/venv1/Lib/site-packages/rsa/core.py +53 -53
- py2docfx/venv/venv1/Lib/site-packages/rsa/key.py +858 -858
- py2docfx/venv/venv1/Lib/site-packages/rsa/parallel.py +96 -96
- py2docfx/venv/venv1/Lib/site-packages/rsa/pem.py +134 -134
- py2docfx/venv/venv1/Lib/site-packages/rsa/pkcs1.py +485 -485
- py2docfx/venv/venv1/Lib/site-packages/rsa/pkcs1_v2.py +100 -100
- py2docfx/venv/venv1/Lib/site-packages/rsa/prime.py +198 -198
- py2docfx/venv/venv1/Lib/site-packages/rsa/py.typed +1 -1
- py2docfx/venv/venv1/Lib/site-packages/rsa/randnum.py +95 -95
- py2docfx/venv/venv1/Lib/site-packages/rsa/transform.py +72 -72
- py2docfx/venv/venv1/Lib/site-packages/rsa/util.py +97 -97
- py2docfx/venv/venv1/Lib/site-packages/setuptools/__init__.py +0 -38
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_discovery.py +33 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build_scripts.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/config.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_unix.py +63 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/unix.py +5 -6
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_entry_points.py +4 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_normalization.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_path.py +12 -3
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_reqs.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_scripts.py +361 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_shutil.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/build_meta.py +25 -37
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/bdist_egg.py +9 -11
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/bdist_wheel.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/build_ext.py +29 -28
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/develop.py +39 -179
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/easy_install.py +17 -2352
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/editable_wheel.py +14 -31
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/egg_info.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/install.py +3 -55
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/install_scripts.py +5 -11
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/sdist.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/compat/py310.py +11 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/dist.py +10 -12
- py2docfx/venv/venv1/Lib/site-packages/setuptools/installer.py +34 -29
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/contexts.py +0 -14
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/fixtures.py +235 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/integration/test_pbr.py +20 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_build_meta.py +0 -24
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_develop.py +1 -64
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_dist.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_dist_info.py +0 -63
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_editable_install.py +15 -41
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_egg_info.py +3 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_scripts.py +12 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_wheel.py +12 -36
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_windows_wrappers.py +3 -4
- py2docfx/venv/venv1/Lib/site-packages/setuptools/wheel.py +49 -24
- py2docfx/venv/venv1/Lib/site-packages/typing_extensions.py +357 -703
- py2docfx/venv/venv1/Lib/site-packages/urllib3/_version.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/urllib3/connection.py +87 -38
- py2docfx/venv/venv1/Lib/site-packages/urllib3/contrib/emscripten/fetch.py +20 -0
- py2docfx/venv/venv1/Lib/site-packages/urllib3/poolmanager.py +17 -1
- py2docfx/venv/venv1/Lib/site-packages/urllib3/response.py +53 -24
- py2docfx/venv/venv1/Lib/site-packages/urllib3/util/request.py +12 -4
- py2docfx/venv/venv1/Lib/site-packages/urllib3/util/ssl_.py +1 -1
- {py2docfx-0.1.16.dev2064350.dist-info → py2docfx-0.1.17.dist-info}/METADATA +1 -1
- {py2docfx-0.1.16.dev2064350.dist-info → py2docfx-0.1.17.dist-info}/RECORD +374 -372
- {py2docfx-0.1.16.dev2064350.dist-info → py2docfx-0.1.17.dist-info}/WHEEL +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/package_index.py +0 -1137
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/sandbox.py +0 -536
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/server.py +0 -86
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_easy_install.py +0 -1476
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_packageindex.py +0 -267
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_sandbox.py +0 -134
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/application.py +0 -119
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/application.py +0 -121
- py2docfx/venv/venv1/Lib/site-packages/setuptools/package_index.py +0 -1137
- py2docfx/venv/venv1/Lib/site-packages/setuptools/sandbox.py +0 -536
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/server.py +0 -86
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_easy_install.py +0 -1476
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_packageindex.py +0 -267
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_sandbox.py +0 -134
- {py2docfx-0.1.16.dev2064350.dist-info → py2docfx-0.1.17.dist-info}/top_level.txt +0 -0
@@ -59,6 +59,10 @@ class _ExpiringMapping(MutableMapping):
|
|
59
59
|
self._expires_in = expires_in
|
60
60
|
self._lock = Lock() if lock is None else lock
|
61
61
|
|
62
|
+
def _peek(self):
|
63
|
+
# Returns (sequence, timestamps) without triggering maintenance
|
64
|
+
return self._mapping.get(self._INDEX, ([], {}))
|
65
|
+
|
62
66
|
def _validate_key(self, key):
|
63
67
|
if key == self._INDEX:
|
64
68
|
raise ValueError("key {} is a reserved keyword in {}".format(
|
@@ -85,7 +89,7 @@ class _ExpiringMapping(MutableMapping):
|
|
85
89
|
# This internal implementation powers both set() and __setitem__(),
|
86
90
|
# so that they don't depend on each other.
|
87
91
|
self._validate_key(key)
|
88
|
-
sequence, timestamps = self.
|
92
|
+
sequence, timestamps = self._peek()
|
89
93
|
self._maintenance(sequence, timestamps) # O(logN)
|
90
94
|
now = int(time.time())
|
91
95
|
expires_at = now + expires_in
|
@@ -136,7 +140,7 @@ class _ExpiringMapping(MutableMapping):
|
|
136
140
|
self._validate_key(key)
|
137
141
|
with self._lock:
|
138
142
|
# Skip self._maintenance(), because it would need O(logN) time
|
139
|
-
sequence, timestamps = self.
|
143
|
+
sequence, timestamps = self._peek()
|
140
144
|
expires_at, created_at = timestamps[key] # Would raise KeyError accordingly
|
141
145
|
now = int(time.time())
|
142
146
|
if not created_at <= now < expires_at:
|
@@ -155,14 +159,14 @@ class _ExpiringMapping(MutableMapping):
|
|
155
159
|
with self._lock:
|
156
160
|
# Skip self._maintenance(), because it would need O(logN) time
|
157
161
|
self._mapping.pop(key, None) # O(1)
|
158
|
-
sequence, timestamps = self.
|
162
|
+
sequence, timestamps = self._peek()
|
159
163
|
del timestamps[key] # O(1)
|
160
164
|
self._mapping[self._INDEX] = sequence, timestamps
|
161
165
|
|
162
166
|
def __len__(self): # O(logN)
|
163
167
|
"""Drop all expired items and return the remaining length"""
|
164
168
|
with self._lock:
|
165
|
-
sequence, timestamps = self.
|
169
|
+
sequence, timestamps = self._peek()
|
166
170
|
self._maintenance(sequence, timestamps) # O(logN)
|
167
171
|
self._mapping[self._INDEX] = sequence, timestamps
|
168
172
|
return len(timestamps) # Faster than iter(self._mapping) when it is on disk
|
@@ -170,7 +174,7 @@ class _ExpiringMapping(MutableMapping):
|
|
170
174
|
def __iter__(self):
|
171
175
|
"""Drop all expired items and return an iterator of the remaining items"""
|
172
176
|
with self._lock:
|
173
|
-
sequence, timestamps = self.
|
177
|
+
sequence, timestamps = self._peek()
|
174
178
|
self._maintenance(sequence, timestamps) # O(logN)
|
175
179
|
self._mapping[self._INDEX] = sequence, timestamps
|
176
180
|
return iter(timestamps) # Faster than iter(self._mapping) when it is on disk
|
@@ -112,8 +112,8 @@ class UserAssignedManagedIdentity(ManagedIdentity):
|
|
112
112
|
|
113
113
|
|
114
114
|
class _ThrottledHttpClient(ThrottledHttpClientBase):
|
115
|
-
def __init__(self,
|
116
|
-
super(_ThrottledHttpClient, self).__init__(
|
115
|
+
def __init__(self, *args, **kwargs):
|
116
|
+
super(_ThrottledHttpClient, self).__init__(*args, **kwargs)
|
117
117
|
self.get = IndividualCache( # All MIs (except Cloud Shell) use GETs
|
118
118
|
mapping=self._expiring_mapping,
|
119
119
|
key_maker=lambda func, args, kwargs: "REQ {} hash={} 429/5xx/Retry-After".format(
|
@@ -124,7 +124,7 @@ class _ThrottledHttpClient(ThrottledHttpClientBase):
|
|
124
124
|
str(kwargs.get("params")) + str(kwargs.get("data"))),
|
125
125
|
),
|
126
126
|
expires_in=RetryAfterParser(5).parse, # 5 seconds default for non-PCA
|
127
|
-
)(http_client.get)
|
127
|
+
)(self.get) # Note: Decorate the parent get(), not the http_client.get()
|
128
128
|
|
129
129
|
|
130
130
|
class ManagedIdentityClient(object):
|
@@ -233,8 +233,7 @@ class ManagedIdentityClient(object):
|
|
233
233
|
# (especially for 410 which was supposed to be a permanent failure).
|
234
234
|
# 2. MI on Service Fabric specifically suggests to not retry on 404.
|
235
235
|
# ( https://learn.microsoft.com/en-us/azure/service-fabric/how-to-managed-cluster-managed-identity-service-fabric-app-code#error-handling )
|
236
|
-
http_client
|
237
|
-
if isinstance(http_client, ThrottledHttpClientBase) else http_client,
|
236
|
+
http_client,
|
238
237
|
http_cache=http_cache,
|
239
238
|
)
|
240
239
|
self._token_cache = token_cache or TokenCache()
|
@@ -3,26 +3,34 @@ from hashlib import sha256
|
|
3
3
|
|
4
4
|
from .individual_cache import _IndividualCache as IndividualCache
|
5
5
|
from .individual_cache import _ExpiringMapping as ExpiringMapping
|
6
|
+
from .oauth2cli.http import Response
|
7
|
+
from .exceptions import MsalServiceError
|
6
8
|
|
7
9
|
|
8
10
|
# https://datatracker.ietf.org/doc/html/rfc8628#section-3.4
|
9
11
|
DEVICE_AUTH_GRANT = "urn:ietf:params:oauth:grant-type:device_code"
|
10
12
|
|
11
13
|
|
14
|
+
def _get_headers(response):
|
15
|
+
# MSAL's HttpResponse did not have headers until 1.23.0
|
16
|
+
# https://github.com/AzureAD/microsoft-authentication-library-for-python/pull/581/files#diff-28866b706bc3830cd20485685f20fe79d45b58dce7050e68032e9d9372d68654R61
|
17
|
+
# This helper ensures graceful degradation to {} without exception
|
18
|
+
return getattr(response, "headers", {})
|
19
|
+
|
20
|
+
|
12
21
|
class RetryAfterParser(object):
|
22
|
+
FIELD_NAME_LOWER = "Retry-After".lower()
|
13
23
|
def __init__(self, default_value=None):
|
14
24
|
self._default_value = 5 if default_value is None else default_value
|
15
25
|
|
16
26
|
def parse(self, *, result, **ignored):
|
17
27
|
"""Return seconds to throttle"""
|
18
28
|
response = result
|
19
|
-
lowercase_headers = {k.lower(): v for k, v in
|
20
|
-
# Historically, MSAL's HttpResponse does not always have headers
|
21
|
-
response, "headers", {}).items()}
|
29
|
+
lowercase_headers = {k.lower(): v for k, v in _get_headers(response).items()}
|
22
30
|
if not (response.status_code == 429 or response.status_code >= 500
|
23
|
-
or
|
31
|
+
or self.FIELD_NAME_LOWER in lowercase_headers):
|
24
32
|
return 0 # Quick exit
|
25
|
-
retry_after = lowercase_headers.get(
|
33
|
+
retry_after = lowercase_headers.get(self.FIELD_NAME_LOWER, self._default_value)
|
26
34
|
try:
|
27
35
|
# AAD's retry_after uses integer format only
|
28
36
|
# https://stackoverflow.microsoft.com/questions/264931/264932
|
@@ -37,16 +45,44 @@ def _extract_data(kwargs, key, default=None):
|
|
37
45
|
return data.get(key) if isinstance(data, dict) else default
|
38
46
|
|
39
47
|
|
48
|
+
class NormalizedResponse(Response):
|
49
|
+
"""A http response with the shape defined in Response,
|
50
|
+
but contains only the data we will store in cache.
|
51
|
+
"""
|
52
|
+
def __init__(self, raw_response):
|
53
|
+
super().__init__()
|
54
|
+
self.status_code = raw_response.status_code
|
55
|
+
self.text = raw_response.text
|
56
|
+
self.headers = {
|
57
|
+
k.lower(): v for k, v in _get_headers(raw_response).items()
|
58
|
+
# Attempted storing only a small set of headers (such as Retry-After),
|
59
|
+
# but it tends to lead to missing information (such as WWW-Authenticate).
|
60
|
+
# So we store all headers, which are expected to contain only public info,
|
61
|
+
# because we throttle only error responses and public responses.
|
62
|
+
}
|
63
|
+
|
64
|
+
## Note: Don't use the following line,
|
65
|
+
## because when being pickled, it will indirectly pickle the whole raw_response
|
66
|
+
# self.raise_for_status = raw_response.raise_for_status
|
67
|
+
def raise_for_status(self):
|
68
|
+
if self.status_code >= 400:
|
69
|
+
raise MsalServiceError("HTTP Error: {}".format(self.status_code))
|
70
|
+
|
71
|
+
|
40
72
|
class ThrottledHttpClientBase(object):
|
41
73
|
"""Throttle the given http_client by storing and retrieving data from cache.
|
42
74
|
|
43
|
-
This
|
44
|
-
|
75
|
+
This base exists so that:
|
76
|
+
1. These base post() and get() will return a NormalizedResponse
|
77
|
+
2. The base __init__() will NOT re-throttle even if caller accidentally nested ThrottledHttpClient.
|
45
78
|
|
46
|
-
|
79
|
+
Subclasses shall only need to dynamically decorate their post() and get() methods
|
80
|
+
in their __init__() method.
|
47
81
|
"""
|
48
82
|
def __init__(self, http_client, *, http_cache=None):
|
49
|
-
self.http_client = http_client
|
83
|
+
self.http_client = http_client.http_client if isinstance(
|
84
|
+
# If it is already a ThrottledHttpClientBase, we use its raw (unthrottled) http client
|
85
|
+
http_client, ThrottledHttpClientBase) else http_client
|
50
86
|
self._expiring_mapping = ExpiringMapping( # It will automatically clean up
|
51
87
|
mapping=http_cache if http_cache is not None else {},
|
52
88
|
capacity=1024, # To prevent cache blowing up especially for CCA
|
@@ -54,10 +90,10 @@ class ThrottledHttpClientBase(object):
|
|
54
90
|
)
|
55
91
|
|
56
92
|
def post(self, *args, **kwargs):
|
57
|
-
return self.http_client.post(*args, **kwargs)
|
93
|
+
return NormalizedResponse(self.http_client.post(*args, **kwargs))
|
58
94
|
|
59
95
|
def get(self, *args, **kwargs):
|
60
|
-
return self.http_client.get(*args, **kwargs)
|
96
|
+
return NormalizedResponse(self.http_client.get(*args, **kwargs))
|
61
97
|
|
62
98
|
def close(self):
|
63
99
|
return self.http_client.close()
|
@@ -68,12 +104,11 @@ class ThrottledHttpClientBase(object):
|
|
68
104
|
|
69
105
|
|
70
106
|
class ThrottledHttpClient(ThrottledHttpClientBase):
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
_post = IndividualCache(
|
107
|
+
"""A throttled http client that is used by MSAL's non-managed identity clients."""
|
108
|
+
def __init__(self, *args, default_throttle_time=None, **kwargs):
|
109
|
+
"""Decorate self.post() and self.get() dynamically"""
|
110
|
+
super(ThrottledHttpClient, self).__init__(*args, **kwargs)
|
111
|
+
self.post = IndividualCache(
|
77
112
|
# Internal specs requires throttling on at least token endpoint,
|
78
113
|
# here we have a generic patch for POST on all endpoints.
|
79
114
|
mapping=self._expiring_mapping,
|
@@ -91,9 +126,9 @@ class ThrottledHttpClient(ThrottledHttpClientBase):
|
|
91
126
|
_extract_data(kwargs, "username")))), # "account" of ROPC
|
92
127
|
),
|
93
128
|
expires_in=RetryAfterParser(default_throttle_time or 5).parse,
|
94
|
-
)(
|
129
|
+
)(self.post)
|
95
130
|
|
96
|
-
|
131
|
+
self.post = IndividualCache( # It covers the "UI required cache"
|
97
132
|
mapping=self._expiring_mapping,
|
98
133
|
key_maker=lambda func, args, kwargs: "POST {} hash={} 400".format(
|
99
134
|
args[0], # It is the url, typically containing authority and tenant
|
@@ -125,12 +160,10 @@ class ThrottledHttpClient(ThrottledHttpClientBase):
|
|
125
160
|
isinstance(kwargs.get("data"), dict)
|
126
161
|
and kwargs["data"].get("grant_type") == DEVICE_AUTH_GRANT
|
127
162
|
)
|
128
|
-
and
|
129
|
-
h.lower() for h in
|
163
|
+
and RetryAfterParser.FIELD_NAME_LOWER not in set( # Otherwise leave it to the Retry-After decorator
|
164
|
+
h.lower() for h in _get_headers(result))
|
130
165
|
else 0,
|
131
|
-
)(
|
132
|
-
|
133
|
-
self.post = _post
|
166
|
+
)(self.post)
|
134
167
|
|
135
168
|
self.get = IndividualCache( # Typically those discovery GETs
|
136
169
|
mapping=self._expiring_mapping,
|
@@ -140,9 +173,4 @@ class ThrottledHttpClient(ThrottledHttpClientBase):
|
|
140
173
|
),
|
141
174
|
expires_in=lambda result=None, **ignored:
|
142
175
|
3600*24 if 200 <= result.status_code < 300 else 0,
|
143
|
-
)(
|
144
|
-
|
145
|
-
# The following 2 methods have been defined dynamically by __init__()
|
146
|
-
#def post(self, *args, **kwargs): pass
|
147
|
-
#def get(self, *args, **kwargs): pass
|
148
|
-
|
176
|
+
)(self.get)
|
@@ -1 +1 @@
|
|
1
|
-
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
1
|
+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
@@ -1 +1 @@
|
|
1
|
-
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
1
|
+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
@@ -1 +1 @@
|
|
1
|
-
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
1
|
+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
@@ -1,138 +1,138 @@
|
|
1
|
-
# Copyright 2019, OpenCensus Authors
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
import logging
|
16
|
-
import os
|
17
|
-
import tempfile
|
18
|
-
|
19
|
-
from opencensus.ext.azure.common.protocol import BaseObject
|
20
|
-
|
21
|
-
INGESTION_ENDPOINT = 'ingestionendpoint'
|
22
|
-
INSTRUMENTATION_KEY = 'instrumentationkey'
|
23
|
-
TEMPDIR_PREFIX = "opencensus-python-"
|
24
|
-
|
25
|
-
_logger = logging.getLogger(__name__)
|
26
|
-
|
27
|
-
|
28
|
-
def process_options(options):
|
29
|
-
# Connection string/ikey
|
30
|
-
code_cs = parse_connection_string(options.connection_string)
|
31
|
-
code_ikey = options.instrumentation_key
|
32
|
-
env_cs = parse_connection_string(
|
33
|
-
os.getenv('APPLICATIONINSIGHTS_CONNECTION_STRING'))
|
34
|
-
env_ikey = os.getenv('APPINSIGHTS_INSTRUMENTATIONKEY')
|
35
|
-
|
36
|
-
# Deprecation note about explicit instrumentation key usage
|
37
|
-
if (not code_cs and code_ikey) or (not env_cs and env_ikey):
|
38
|
-
_logger.warning(
|
39
|
-
"DeprecationWarning: Explicitly using instrumentation key is"
|
40
|
-
"deprecated. Please use a connection string instead."
|
41
|
-
)
|
42
|
-
|
43
|
-
# The priority of which value takes on the instrumentation key is:
|
44
|
-
# 1. Key from explicitly passed in connection string
|
45
|
-
# 2. Key from explicitly passed in instrumentation key
|
46
|
-
# 3. Key from connection string in environment variable
|
47
|
-
# 4. Key from instrumentation key in environment variable
|
48
|
-
options.instrumentation_key = code_cs.get(INSTRUMENTATION_KEY) \
|
49
|
-
or code_ikey \
|
50
|
-
or env_cs.get(INSTRUMENTATION_KEY) \
|
51
|
-
or env_ikey
|
52
|
-
# The priority of the ingestion endpoint is as follows:
|
53
|
-
# 1. The endpoint explicitly passed in connection string
|
54
|
-
# 2. The endpoint from the connection string in environment variable
|
55
|
-
# 3. The default breeze endpoint
|
56
|
-
endpoint = code_cs.get(INGESTION_ENDPOINT) \
|
57
|
-
or env_cs.get(INGESTION_ENDPOINT) \
|
58
|
-
or 'https://dc.services.visualstudio.com'
|
59
|
-
options.endpoint = endpoint
|
60
|
-
|
61
|
-
# Authorization
|
62
|
-
# `azure.core.credentials.TokenCredential` class must be valid
|
63
|
-
if options.credential and not hasattr(options.credential, 'get_token'):
|
64
|
-
raise ValueError(
|
65
|
-
'Must pass in valid TokenCredential.'
|
66
|
-
)
|
67
|
-
|
68
|
-
# storage path
|
69
|
-
if options.storage_path is None:
|
70
|
-
TEMPDIR_SUFFIX = options.instrumentation_key or ""
|
71
|
-
options.storage_path = os.path.join(
|
72
|
-
tempfile.gettempdir(),
|
73
|
-
TEMPDIR_PREFIX + TEMPDIR_SUFFIX
|
74
|
-
)
|
75
|
-
|
76
|
-
# proxies
|
77
|
-
if options.proxies is None:
|
78
|
-
options.proxies = '{}'
|
79
|
-
|
80
|
-
|
81
|
-
def parse_connection_string(connection_string):
|
82
|
-
if connection_string is None:
|
83
|
-
return {}
|
84
|
-
try:
|
85
|
-
pairs = connection_string.split(';')
|
86
|
-
result = dict(s.split('=') for s in pairs)
|
87
|
-
# Convert keys to lower-case due to case type-insensitive checking
|
88
|
-
result = {key.lower(): value for key, value in result.items()}
|
89
|
-
except Exception:
|
90
|
-
raise ValueError('Invalid connection string')
|
91
|
-
# Validate authorization
|
92
|
-
auth = result.get('authorization')
|
93
|
-
if auth is not None and auth.lower() != 'ikey':
|
94
|
-
raise ValueError('Invalid authorization mechanism')
|
95
|
-
# Construct the ingestion endpoint if not passed in explicitly
|
96
|
-
if result.get(INGESTION_ENDPOINT) is None:
|
97
|
-
endpoint_suffix = ''
|
98
|
-
location_prefix = ''
|
99
|
-
suffix = result.get('endpointsuffix')
|
100
|
-
if suffix is not None:
|
101
|
-
endpoint_suffix = suffix
|
102
|
-
# Get regional information if provided
|
103
|
-
prefix = result.get('location')
|
104
|
-
if prefix is not None:
|
105
|
-
location_prefix = prefix + '.'
|
106
|
-
endpoint = 'https://' + location_prefix + 'dc.' + endpoint_suffix
|
107
|
-
result[INGESTION_ENDPOINT] = endpoint
|
108
|
-
else:
|
109
|
-
# Default to None if cannot construct
|
110
|
-
result[INGESTION_ENDPOINT] = None
|
111
|
-
return result
|
112
|
-
|
113
|
-
|
114
|
-
class Options(BaseObject):
|
115
|
-
def __init__(self, *args, **kwargs):
|
116
|
-
super(Options, self).__init__(*args, **kwargs)
|
117
|
-
process_options(self)
|
118
|
-
|
119
|
-
_default = BaseObject(
|
120
|
-
connection_string=None,
|
121
|
-
credential=None, # Credential class used by AAD auth
|
122
|
-
enable_local_storage=True,
|
123
|
-
enable_standard_metrics=True, # Used by metrics exporter, True to send standard metrics # noqa: E501
|
124
|
-
endpoint='https://dc.services.visualstudio.com/v2/track',
|
125
|
-
export_interval=15.0,
|
126
|
-
grace_period=5.0,
|
127
|
-
instrumentation_key=None,
|
128
|
-
logging_sampling_rate=1.0, # Used by log exporter, controls sampling
|
129
|
-
max_batch_size=100,
|
130
|
-
minimum_retry_interval=60, # minimum retry interval in seconds
|
131
|
-
proxies=None, # string maps url schemes to the url of the proxies
|
132
|
-
queue_capacity=8192,
|
133
|
-
storage_maintenance_period=60,
|
134
|
-
storage_max_size=50*1024*1024, # 50MiB
|
135
|
-
storage_path=None,
|
136
|
-
storage_retention_period=7*24*60*60,
|
137
|
-
timeout=10.0, # networking timeout in seconds
|
138
|
-
)
|
1
|
+
# Copyright 2019, OpenCensus Authors
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
import logging
|
16
|
+
import os
|
17
|
+
import tempfile
|
18
|
+
|
19
|
+
from opencensus.ext.azure.common.protocol import BaseObject
|
20
|
+
|
21
|
+
INGESTION_ENDPOINT = 'ingestionendpoint'
|
22
|
+
INSTRUMENTATION_KEY = 'instrumentationkey'
|
23
|
+
TEMPDIR_PREFIX = "opencensus-python-"
|
24
|
+
|
25
|
+
_logger = logging.getLogger(__name__)
|
26
|
+
|
27
|
+
|
28
|
+
def process_options(options):
|
29
|
+
# Connection string/ikey
|
30
|
+
code_cs = parse_connection_string(options.connection_string)
|
31
|
+
code_ikey = options.instrumentation_key
|
32
|
+
env_cs = parse_connection_string(
|
33
|
+
os.getenv('APPLICATIONINSIGHTS_CONNECTION_STRING'))
|
34
|
+
env_ikey = os.getenv('APPINSIGHTS_INSTRUMENTATIONKEY')
|
35
|
+
|
36
|
+
# Deprecation note about explicit instrumentation key usage
|
37
|
+
if (not code_cs and code_ikey) or (not env_cs and env_ikey):
|
38
|
+
_logger.warning(
|
39
|
+
"DeprecationWarning: Explicitly using instrumentation key is"
|
40
|
+
"deprecated. Please use a connection string instead."
|
41
|
+
)
|
42
|
+
|
43
|
+
# The priority of which value takes on the instrumentation key is:
|
44
|
+
# 1. Key from explicitly passed in connection string
|
45
|
+
# 2. Key from explicitly passed in instrumentation key
|
46
|
+
# 3. Key from connection string in environment variable
|
47
|
+
# 4. Key from instrumentation key in environment variable
|
48
|
+
options.instrumentation_key = code_cs.get(INSTRUMENTATION_KEY) \
|
49
|
+
or code_ikey \
|
50
|
+
or env_cs.get(INSTRUMENTATION_KEY) \
|
51
|
+
or env_ikey
|
52
|
+
# The priority of the ingestion endpoint is as follows:
|
53
|
+
# 1. The endpoint explicitly passed in connection string
|
54
|
+
# 2. The endpoint from the connection string in environment variable
|
55
|
+
# 3. The default breeze endpoint
|
56
|
+
endpoint = code_cs.get(INGESTION_ENDPOINT) \
|
57
|
+
or env_cs.get(INGESTION_ENDPOINT) \
|
58
|
+
or 'https://dc.services.visualstudio.com'
|
59
|
+
options.endpoint = endpoint
|
60
|
+
|
61
|
+
# Authorization
|
62
|
+
# `azure.core.credentials.TokenCredential` class must be valid
|
63
|
+
if options.credential and not hasattr(options.credential, 'get_token'):
|
64
|
+
raise ValueError(
|
65
|
+
'Must pass in valid TokenCredential.'
|
66
|
+
)
|
67
|
+
|
68
|
+
# storage path
|
69
|
+
if options.storage_path is None:
|
70
|
+
TEMPDIR_SUFFIX = options.instrumentation_key or ""
|
71
|
+
options.storage_path = os.path.join(
|
72
|
+
tempfile.gettempdir(),
|
73
|
+
TEMPDIR_PREFIX + TEMPDIR_SUFFIX
|
74
|
+
)
|
75
|
+
|
76
|
+
# proxies
|
77
|
+
if options.proxies is None:
|
78
|
+
options.proxies = '{}'
|
79
|
+
|
80
|
+
|
81
|
+
def parse_connection_string(connection_string):
|
82
|
+
if connection_string is None:
|
83
|
+
return {}
|
84
|
+
try:
|
85
|
+
pairs = connection_string.split(';')
|
86
|
+
result = dict(s.split('=') for s in pairs)
|
87
|
+
# Convert keys to lower-case due to case type-insensitive checking
|
88
|
+
result = {key.lower(): value for key, value in result.items()}
|
89
|
+
except Exception:
|
90
|
+
raise ValueError('Invalid connection string')
|
91
|
+
# Validate authorization
|
92
|
+
auth = result.get('authorization')
|
93
|
+
if auth is not None and auth.lower() != 'ikey':
|
94
|
+
raise ValueError('Invalid authorization mechanism')
|
95
|
+
# Construct the ingestion endpoint if not passed in explicitly
|
96
|
+
if result.get(INGESTION_ENDPOINT) is None:
|
97
|
+
endpoint_suffix = ''
|
98
|
+
location_prefix = ''
|
99
|
+
suffix = result.get('endpointsuffix')
|
100
|
+
if suffix is not None:
|
101
|
+
endpoint_suffix = suffix
|
102
|
+
# Get regional information if provided
|
103
|
+
prefix = result.get('location')
|
104
|
+
if prefix is not None:
|
105
|
+
location_prefix = prefix + '.'
|
106
|
+
endpoint = 'https://' + location_prefix + 'dc.' + endpoint_suffix
|
107
|
+
result[INGESTION_ENDPOINT] = endpoint
|
108
|
+
else:
|
109
|
+
# Default to None if cannot construct
|
110
|
+
result[INGESTION_ENDPOINT] = None
|
111
|
+
return result
|
112
|
+
|
113
|
+
|
114
|
+
class Options(BaseObject):
|
115
|
+
def __init__(self, *args, **kwargs):
|
116
|
+
super(Options, self).__init__(*args, **kwargs)
|
117
|
+
process_options(self)
|
118
|
+
|
119
|
+
_default = BaseObject(
|
120
|
+
connection_string=None,
|
121
|
+
credential=None, # Credential class used by AAD auth
|
122
|
+
enable_local_storage=True,
|
123
|
+
enable_standard_metrics=True, # Used by metrics exporter, True to send standard metrics # noqa: E501
|
124
|
+
endpoint='https://dc.services.visualstudio.com/v2/track',
|
125
|
+
export_interval=15.0,
|
126
|
+
grace_period=5.0,
|
127
|
+
instrumentation_key=None,
|
128
|
+
logging_sampling_rate=1.0, # Used by log exporter, controls sampling
|
129
|
+
max_batch_size=100,
|
130
|
+
minimum_retry_interval=60, # minimum retry interval in seconds
|
131
|
+
proxies=None, # string maps url schemes to the url of the proxies
|
132
|
+
queue_capacity=8192,
|
133
|
+
storage_maintenance_period=60,
|
134
|
+
storage_max_size=50*1024*1024, # 50MiB
|
135
|
+
storage_path=None,
|
136
|
+
storage_retention_period=7*24*60*60,
|
137
|
+
timeout=10.0, # networking timeout in seconds
|
138
|
+
)
|