summaryrefslogtreecommitdiff
path: root/lib/ansible/module_utils/urls.py
Commit message (Collapse)AuthorAgeFilesLines
* uri: added use_netrc argument to allow ignoring netrc (#74397) (#78569)Artur2022-09-121-7/+11
|
* Allow selection of TLS/SSL ciphers (#78650)Matt Martz2022-09-081-179/+196
| | | | * Allow selection of TLS/SSL ciphers. Fixes #78633 * Never pass None as the password. Fixes #53373
* fetch_file - properly split files with multi-part file extensions (#75257)Sam Doran2022-09-061-2/+43
|
* Guard urllib3 imports against all exceptions. Fixes #78648 (#78667)Matt Martz2022-08-301-4/+4
|
* ansible-test - Update sanity test requirements. (#78528)Matt Clay2022-08-111-2/+2
|
* Correctly get the filename from a url in fetch_file. Fixes #29680 (#78383)Matt Martz2022-08-021-1/+2
|
* Add support for gzip decoding responses (#41925)Matt Martz2022-07-131-10/+95
|
* honor use_proxy parameter (#77312)h4rr212022-04-061-2/+5
| | | | | | | * honor use_proxy parameter * fix uri test with "use_proxy: no" * fix urls.py module Co-authored-by: Carlos <Juan.Carlos.Cardenas.Viera@ibm.com>
* More type hint fixes for module_utils. (#77198)Matt Clay2022-03-031-2/+3
| | | | * Type hint fixes for module_utils. * Fix type hints in module_utils.facts.
* Additional type hinting cleanup. (#77188)Matt Clay2022-03-021-10/+9
|
* module_utils - Fix type hinting issues.Matt Clay2022-03-021-4/+5
|
* Misc typo fixes in module_utils (#76564)Abhijeet Kasurde2022-01-311-1/+1
|
* Added AIX CA certs search paths (#69776)Amir.M2022-01-131-0/+3
|
* Handle HTTPError being partially initialized due to the error. Fixes #76386 ↵Matt Martz2021-12-021-0/+5
| | | | (#76421)
* uri module improvements (#50771)Matt Martz2021-11-161-2/+29
|
* Allow ca_path to point to a bundle (#75894)Matt Martz2021-10-081-8/+20
| | | * Allow ca_path to point to a bundle. Fixes #75015
* url_argument_spec: remove deprecated thirsty alias (#75838)Martin Krizek2021-09-301-2/+1
| | | | Fixes #75825 Fixes #75826
* Expose `unredirected_headers` to `uri` and `get_url` modules (#75308)Matt Martz2021-07-281-6/+11
|
* uri - add ca_path parameter (#71979)Florian Heiderich2021-02-051-3/+1
| | | | | | | | | * add changelog fragment for #71979 (ca_path for uri) * add integration tests for ca_path in the uri module * return path of ca cert instead of its content * connect to port 444 on self_signed_host and use quay.io/ansible/http-test-container:1.3.0 * state that the certificate in ca_path is used for validation
* Add support for GSSAPI/Kerberos to urls.py (#72113)Jordan Borean2020-10-131-7/+153
| | | | | | | | | | | | | | | | | * Add support for GSSAPI/Kerberos to urls.py * Test out changes with the latest test container * Get remote hosts working * Fix up httptester_krb5_password reader * Fix tests for opensuse and macOS * Hopefully last lot of testing changes * Dont do CBT on macOS * Fixes from review
* Close file descriptor of temporary file after building certificate chain ↵Bernhard Dick2020-09-301-0/+2
| | | | | | | (#71825) * Close file descriptor of temporary file after building certificate chain. * Add changelog fragment for PR71825
* Fix boilerplate in setup.py and lib/ansible/ dir.Matt Clay2020-06-221-0/+3
|
* Fix up schema for collection deprecation (#69977)Jordan Borean2020-06-101-1/+1
| | | | | | | * Fix up schema for collection deprecation * Fix up modules using wrong name * Another fix
* Deprecation revisited (#69926)Felix Fontein2020-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow to specify collection_name separately for deprecation. * Use new functionality in Ansible. * Use new functionality in tests. * Update tagging/untagging functions. * Update pylint deprecated sanity test. * Update validate-modules. Missing are basic checks for version_added (validate semantic version format for collections). * Improve version validation. Re-add version_added validation. * Make sure collection names are added to return docs before schema validation. * Extra checks to avoid crashes on bad data. * Make C# module utils code work, and update/extend tests. * Add changelog fragment. * Stop extracting collection name from potentially tagged versions/dates. * Simplify C# code. * Update Windows modules docs. * Forgot semicolons.
* Version source tagging (automatic and manual) for version_added and ↵Felix Fontein2020-05-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deprecation versions (#69680) * Track collection for version_added. Validate *all* version numbers in validate-modules. For tagged version numbers (i.e. version_added), consider source collection to chose validation. * Make tagging/untagging functions more flexible. * Tag all versions in doc fragments. * Tag all deprecation versions issued by code. * Make Display.deprecated() understand tagged versions. * Extend validation to enforce tagged version numbers. * Tag versions in tests. * Lint and fix test. * Mention collection name in collection loader's deprecation/removal messages. * Fix error IDs. * Handle tagged dates in Display.deprecated(). * Also require that removed_at_date and deprecated_aliases.date are tagged. * Also automatically tag/untag removed_at_date; fix sanity module removal version check. * Improve error message when invalid version number is used (like '2.14' in collections).
* Add multipart/form-data functionality (#69376)Matt Martz2020-05-201-2/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add multipart/form-data functionality * Fix some linting issues * Fix error message * Allow filename to be provided with content * Add integration test * Update examples * General improvements to multipart handling * Use prepare_multipart for galaxy collection publish * Properly account for py2 vs py3, ensuring no max header length * Address test assumptions * Add unit tests * Add changelog * Ensure to use CRLF instead of NL * Ignore line-endings in fixture * Consolidate code, add comment * Bump fallaxy container version * ci_complete
* get_url pass incorrect If-Modified-Since header(#67417) (#67419)Zhanwei Wang2020-04-101-1/+1
| | | Fix #67417. HTTP header value of `If-Modified-Since` set by `get_url` does not follow HTTP protocol.
* Correct fetch_url error code documentation (#66061)Kevin Breit2020-01-031-1/+1
| | | HttpError is passed for 400 and above, not only greater than 400. Change docs to `>=` instead of `>`.
* Remove uneeded Python version compatibility checks. (#64076)Mads Jensen2019-11-201-8/+1
|
* issue #61672: make jenkins_plugin module work in a session when CSRF … ↵JKDingwall2019-09-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | (#61673) * issue #61672: make jenkins_plugin module work in a session when CSRF enabled This commit modifies the signature of `fetch_url` so that a cookie jar can be specified allowing multiple calls to operate with the same session. It uses a similar construct to the `Request` class to initialise the cookie jar if it is not provided. The jenkins_plugin module is modified to create a cookie jar if CSRF is enabled. This cookie jar is then submitted with every call to fetch_url. Also changed is to submit the crumb in the request headers rather than in the data field. This has been tested with Jenkins 2.176. * issue #61672: fix jenkins_script module This commit modifies the jenkins_script module to use the authorization crumb in a session in a similar fashion to the jenkins_plugin change for the same issue.
* Deprecate alias 'thirsty' from all usages (#61245)Jill R2019-08-281-1/+1
| | | | | | | | | | | | * Deprecate alias 'thirsty' from all usages Fixes: #61236 * Now with added version quoting * Handle deprecated aliases in mod_utils * Make alias deprecation a subkey of the canonical arg, and not a separate argument
* ansible-galaxy - define multiple galaxy instances in ansible.cfg (#60553)Jordan Borean2019-08-211-5/+12
| | | | | | | | | | | | | | | | * ansible-galaxy: support multiple servers on install * Added docs for the server configuration file * Fix up doc string for requirements file format * Fix bugs after testing * Fix kwarg doc and added version * Fix typo and doc improvement * Fix base64 encoding and allow --server to override list
* ansible-galaxy - ignore cert failures for login (#59959)Jordan Borean2019-08-071-1/+1
|
* Move definition of UnixHTTPSConnection behind guard (#60049)Andrew Gaffney2019-08-051-24/+27
| | | | This allows module_utils/urls.py to not immediately fall over when run against a python without SSL support.
* cert validation fixes - Attempt 2 (#55953)Matt Martz2019-05-311-84/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Attempt 2 of cert validation fixes * Remove unused code * Cleanup the tmp cert using atexit * Fix linting issues * Only add SSLValidationHandler when not HAS_SSLCONTEXT * Catch value errors on non PEM certs * Only catch NotImplementedError to avoid masking issues * set self._context even with PyOpenSSLContext for conformity * Fix error building * normalize how we interact with the context we create * Remove unused code * Address test for py3.7 message difference * open_url should pass the ca_path through * Account for new error in url lookup test * Guard some code behind whether or not we are validating certs * Make _make_context public * Move atexit.register up to where the tmp file is created
* Ensure uri module always returns status even on failure (#56240)Sam Doran2019-05-231-4/+4
| | | | | | | | - Also return url and update docs for other values to indicate they are only returned on success. - Add integration tests - Use info variable for common return values - Use -1 as default status rather than None. This is lines up with with existing code in urls.py - Add unit tests to ensure status and url are returned on failure
* Don't rely on netloc for determining hostname and port, just use hostname ↵Matt Martz2019-05-201-13/+19
| | | | | | | | and port (#56270) * Add changelog fragment * Fix IPv6 address parsing for py2.6, and add tests * make sure hostname isn't None
* Update bundled copy of backports.ssl_match_hostname from 3.4.0.2 to 3.7.0.1 ↵Matt Martz2019-04-231-45/+126
| | | | | | | | | | (#55461) * Update bundled copy of backports.ssl_match_hostname from 3.4.0.2 to 3.7.0.1. Fixes #51794 * Address linting issues * ci_complete
* uri/win_uri: Make method a free text field (#49719)Dag Wieers2019-02-281-2/+0
| | | | | | | | | | | | | * uri/win_uri: Make method a free text field Since various interfaces introduce their own HTTP method (e.g. like PROPFIND, LIST or TRACE) it's better to leave this up to the user. * Fix HTTP method check in module_utils urls * Add integration test for method UNKNOWN * Clarify the change as requested during review
* Do not send "Connection: close" when requesting a tunnel. Fixes #32750 (#46070)Matt Martz2019-02-181-1/+1
|
* Support unix socket with urls/uri (#43560)Matt Martz2019-02-181-11/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * First pass at allowing unix socket with urls/uri. See #42341 * Only insert handler as needed * Fix and add tests * Add HTTPS functionality for unix sockets * Additional test fixes * Create context manager for monkey patching HTTPConnection.connect, de-dupe code, raise better errors * doc * Add a few more tests * Fix __call__ * Remove unused import * Patch HTTPConnection.connect with the functionality we want, instead of duplicating code and disabling * Fix var name * Remove unused var * Add changelog fragment * Update uri docs * Fix rebase indentation issue
* identity: Add GSSAPI suport for FreeIPA authentication (#52031)Juan Antonio Osorio2019-02-131-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | * identity: Add GSSAPI suport for FreeIPA authentication This enables the usage of GSSAPI for authentication, instead of having to pass the username and password as part of the playbook run. If there is GSSAPI support, this makes the password optional, and will be able to use the KRB5_CLIENT_KTNAME or the KRB5CCNAME environment variables; which are standard when using kerberos authentication. Note that this depends on the urllib_gssapi library, and will only enable this if that library is available. * identity: Add documentation for GSSAPI authentication for FreeIPA This documentation describes how to use GSSAPI authentication with the IPA identity modules. * identity: Add changelog for GSSAPI support for IPA This adds the changelog entry for the GSSAPI authentication feature for the IPA identity module.
* Have update-bundled check for updates to all bundled codeToshio Kuratomi2019-02-061-0/+4
| | | | Add a test for whether we have bundled code inside of ansible that needs to be updated
* Guard creating HTTPSClientAuthHandler behind HTTPS checks (#50523)Matt Martz2019-01-101-23/+24
| | | | | | * Guard creating HTTPSClientAuthHandler behind HTTPS checks. Fixes #50339 * linting fixup
* Sanity fixes in various modules (#50080)Dag Wieers2018-12-181-10/+10
|
* Update bare exceptions to specify Exception.Toshio Kuratomi2018-12-161-7/+7
| | | | | This will keep us from accidentally catching program-exiting exceptions like KeyboardInterupt and SystemExit.
* introduce `module_utils.urls.fetch_file` as a wrapper to download and save ↵Evgeni Golov2018-10-081-0/+37
| | | | | | | | | | | | | | | | | | | | files (#19172) * module_utils.urls: add fetch_file function * apt: use fetch_file instead of own download() * unarchive: use fetch_file instead of own codecopy * apt: add test for deb=http://… * unarchive: add test for a remote file download and unarchive * yum: replace fetch_rpm_from_url by fetch_file * use NamedTemporaryFile * don't add a dot to fileext, it's already there
* Fixing HTTPError case of fetch_url for Python 3 compatibility. (#45628)Felix Fontein2018-09-191-1/+2
| | | | | | | | | | * Fixing HTTPError case of fetch_url for Python 3 compatibility. * Adding unit test. * PEP8. * Changelog.
* Introduce and use locale-naive rfc2822 date format function (#44868)Matt Martz2018-08-301-1/+18
| | | | | | * Introduce and use locale-naive rfc2822 date format function. Fixes #44857 * Adjust test expected response
* Surround top-level function and class definitions with two blank lines.Joren Vrancken2018-07-311-0/+1
|