py2docfx 0.1.14.dev2019025__py3-none-any.whl → 0.1.15__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/venv/basevenv/Lib/site-packages/setuptools/_distutils/_modified.py +26 -4
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/_msvccompiler.py +2 -603
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/archive_util.py +48 -18
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/ccompiler.py +17 -1257
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/cmd.py +133 -41
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/bdist.py +19 -8
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/bdist_dumb.py +2 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/bdist_rpm.py +6 -5
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build.py +8 -4
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build_clib.py +8 -7
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build_ext.py +32 -13
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build_py.py +10 -9
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build_scripts.py +3 -14
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/check.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/clean.py +2 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/config.py +1 -8
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/install.py +22 -19
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/install_data.py +4 -3
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/install_headers.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/install_lib.py +11 -7
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/install_scripts.py +4 -3
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/sdist.py +22 -16
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compat/__init__.py +6 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/base.py +1391 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/cygwin.py +340 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/errors.py +24 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/msvc.py +614 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/{tests/test_ccompiler.py → compilers/C/tests/test_base.py} +9 -19
- py2docfx/venv/{venv1/Lib/site-packages/setuptools/_distutils/tests/test_cygwinccompiler.py → basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_cygwin.py} +7 -12
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/{tests/test_mingwccompiler.py → compilers/C/tests/test_mingw.py} +12 -20
- py2docfx/venv/{venv1/Lib/site-packages/setuptools/_distutils/tests/test_msvccompiler.py → basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_msvc.py} +11 -12
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/{tests/test_unixccompiler.py → compilers/C/tests/test_unix.py} +5 -5
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/unix.py +409 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/zos.py +230 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/cygwinccompiler.py +20 -328
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/dist.py +148 -80
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/errors.py +11 -27
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/extension.py +19 -16
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/filelist.py +80 -15
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/spawn.py +22 -5
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/sysconfig.py +32 -7
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/tests/test_build_ext.py +13 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/tests/test_sdist.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/unixccompiler.py +2 -401
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/util.py +38 -23
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/zosccompiler.py +2 -228
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_static.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/editable_wheel.py +3 -3
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/install.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/config/test_setupcfg.py +2 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_build_py.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/unicode_utils.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/__init__.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/ado_consts.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/adodbapi.py +22 -26
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/apibase.py +3 -4
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/examples/db_print.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/examples/db_table_names.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/process_connect_string.py +7 -7
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/setup.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/adodbapitest.py +21 -73
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/adodbapitestconfig.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/dbapi20.py +11 -17
- py2docfx/venv/venv1/Lib/site-packages/adodbapi/test/setuptestframework.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/application.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/authorization_code.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/azd_cli.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/azure_cli.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/azure_pipelines.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/azure_powershell.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/chained.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/default.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/environment.py +4 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/managed_identity.py +48 -21
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/shared_cache.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/user_password.py +10 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/vscode.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/aad_client_base.py +13 -3
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/aadclient_certificate.py +28 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/application.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/authorization_code.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_pipelines.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/certificate.py +3 -3
- 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 +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/environment.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/managed_identity.py +23 -12
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/shared_cache.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/vscode.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_streaming.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_streaming_async.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/isapi/install.py +8 -11
- py2docfx/venv/venv1/Lib/site-packages/isapi/samples/redirector.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/isapi/samples/redirector_asynch.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/isapi/samples/redirector_with_filter.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/isapi/simple.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/isapi/threaded_extension.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/proto/version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/app/basictimerapp.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/app/customprint.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/app/demoutils.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/cmdserver.py +2 -5
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/guidemo.py +14 -41
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/objdoc.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/demoutils.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/flash.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/ocxserialtest.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/ocxtest.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/webbrowser.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/openGLDemo.py +57 -12
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/toolbar.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/configui.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/dbgcon.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/debugger.py +7 -8
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/debugger/fail.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/dialogs/ideoptions.py +7 -10
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/dialogs/list.py +11 -8
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/dialogs/login.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/docking/DockingBar.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/app.py +19 -22
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/dbgcommands.py +2 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/ModuleBrowser.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/__init__.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/document.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/editor.py +6 -6
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/editor/vss.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/help.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/interact.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/intpyapp.py +5 -7
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/intpydde.py +7 -2
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/scriptutils.py +4 -6
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/sgrepmdi.py +13 -22
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/startup.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/stdin.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/toolmenu.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/idle/AutoIndent.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/idle/CallTips.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/activex.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/mfc/dialog.py +7 -10
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/IDLEenvironment.py +1 -5
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/bindings.py +4 -2
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/config.py +3 -5
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/configui.py +2 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/document.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/formatter.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/keycodes.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/scintillacon.py +1178 -78
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/scintilla/view.py +17 -21
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/tools/browser.py +6 -18
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/tools/hierlist.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/_modified.py +26 -4
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/_msvccompiler.py +2 -603
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/archive_util.py +48 -18
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/ccompiler.py +17 -1257
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/cmd.py +133 -41
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/bdist.py +19 -8
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/bdist_dumb.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/bdist_rpm.py +6 -5
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build.py +8 -4
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build_clib.py +8 -7
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build_ext.py +32 -13
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build_py.py +10 -9
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build_scripts.py +3 -14
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/check.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/clean.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/config.py +1 -8
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/install.py +22 -19
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/install_data.py +4 -3
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/install_headers.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/install_lib.py +11 -7
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/install_scripts.py +4 -3
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/sdist.py +22 -16
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compat/__init__.py +6 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/base.py +1391 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/cygwin.py +340 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/errors.py +24 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/msvc.py +614 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/{tests/test_ccompiler.py → compilers/C/tests/test_base.py} +9 -19
- py2docfx/venv/{basevenv/Lib/site-packages/setuptools/_distutils/tests/test_cygwinccompiler.py → venv1/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_cygwin.py} +7 -12
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/{tests/test_mingwccompiler.py → compilers/C/tests/test_mingw.py} +12 -20
- py2docfx/venv/{basevenv/Lib/site-packages/setuptools/_distutils/tests/test_msvccompiler.py → venv1/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_msvc.py} +11 -12
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/{tests/test_unixccompiler.py → compilers/C/tests/test_unix.py} +5 -5
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/unix.py +409 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/zos.py +230 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/cygwinccompiler.py +20 -328
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/dist.py +148 -80
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/errors.py +11 -27
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/extension.py +19 -16
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/filelist.py +80 -15
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/spawn.py +22 -5
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/sysconfig.py +32 -7
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/tests/test_build_ext.py +13 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/tests/test_sdist.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/unixccompiler.py +2 -401
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/util.py +38 -23
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/zosccompiler.py +2 -228
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_static.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/editable_wheel.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/install.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/config/test_setupcfg.py +2 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_build_py.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/unicode_utils.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/EvtFormatMessage.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/EvtSubscribe_push.py +8 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/GetSaveFileName.py +8 -8
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/c_extension/setup.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/dde/ddeclient.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/dde/ddeserver.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/getfilever.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/pipes/runproc.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/rastest.py +4 -6
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/GetTokenInformation.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/account_rights.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/explicit_entries.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/get_policy_info.py +0 -3
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/list_rights.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/localized_names.py +7 -2
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/query_information.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/set_file_audit.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/set_file_owner.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/set_policy_info.py +0 -3
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/setkernelobjectsecurity.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/setsecurityinfo.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/setuserobjectsecurity.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/sspi/fetch_url.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/sspi/simple_auth.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/security/sspi/socket_server.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/service/pipeTestService.py +10 -9
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/service/pipeTestServiceClient.py +6 -3
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32clipboardDemo.py +17 -5
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32comport_demo.py +32 -2
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32console_demo.py +1 -4
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32gui_devicenotify.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32gui_menu.py +60 -5
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32gui_taskbar.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32netdemo.py +2 -5
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32ts_logoff_disconnected.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/Demos/win32wnet/testwnet.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/commctrl.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/netbios.py +8 -10
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/pywin32_bootstrap.py +2 -10
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/pywin32_testutil.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/pywintypes.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/regutil.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/sspi.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win2kras.py +14 -7
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32con.py +16 -35
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32cryptcon.py +1 -4
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32evtlogutil.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32gui_struct.py +6 -6
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32pdhquery.py +10 -11
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32pdhutil.py +5 -5
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32rcparser.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32serviceutil.py +4 -6
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32timezone.py +304 -121
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/win32verstamp.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/winerror.py +4926 -604
- py2docfx/venv/venv1/Lib/site-packages/win32/lib/winxptheme.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/h2py.py +194 -0
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/pywin32_postinstall.py +733 -0
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/pywin32_testall.py +120 -0
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/regsetup.py +4 -7
- py2docfx/venv/venv1/Lib/site-packages/win32/scripts/setup_d.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/test/handles.py +13 -5
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_clipboard.py +12 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_sspi.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32api.py +8 -4
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32clipboard.py +2 -3
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32cred.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32crypt.py +16 -3
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32file.py +24 -8
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32gui.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32guistruct.py +2 -5
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32inet.py +23 -6
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32net.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32/test/test_win32ts.py +19 -0
- py2docfx/venv/venv1/Lib/site-packages/win32/winxpgui.py +3 -11
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/CLSIDToClass.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/__init__.py +97 -65
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/build.py +24 -24
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/combrowse.py +17 -33
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/dynamic.py +14 -14
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/gencache.py +30 -12
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/genpy.py +50 -98
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/makepy.py +12 -8
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/selecttlb.py +3 -4
- py2docfx/venv/venv1/Lib/site-packages/win32com/client/util.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/dump_clipboard.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/excelAddin.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/excelRTDServer.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/iebutton.py +0 -3
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/ietoolbar.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/demos/outlookAddin.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/win32com/makegw/makegw.py +48 -56
- py2docfx/venv/venv1/Lib/site-packages/win32com/makegw/makegwenum.py +2 -6
- py2docfx/venv/venv1/Lib/site-packages/win32com/makegw/makegwparse.py +9 -11
- py2docfx/venv/venv1/Lib/site-packages/win32com/olectl.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/connect.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/dispatcher.py +20 -24
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/exception.py +8 -8
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/policy.py +4 -18
- py2docfx/venv/venv1/Lib/site-packages/win32com/server/register.py +5 -6
- py2docfx/venv/venv1/Lib/site-packages/win32com/servers/dictionary.py +2 -5
- py2docfx/venv/venv1/Lib/site-packages/win32com/servers/interp.py +7 -7
- py2docfx/venv/venv1/Lib/site-packages/win32com/servers/test_pycomtest.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/GenTestScripts.py +2 -4
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/errorSemantics.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/pippo_server.py +1 -4
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testADOEvents.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testAXScript.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testDictionary.py +4 -3
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testDynamic.py +3 -5
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testExchange.py +2 -7
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testGatewayAddresses.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testIterators.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testMSOffice.py +40 -57
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testMSOfficeEvents.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testPersist.py +7 -7
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testPippo.py +2 -3
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testPyComTest.py +143 -7
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testServers.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testall.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testmakepy.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testvb.py +12 -8
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/util.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/win32com/universal.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/win32com/util.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/adsi/demos/scp.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/adsi/demos/search.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/authorization/demos/EditSecurity.py +1 -24
- py2docfx/venv/venv1/Lib/site-packages/win32comext/authorization/demos/EditServiceSecurity.py +0 -20
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/adb.py +2 -8
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/codecontainer.py +16 -12
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/contexts.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/debugger.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/documents.py +2 -3
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/dump.py +2 -4
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/expressions.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axdebug/util.py +7 -14
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/debug.py +2 -14
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/error.py +4 -5
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/framework.py +5 -5
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/pydumper.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/pyscript.py +5 -10
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/client/scriptdispatch.py +3 -4
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/server/axsite.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/test/leakTest.py +2 -3
- py2docfx/venv/venv1/Lib/site-packages/win32comext/axscript/test/testHost4Dbg.py +0 -3
- py2docfx/venv/venv1/Lib/site-packages/win32comext/bits/test/test_bits.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/win32comext/ifilter/demo/filterDemo.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/mapi/demos/mapisend.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/mapi/emsabtags.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/win32comext/mapi/mapitags.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/win32comext/mapi/mapiutil.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/win32comext/propsys/test/testpropsys.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/IFileOperationProgressSink.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/ITransferAdviseSink.py +5 -3
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/column_provider.py +0 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/copy_hook.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/empty_volume_cache.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/folder_view.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/icon_handler.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/win32comext/shell/demos/servers/shell_view.py +4 -5
- py2docfx/venv/venv1/Lib/site-packages/win32comext/taskscheduler/test/test_addtask_2.py +0 -1
- py2docfx/venv/venv1/Scripts/pywin32_postinstall.py +77 -122
- py2docfx/venv/venv1/Scripts/pywin32_testall.py +4 -9
- {py2docfx-0.1.14.dev2019025.dist-info → py2docfx-0.1.15.dist-info}/METADATA +1 -1
- {py2docfx-0.1.14.dev2019025.dist-info → py2docfx-0.1.15.dist-info}/RECORD +375 -362
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/Demos/ocx/__init__.py +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pythonwin/pywin/framework/mdi_pychecker.py +0 -850
- py2docfx/venv/venv1/Lib/site-packages/win32com/test/testNetscape.py +0 -24
- {py2docfx-0.1.14.dev2019025.dist-info → py2docfx-0.1.15.dist-info}/WHEEL +0 -0
- {py2docfx-0.1.14.dev2019025.dist-info → py2docfx-0.1.15.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
"""
|
1
|
+
"""Unit tests version 2.6.1.0 for adodbapi"""
|
2
2
|
|
3
3
|
"""
|
4
4
|
adodbapi - A python DB API 2.0 interface to Microsoft ADO
|
@@ -27,25 +27,15 @@ import datetime
|
|
27
27
|
import decimal
|
28
28
|
import random
|
29
29
|
import string
|
30
|
-
import sys
|
31
30
|
import time
|
32
31
|
import unittest
|
33
32
|
|
34
33
|
import adodbapitestconfig as config # run the configuration module. # will set sys.path to find correct version of adodbapi
|
35
34
|
import tryconnection # in our code below, all our switches are from config.whatever
|
36
|
-
import win32com.client
|
37
35
|
|
38
36
|
import adodbapi
|
39
37
|
import adodbapi.apibase as api
|
40
38
|
|
41
|
-
try:
|
42
|
-
import adodbapi.ado_consts as ado_consts
|
43
|
-
except ImportError: # we are doing a shortcut import as a module -- so
|
44
|
-
try:
|
45
|
-
import ado_consts
|
46
|
-
except ImportError:
|
47
|
-
from adodbapi import ado_consts
|
48
|
-
|
49
39
|
|
50
40
|
def randomstring(length):
|
51
41
|
return "".join([random.choice(string.ascii_letters) for n in range(32)])
|
@@ -189,49 +179,6 @@ class CommonDBTests(unittest.TestCase):
|
|
189
179
|
pass
|
190
180
|
self.helpRollbackTblTemp()
|
191
181
|
|
192
|
-
def testUserDefinedConversionForExactNumericTypes(self):
|
193
|
-
# variantConversions is a dictionary of conversion functions
|
194
|
-
# held internally in adodbapi.apibase
|
195
|
-
#
|
196
|
-
# !!! this test intentionally alters the value of what should be constant in the module
|
197
|
-
# !!! no new code should use this example, to is only a test to see that the
|
198
|
-
# !!! deprecated way of doing this still works. (use connection.variantConversions)
|
199
|
-
#
|
200
|
-
if sys.version_info < (3, 0): ### Py3 need different test
|
201
|
-
oldconverter = adodbapi.variantConversions[
|
202
|
-
ado_consts.adNumeric
|
203
|
-
] # keep old function to restore later
|
204
|
-
# By default decimal and "numbers" are returned as decimals.
|
205
|
-
# Instead, make numbers return as floats
|
206
|
-
try:
|
207
|
-
adodbapi.variantConversions[ado_consts.adNumeric] = adodbapi.cvtFloat
|
208
|
-
self.helpTestDataType(
|
209
|
-
"decimal(18,2)", "NUMBER", 3.45, compareAlmostEqual=1
|
210
|
-
)
|
211
|
-
self.helpTestDataType(
|
212
|
-
"numeric(18,2)", "NUMBER", 3.45, compareAlmostEqual=1
|
213
|
-
)
|
214
|
-
# now return strings
|
215
|
-
adodbapi.variantConversions[ado_consts.adNumeric] = adodbapi.cvtString
|
216
|
-
self.helpTestDataType("numeric(18,2)", "NUMBER", "3.45")
|
217
|
-
# now a completly weird user defined convertion
|
218
|
-
adodbapi.variantConversions[ado_consts.adNumeric] = (
|
219
|
-
lambda x: "!!This function returns a funny unicode string %s!!" % x
|
220
|
-
)
|
221
|
-
self.helpTestDataType(
|
222
|
-
"numeric(18,2)",
|
223
|
-
"NUMBER",
|
224
|
-
"3.45",
|
225
|
-
allowedReturnValues=[
|
226
|
-
"!!This function returns a funny unicode string 3.45!!"
|
227
|
-
],
|
228
|
-
)
|
229
|
-
finally:
|
230
|
-
# now reset the converter to its original function
|
231
|
-
adodbapi.variantConversions[ado_consts.adNumeric] = (
|
232
|
-
oldconverter # Restore the original convertion function
|
233
|
-
)
|
234
|
-
|
235
182
|
def helpTestDataType(
|
236
183
|
self,
|
237
184
|
sqlDataTypeString,
|
@@ -326,15 +273,16 @@ class CommonDBTests(unittest.TestCase):
|
|
326
273
|
rs = crsr.fetchone()
|
327
274
|
if allowedReturnValues:
|
328
275
|
allowedTypes = tuple([type(aRV) for aRV in allowedReturnValues])
|
329
|
-
assert isinstance(
|
330
|
-
rs[0], allowedTypes
|
331
|
-
)
|
276
|
+
assert isinstance(rs[0], allowedTypes), (
|
277
|
+
'result type "%s" must be one of %s' % (type(rs[0]), allowedTypes)
|
278
|
+
)
|
332
279
|
else:
|
333
|
-
assert isinstance(
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
280
|
+
assert isinstance(rs[0], type(pyData)), (
|
281
|
+
'result type "%s" must be instance of %s'
|
282
|
+
% (
|
283
|
+
type(rs[0]),
|
284
|
+
type(pyData),
|
285
|
+
)
|
338
286
|
)
|
339
287
|
|
340
288
|
if compareAlmostEqual and DBAPIDataTypeString == "DATETIME":
|
@@ -344,9 +292,9 @@ class CommonDBTests(unittest.TestCase):
|
|
344
292
|
elif compareAlmostEqual:
|
345
293
|
s = float(pyData)
|
346
294
|
v = float(rs[0])
|
347
|
-
assert (
|
348
|
-
|
349
|
-
)
|
295
|
+
assert abs(v - s) / s < 0.00001, (
|
296
|
+
"Values not almost equal recvd=%s, expected=%f" % (rs[0], s)
|
297
|
+
)
|
350
298
|
else:
|
351
299
|
if allowedReturnValues:
|
352
300
|
ok = False
|
@@ -432,7 +380,7 @@ class CommonDBTests(unittest.TestCase):
|
|
432
380
|
"bigint",
|
433
381
|
"NUMBER",
|
434
382
|
3000000000,
|
435
|
-
allowedReturnValues=[3000000000,
|
383
|
+
allowedReturnValues=[3000000000, 3000000000],
|
436
384
|
)
|
437
385
|
self.helpTestDataType("int", "NUMBER", 2147483647)
|
438
386
|
|
@@ -488,7 +436,7 @@ class CommonDBTests(unittest.TestCase):
|
|
488
436
|
)
|
489
437
|
|
490
438
|
def testDataTypeBinary(self):
|
491
|
-
binfld = b"\x07\x00\
|
439
|
+
binfld = b"\x07\x00\xe2\x40*"
|
492
440
|
arv = [binfld, adodbapi.Binary(binfld), bytes(binfld)]
|
493
441
|
if self.getEngine() == "PostgreSQL":
|
494
442
|
self.helpTestDataType(
|
@@ -693,9 +641,9 @@ class CommonDBTests(unittest.TestCase):
|
|
693
641
|
rec = crsr.fetchone()
|
694
642
|
# check that stepping through an emulated row works
|
695
643
|
for j in range(len(inParam)):
|
696
|
-
assert (
|
697
|
-
rec[j]
|
698
|
-
)
|
644
|
+
assert rec[j] == inParam[j], (
|
645
|
+
'returned value:"%s" != test value:"%s"' % (rec[j], inParam[j])
|
646
|
+
)
|
699
647
|
# check that we can get a complete tuple from a row
|
700
648
|
assert (
|
701
649
|
tuple(rec) == inParam
|
@@ -1136,7 +1084,7 @@ class TestADOwithSQLServer(CommonDBTests):
|
|
1136
1084
|
return self.conn
|
1137
1085
|
|
1138
1086
|
def getAnotherConnection(self, addkeys=None):
|
1139
|
-
keys =
|
1087
|
+
keys = config.connStrSQLServer[1].copy()
|
1140
1088
|
if addkeys:
|
1141
1089
|
keys.update(addkeys)
|
1142
1090
|
return config.dbSqlServerconnect(*config.connStrSQLServer[0], **keys)
|
@@ -1316,7 +1264,7 @@ class TestADOwithMySql(CommonDBTests):
|
|
1316
1264
|
return self.conn
|
1317
1265
|
|
1318
1266
|
def getAnotherConnection(self, addkeys=None):
|
1319
|
-
keys =
|
1267
|
+
keys = config.connStrMySql[1].copy()
|
1320
1268
|
if addkeys:
|
1321
1269
|
keys.update(addkeys)
|
1322
1270
|
return config.dbMySqlconnect(*config.connStrMySql[0], **keys)
|
@@ -1382,7 +1330,7 @@ class TestADOwithPostgres(CommonDBTests):
|
|
1382
1330
|
return self.conn
|
1383
1331
|
|
1384
1332
|
def getAnotherConnection(self, addkeys=None):
|
1385
|
-
keys =
|
1333
|
+
keys = config.connStrPostgres[1].copy()
|
1386
1334
|
if addkeys:
|
1387
1335
|
keys.update(addkeys)
|
1388
1336
|
return config.dbPostgresConnect(*config.connStrPostgres[0], **keys)
|
@@ -166,7 +166,7 @@ if doPostgresTest:
|
|
166
166
|
"Provider=MSDASQL;Driver={PostgreSQL Unicode(x64)}",
|
167
167
|
"Driver=PostgreSQL Unicode",
|
168
168
|
]
|
169
|
-
# get driver from
|
169
|
+
# get driver from https://www.postgresql.org/ftp/odbc/releases/
|
170
170
|
# test using positional and keyword arguments (bad example for real code)
|
171
171
|
print(" ...Testing PostgreSQL login to {}...".format(_computername))
|
172
172
|
doPostgresTest, connStrPostgres, dbPostgresConnect = tryconnection.try_connection(
|
@@ -1,20 +1,19 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
|
-
"""
|
2
|
+
"""Python DB API 2.0 driver compliance unit test suite.
|
3
3
|
|
4
|
-
|
4
|
+
This software is Public Domain and may be used without restrictions.
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
"Now we have booze and barflies entering the discussion, plus rumours of
|
7
|
+
DBAs on drugs... and I won't tell you what flashes through my mind each
|
8
|
+
time I read the subject line with 'Anal Compliance' in it. All around
|
9
|
+
this is turning out to be a thoroughly unwholesome unit test."
|
10
10
|
|
11
|
-
|
11
|
+
-- Ian Bicking
|
12
12
|
"""
|
13
13
|
|
14
14
|
__version__ = "$Revision: 1.15.0 $"[11:-2]
|
15
15
|
__author__ = "Stuart Bishop <stuart@stuartbishop.net>"
|
16
16
|
|
17
|
-
import sys
|
18
17
|
import time
|
19
18
|
import unittest
|
20
19
|
|
@@ -71,7 +70,7 @@ TEST_FOR_NON_IDEMPOTENT_CLOSE = False
|
|
71
70
|
# - Now a subclass of TestCase, to avoid requiring the driver stub
|
72
71
|
# to use multiple inheritance
|
73
72
|
# - Reversed the polarity of buggy test in test_description
|
74
|
-
# - Test exception
|
73
|
+
# - Test exception hierarchy correctly
|
75
74
|
# - self.populate is now self._populate(), so if a driver stub
|
76
75
|
# overrides self.ddl1 this change propogates
|
77
76
|
# - VARCHAR columns now have a width, which will hopefully make the
|
@@ -197,14 +196,9 @@ class DatabaseAPI20Test(unittest.TestCase):
|
|
197
196
|
self.fail("Driver doesn't define paramstyle")
|
198
197
|
|
199
198
|
def test_Exceptions(self):
|
200
|
-
# Make sure required exceptions exist, and are in the
|
201
|
-
|
202
|
-
|
203
|
-
self.assertTrue(issubclass(self.driver.Warning, Exception))
|
204
|
-
self.assertTrue(issubclass(self.driver.Error, Exception))
|
205
|
-
else:
|
206
|
-
self.failUnless(issubclass(self.driver.Warning, Exception))
|
207
|
-
self.failUnless(issubclass(self.driver.Error, Exception))
|
199
|
+
# Make sure required exceptions exist, and are in the defined hierarchy.
|
200
|
+
self.assertTrue(issubclass(self.driver.Warning, Exception))
|
201
|
+
self.assertTrue(issubclass(self.driver.Error, Exception))
|
208
202
|
|
209
203
|
self.assertTrue(issubclass(self.driver.InterfaceError, self.driver.Error))
|
210
204
|
self.assertTrue(issubclass(self.driver.DatabaseError, self.driver.Error))
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/python2
|
2
2
|
# Configure this in order to run the testcases.
|
3
3
|
"setuptestframework.py v 2.6.0.8"
|
4
|
+
|
4
5
|
import os
|
5
6
|
import shutil
|
6
7
|
import tempfile
|
@@ -55,7 +56,7 @@ def makeadopackage(testfolder):
|
|
55
56
|
shutil.copy(os.path.join(adoPath, f), newpackage)
|
56
57
|
return testfolder
|
57
58
|
else:
|
58
|
-
raise OSError("
|
59
|
+
raise OSError("Cannot find source of adodbapi to test.")
|
59
60
|
|
60
61
|
|
61
62
|
def makemdb(testfolder, mdb_name):
|
@@ -104,7 +104,7 @@ class AzureApplicationCredential(ChainedTokenCredential):
|
|
104
104
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
105
105
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
106
106
|
|
107
|
-
:rtype: AccessTokenInfo
|
107
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
108
108
|
:return: An AccessTokenInfo instance containing information about the token.
|
109
109
|
:raises ~azure.core.exceptions.ClientAuthenticationError: authentication failed. The exception has a
|
110
110
|
`message` attribute listing each authentication attempt and its error message.
|
@@ -105,7 +105,7 @@ class AuthorizationCodeCredential(GetTokenMixin):
|
|
105
105
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
106
106
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
107
107
|
|
108
|
-
:rtype: AccessTokenInfo
|
108
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
109
109
|
:return: An AccessTokenInfo instance containing information about the token.
|
110
110
|
:raises ~azure.core.exceptions.ClientAuthenticationError: authentication failed. The error's ``message``
|
111
111
|
attribute gives a reason. Any error response from Microsoft Entra ID is available as the error's
|
@@ -142,7 +142,7 @@ class AzureDeveloperCliCredential:
|
|
142
142
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
143
143
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
144
144
|
|
145
|
-
:rtype: AccessTokenInfo
|
145
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
146
146
|
:return: An AccessTokenInfo instance containing information about the token.
|
147
147
|
|
148
148
|
:raises ~azure.identity.CredentialUnavailableError: the credential was unable to invoke
|
@@ -133,7 +133,7 @@ class AzureCliCredential:
|
|
133
133
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
134
134
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
135
135
|
|
136
|
-
:rtype: AccessTokenInfo
|
136
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
137
137
|
:return: An AccessTokenInfo instance containing information about the token.
|
138
138
|
|
139
139
|
:raises ~azure.identity.CredentialUnavailableError: the credential was unable to invoke the Azure CLI.
|
@@ -141,7 +141,7 @@ class AzurePipelinesCredential:
|
|
141
141
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
142
142
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
143
143
|
|
144
|
-
:rtype: AccessTokenInfo
|
144
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
145
145
|
:return: An AccessTokenInfo instance containing information about the token.
|
146
146
|
:raises ~azure.core.exceptions.ClientAuthenticationError: authentication failed. The error's ``message``
|
147
147
|
attribute gives a reason.
|
@@ -146,7 +146,7 @@ class AzurePowerShellCredential:
|
|
146
146
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
147
147
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
148
148
|
|
149
|
-
:rtype: AccessTokenInfo
|
149
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
150
150
|
:return: An AccessTokenInfo instance containing information about the token.
|
151
151
|
|
152
152
|
:raises ~azure.identity.CredentialUnavailableError: the credential was unable to invoke Azure PowerShell, or
|
@@ -166,7 +166,7 @@ class ChainedTokenCredential:
|
|
166
166
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
167
167
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
168
168
|
|
169
|
-
:rtype: AccessTokenInfo
|
169
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
170
170
|
:return: An AccessTokenInfo instance containing information about the token.
|
171
171
|
|
172
172
|
:raises ~azure.core.exceptions.ClientAuthenticationError: no credential in the chain provided a token.
|
@@ -239,7 +239,7 @@ class DefaultAzureCredential(ChainedTokenCredential):
|
|
239
239
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
240
240
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
241
241
|
|
242
|
-
:rtype: AccessTokenInfo
|
242
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
243
243
|
:return: An AccessTokenInfo instance containing information about the token.
|
244
244
|
|
245
245
|
:raises ~azure.core.exceptions.ClientAuthenticationError: authentication failed. The exception has a
|
@@ -46,6 +46,9 @@ class EnvironmentCredential:
|
|
46
46
|
when no value is given.
|
47
47
|
|
48
48
|
User with username and password:
|
49
|
+
**Deprecated**: Username and password authentication doesn't support multifactor authentication (MFA).
|
50
|
+
For more details on Microsoft Entra MFA enforcement, see https://aka.ms/azsdk/identity/mfa.
|
51
|
+
|
49
52
|
- **AZURE_CLIENT_ID**: the application's client ID
|
50
53
|
- **AZURE_USERNAME**: a username (usually an email address)
|
51
54
|
- **AZURE_PASSWORD**: that user's password
|
@@ -168,7 +171,7 @@ class EnvironmentCredential:
|
|
168
171
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
169
172
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
170
173
|
|
171
|
-
:rtype: AccessTokenInfo
|
174
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
172
175
|
:return: An AccessTokenInfo instance containing information about the token.
|
173
176
|
|
174
177
|
:raises ~azure.identity.CredentialUnavailableError: environment variable configuration is incomplete.
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# ------------------------------------
|
5
5
|
import logging
|
6
6
|
import os
|
7
|
-
from typing import Optional, Any, Mapping, cast
|
7
|
+
from typing import Optional, Any, Mapping, cast, Tuple
|
8
8
|
|
9
9
|
from azure.core.credentials import AccessToken, AccessTokenInfo, TokenRequestOptions, TokenCredential, SupportsTokenInfo
|
10
10
|
from .. import CredentialUnavailableError
|
@@ -15,20 +15,34 @@ from .._internal.decorators import log_get_token
|
|
15
15
|
_LOGGER = logging.getLogger(__name__)
|
16
16
|
|
17
17
|
|
18
|
-
def validate_identity_config(
|
18
|
+
def validate_identity_config(
|
19
|
+
client_id: Optional[str], identity_config: Optional[Mapping[str, str]]
|
20
|
+
) -> Optional[Tuple[str, str]]:
|
19
21
|
if identity_config:
|
22
|
+
valid_keys = {"object_id", "resource_id", "client_id"}
|
20
23
|
if client_id:
|
21
|
-
if any(key in identity_config for key in
|
24
|
+
if any(key in identity_config for key in valid_keys):
|
22
25
|
raise ValueError(
|
23
|
-
"
|
24
|
-
"
|
26
|
+
"When 'client_id' is provided as a keyword argument, 'identity_config' must not contain any of the "
|
27
|
+
f"following keys: {', '.join(valid_keys)}"
|
25
28
|
)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
return "client_id", client_id
|
30
|
+
|
31
|
+
# Only one of the valid keys should be present if one is present.
|
32
|
+
result = None
|
33
|
+
for key in valid_keys:
|
34
|
+
if key in identity_config:
|
35
|
+
if result:
|
36
|
+
raise ValueError(
|
37
|
+
"identity_config must not contain more than one of the following keys: "
|
38
|
+
f"{', '.join(valid_keys)}"
|
39
|
+
)
|
40
|
+
result = key, identity_config[key]
|
41
|
+
return result
|
42
|
+
|
43
|
+
if client_id:
|
44
|
+
return "client_id", client_id
|
45
|
+
return None
|
32
46
|
|
33
47
|
|
34
48
|
class ManagedIdentityCredential:
|
@@ -59,38 +73,40 @@ class ManagedIdentityCredential:
|
|
59
73
|
def __init__(
|
60
74
|
self, *, client_id: Optional[str] = None, identity_config: Optional[Mapping[str, str]] = None, **kwargs: Any
|
61
75
|
) -> None:
|
62
|
-
validate_identity_config(client_id, identity_config)
|
76
|
+
user_identity_info = validate_identity_config(client_id, identity_config)
|
63
77
|
self._credential: Optional[SupportsTokenInfo] = None
|
64
78
|
exclude_workload_identity = kwargs.pop("_exclude_workload_identity_credential", False)
|
79
|
+
managed_identity_type = None
|
80
|
+
|
65
81
|
if os.environ.get(EnvironmentVariables.IDENTITY_ENDPOINT):
|
66
82
|
if os.environ.get(EnvironmentVariables.IDENTITY_HEADER):
|
67
83
|
if os.environ.get(EnvironmentVariables.IDENTITY_SERVER_THUMBPRINT):
|
68
|
-
|
84
|
+
managed_identity_type = "Service Fabric managed identity"
|
69
85
|
from .service_fabric import ServiceFabricCredential
|
70
86
|
|
71
87
|
self._credential = ServiceFabricCredential(
|
72
88
|
client_id=client_id, identity_config=identity_config, **kwargs
|
73
89
|
)
|
74
90
|
else:
|
75
|
-
|
91
|
+
managed_identity_type = "App Service managed identity"
|
76
92
|
from .app_service import AppServiceCredential
|
77
93
|
|
78
94
|
self._credential = AppServiceCredential(
|
79
95
|
client_id=client_id, identity_config=identity_config, **kwargs
|
80
96
|
)
|
81
97
|
elif os.environ.get(EnvironmentVariables.IMDS_ENDPOINT):
|
82
|
-
|
98
|
+
managed_identity_type = "Azure Arc managed identity"
|
83
99
|
from .azure_arc import AzureArcCredential
|
84
100
|
|
85
101
|
self._credential = AzureArcCredential(client_id=client_id, identity_config=identity_config, **kwargs)
|
86
102
|
elif os.environ.get(EnvironmentVariables.MSI_ENDPOINT):
|
87
103
|
if os.environ.get(EnvironmentVariables.MSI_SECRET):
|
88
|
-
|
104
|
+
managed_identity_type = "Azure ML managed identity"
|
89
105
|
from .azure_ml import AzureMLCredential
|
90
106
|
|
91
107
|
self._credential = AzureMLCredential(client_id=client_id, identity_config=identity_config, **kwargs)
|
92
108
|
else:
|
93
|
-
|
109
|
+
managed_identity_type = "Cloud Shell managed identity"
|
94
110
|
from .cloud_shell import CloudShellCredential
|
95
111
|
|
96
112
|
self._credential = CloudShellCredential(client_id=client_id, identity_config=identity_config, **kwargs)
|
@@ -98,12 +114,17 @@ class ManagedIdentityCredential:
|
|
98
114
|
all(os.environ.get(var) for var in EnvironmentVariables.WORKLOAD_IDENTITY_VARS)
|
99
115
|
and not exclude_workload_identity
|
100
116
|
):
|
101
|
-
_LOGGER.info("%s will use workload identity", self.__class__.__name__)
|
102
117
|
from .workload_identity import WorkloadIdentityCredential
|
103
118
|
|
104
119
|
workload_client_id = client_id or os.environ.get(EnvironmentVariables.AZURE_CLIENT_ID)
|
105
120
|
if not workload_client_id:
|
106
|
-
raise ValueError(
|
121
|
+
raise ValueError(
|
122
|
+
"Workload identity was selected but no client ID was provided. "
|
123
|
+
'Configure the environment with a client ID or pass a value for "client_id" argument'
|
124
|
+
)
|
125
|
+
|
126
|
+
managed_identity_type = "workload identity"
|
127
|
+
user_identity_info = ("client_id", workload_client_id)
|
107
128
|
|
108
129
|
self._credential = WorkloadIdentityCredential(
|
109
130
|
tenant_id=os.environ[EnvironmentVariables.AZURE_TENANT_ID],
|
@@ -112,11 +133,17 @@ class ManagedIdentityCredential:
|
|
112
133
|
**kwargs,
|
113
134
|
)
|
114
135
|
else:
|
136
|
+
managed_identity_type = "IMDS"
|
115
137
|
from .imds import ImdsCredential
|
116
138
|
|
117
|
-
_LOGGER.info("%s will use IMDS", self.__class__.__name__)
|
118
139
|
self._credential = ImdsCredential(client_id=client_id, identity_config=identity_config, **kwargs)
|
119
140
|
|
141
|
+
if managed_identity_type:
|
142
|
+
log_msg = f"{self.__class__.__name__} will use {managed_identity_type}"
|
143
|
+
if user_identity_info:
|
144
|
+
log_msg += f" with {user_identity_info[0]}: {user_identity_info[1]}"
|
145
|
+
_LOGGER.info(log_msg)
|
146
|
+
|
120
147
|
def __enter__(self) -> "ManagedIdentityCredential":
|
121
148
|
if self._credential:
|
122
149
|
self._credential.__enter__() # type: ignore
|
@@ -171,7 +198,7 @@ class ManagedIdentityCredential:
|
|
171
198
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
172
199
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
173
200
|
|
174
|
-
:rtype: AccessTokenInfo
|
201
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
175
202
|
:return: An AccessTokenInfo instance containing information about the token.
|
176
203
|
:raises ~azure.identity.CredentialUnavailableError: managed identity isn't available in the hosting environment.
|
177
204
|
"""
|
@@ -100,7 +100,7 @@ class SharedTokenCacheCredential:
|
|
100
100
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
101
101
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
102
102
|
|
103
|
-
:rtype: AccessTokenInfo
|
103
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
104
104
|
:return: An AccessTokenInfo instance containing information about the token.
|
105
105
|
:raises ~azure.identity.CredentialUnavailableError: the cache is unavailable or contains insufficient user
|
106
106
|
information.
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# Licensed under the MIT License.
|
4
4
|
# ------------------------------------
|
5
5
|
from typing import Any, Dict
|
6
|
+
import warnings
|
6
7
|
|
7
8
|
from .._internal import InteractiveCredential, wrap_exceptions
|
8
9
|
|
@@ -10,6 +11,9 @@ from .._internal import InteractiveCredential, wrap_exceptions
|
|
10
11
|
class UsernamePasswordCredential(InteractiveCredential):
|
11
12
|
"""Authenticates a user with a username and password.
|
12
13
|
|
14
|
+
**Deprecated**: This credential doesn't support multifactor authentication (MFA).
|
15
|
+
For more details on Microsoft Entra MFA enforcement, see https://aka.ms/azsdk/identity/mfa.
|
16
|
+
|
13
17
|
In general, Microsoft doesn't recommend this kind of authentication, because it's less secure than other
|
14
18
|
authentication flows.
|
15
19
|
|
@@ -59,6 +63,12 @@ class UsernamePasswordCredential(InteractiveCredential):
|
|
59
63
|
"""
|
60
64
|
|
61
65
|
def __init__(self, client_id: str, username: str, password: str, **kwargs: Any) -> None:
|
66
|
+
warnings.warn(
|
67
|
+
f"{self.__class__.__name__} is deprecated, as is it doesn't support multifactor "
|
68
|
+
"authentication (MFA). For more details, see https://aka.ms/azsdk/identity/mfa.",
|
69
|
+
category=DeprecationWarning,
|
70
|
+
stacklevel=2,
|
71
|
+
)
|
62
72
|
# The base class will accept an AuthenticationRecord, allowing this credential to authenticate silently the
|
63
73
|
# first time it's asked for a token. However, we want to ensure this first authentication is not silent, to
|
64
74
|
# validate the given password. This class therefore doesn't document the authentication_record argument, and we
|
@@ -183,7 +183,7 @@ class VisualStudioCodeCredential(_VSCodeCredentialBase, GetTokenMixin):
|
|
183
183
|
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
|
184
184
|
:paramtype options: ~azure.core.credentials.TokenRequestOptions
|
185
185
|
|
186
|
-
:rtype: AccessTokenInfo
|
186
|
+
:rtype: ~azure.core.credentials.AccessTokenInfo
|
187
187
|
:return: An AccessTokenInfo instance containing information about the token.
|
188
188
|
:raises ~azure.identity.CredentialUnavailableError: the credential cannot retrieve user details from Visual
|
189
189
|
Studio Code.
|
@@ -61,6 +61,7 @@ class AadClientBase(abc.ABC):
|
|
61
61
|
self._custom_cache = True
|
62
62
|
else:
|
63
63
|
self._custom_cache = False
|
64
|
+
self._is_adfs = self._tenant_id.lower() == "adfs"
|
64
65
|
|
65
66
|
def _get_cache(self, **kwargs: Any) -> TokenCache:
|
66
67
|
cache = self._cae_cache if kwargs.get("enable_cae") else self._cache
|
@@ -239,7 +240,16 @@ class AadClientBase(abc.ABC):
|
|
239
240
|
|
240
241
|
def _get_client_certificate_assertion(self, certificate: AadClientCertificate, **kwargs: Any) -> str:
|
241
242
|
now = int(time.time())
|
242
|
-
|
243
|
+
headers = {"typ": "JWT"}
|
244
|
+
if self._is_adfs:
|
245
|
+
# Maintain backwards compatibility with older versions of ADFS.
|
246
|
+
headers["alg"] = "RS256"
|
247
|
+
headers["x5t"] = certificate.thumbprint
|
248
|
+
else:
|
249
|
+
headers["alg"] = "PS256"
|
250
|
+
headers["x5t#S256"] = certificate.sha256_thumbprint
|
251
|
+
|
252
|
+
jwt_header = json.dumps(headers).encode("utf-8")
|
243
253
|
payload = json.dumps(
|
244
254
|
{
|
245
255
|
"jti": str(uuid4()),
|
@@ -250,8 +260,8 @@ class AadClientBase(abc.ABC):
|
|
250
260
|
"exp": now + (60 * 30),
|
251
261
|
}
|
252
262
|
).encode("utf-8")
|
253
|
-
jws = base64.urlsafe_b64encode(
|
254
|
-
signature = certificate.
|
263
|
+
jws = base64.urlsafe_b64encode(jwt_header) + b"." + base64.urlsafe_b64encode(payload)
|
264
|
+
signature = certificate.sign_ps256(jws) if not self._is_adfs else certificate.sign_rs256(jws)
|
255
265
|
jwt_bytes = jws + b"." + base64.urlsafe_b64encode(signature)
|
256
266
|
return jwt_bytes.decode("utf-8")
|
257
267
|
|
@@ -26,7 +26,9 @@ class AadClientCertificate:
|
|
26
26
|
|
27
27
|
cert = x509.load_pem_x509_certificate(pem_bytes, default_backend())
|
28
28
|
fingerprint = cert.fingerprint(hashes.SHA1()) # nosec
|
29
|
+
sha256_fingerprint = cert.fingerprint(hashes.SHA256())
|
29
30
|
self._thumbprint = base64.urlsafe_b64encode(fingerprint).decode("utf-8")
|
31
|
+
self._sha256_thumbprint = base64.urlsafe_b64encode(sha256_fingerprint).decode("utf-8")
|
30
32
|
|
31
33
|
@property
|
32
34
|
def thumbprint(self) -> str:
|
@@ -36,7 +38,15 @@ class AadClientCertificate:
|
|
36
38
|
"""
|
37
39
|
return self._thumbprint
|
38
40
|
|
39
|
-
|
41
|
+
@property
|
42
|
+
def sha256_thumbprint(self) -> str:
|
43
|
+
"""The certificate's SHA256 thumbprint as a base64url-encoded string.
|
44
|
+
|
45
|
+
:rtype: str
|
46
|
+
"""
|
47
|
+
return self._sha256_thumbprint
|
48
|
+
|
49
|
+
def sign_rs256(self, plaintext: bytes) -> bytes:
|
40
50
|
"""Sign bytes using RS256.
|
41
51
|
|
42
52
|
:param bytes plaintext: Bytes to sign.
|
@@ -44,3 +54,20 @@ class AadClientCertificate:
|
|
44
54
|
:rtype: bytes
|
45
55
|
"""
|
46
56
|
return self._private_key.sign(plaintext, padding.PKCS1v15(), hashes.SHA256())
|
57
|
+
|
58
|
+
def sign_ps256(self, plaintext: bytes) -> bytes:
|
59
|
+
"""Sign bytes using PS256.
|
60
|
+
|
61
|
+
:param bytes plaintext: Bytes to sign.
|
62
|
+
:return: The signature.
|
63
|
+
:rtype: bytes
|
64
|
+
"""
|
65
|
+
hash_alg = hashes.SHA256()
|
66
|
+
|
67
|
+
# Note: For PS265, the salt length should match the hash output size, so we use the hash algorithm's
|
68
|
+
# digest_size property to get the correct value.
|
69
|
+
return self._private_key.sign(
|
70
|
+
plaintext,
|
71
|
+
padding.PSS(mgf=padding.MGF1(hash_alg), salt_length=hash_alg.digest_size),
|
72
|
+
hash_alg,
|
73
|
+
)
|