summaryrefslogtreecommitdiff
path: root/keystoneclient/httpclient.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "use importlib.metadata to get keyring version"Zuul2022-04-291-5/+13
|\
| * use importlib.metadata to get keyring versionDoug Hellmann2022-04-221-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importing pkg_resources has a side-effect of scanning the metadata of all of the installed python modules to build an in-memory cache. That cache isn't used anywhere in keystoneclient, and it can be expensive to build. The importlib.metadata module in the 3.8 standard library (and the importlib_metadata library for earlier versions) provides the same version lookup service using a more efficient scanning implementation. Switching from pkg_resources to importlib.metadata will help application startup time, which is especially important for command line programs such as python-openstackclient. Change-Id: Ia89044ff1876eeb2793cd08ed9095ce2ffe89e09 Depends-On: Ic6db7af34c87a636bfe55bacae03c42154f4b9c7 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
* | Stop using an admin endpoint by defaultDr. Jens Harbott2021-11-051-5/+14
|/ | | | | | | | | With V3 of the identity API, we no longer need to have a dedicated admin endpoint, so stop requesting one by default, allowing deployments to actually work without one. Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Change-Id: I96cc9c14008bcc59992d06c89f8f50895390f11e
* Add Response class to return request-id to callerDavid Stanek2018-03-261-0/+5
| | | | | | | | | | | | | | | | | | | | This change is required to return 'request_id' from client to log request_id mappings of cross-project requests. Instantiating class 'keystoneclient.v3.client.Client' using 'include_metadata=True' will cause manager response to return a new 'Response' class instead of just the data. This 'Response' class is going to have additional metadata properties available like 'request_ids' and the original data will be available as property 'data' to it. This change is backward compatible since user has to set a new parameter 'include_metadata=True' to client in order to get the request_id returned. Co-author: Dinesh Bhor <dinesh.bhor@nttdata.com> Partially Implements: blueprint return-request-id-to-caller Change-Id: Ibefaa484158ff08bfcacc1e2802d87fc26fd76a5
* Remove use of positional decoratorMorgan Fainberg2017-08-071-4/+0
| | | | | | | | | The positional decorator results in poorly maintainable code in a misguided effort to emulate python3's key-word-arg only notation and functionality. This patch removes keystoneclient's dependance on the positional decorator. Change-Id: I9e691cc8b0c04992f4a8dabd67e1b413d3220d23
* Remove log translations in python-keystoneclientwingwj2017-03-211-6/+4
| | | | | | | | | | | | Log messages are no longer being translated. This removes all use of the _LE, _LI, and _LW translation markers to simplify logging and to avoid confusion with new contributions. See: http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html Change-Id: Ia77819cbb133903d20e821bff0c45766b11ef07b
* Merge "Fix missing service_catalog parameter in Client object"3.8.0Jenkins2016-12-011-1/+4
|\
| * Fix missing service_catalog parameter in Client objectMikhail Nikolaenko2016-08-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return None if service_catalog parameter does not exist. service_catalog is the property and it is not initialized on object creation. service_catalog tries to get value from auth_ref and raises AttributeError exception if auth_ref is not initialized. It worked before we introduced sessions, because authentication happened on client instantiation. Now, when sessions are used, auth_ref is not initialized until the first request. This change adds try-catch block in service_catalog property to catch this error. Change-Id: I58eb888f0989241f9e5626564bd48d901b324d36 Closes-Bug: #1508374
* | Fix typo in httpclient.pyzhangyanxian2016-11-081-1/+1
|/ | | | | | TrivialFix Change-Id: I248e0548fc0242d9f164df901be3c87ae3a75413
* Merge "Fixing D105 PEP257"Jenkins2016-05-041-0/+2
|\
| * Fixing D105 PEP257Navid Pustchi2016-05-041-0/+2
| | | | | | | | | | | | | | | | Currently tox ignores D105. D105: Missing docstring in magic method. This change removes it and make keystoneclient docstring compliant with it. Change-Id: I34dfc164891880425f542f8f8aa3426ec8640c96
* | Merge "Fixing D200 PEP257 violation."Jenkins2016-05-041-6/+2
|\ \ | |/
| * Fixing D200 PEP257 violation.Navid Pustchi2016-05-041-6/+2
| | | | | | | | | | | | | | | | Currently tox ignores D200. D200: One-line docstring should fit on one line with quotes. This change removes D200 ignore in tox and fix violations. Change-Id: Icbf8cc1d4f1c00daeedeffe4397369f9e468b191
* | Merge "Fixing D202 and D203 PEP257 violation."Jenkins2016-05-041-2/+0
|\ \ | |/
| * Fixing D202 and D203 PEP257 violation.Navid Pustchi2016-05-041-2/+0
| | | | | | | | | | | | | | | | | | Currently tox ignores D202 and D203. D202: No blank lines allowed after function docstring. D203: 1 blank required before class docstring. This change removes D202 and D203 ignores in tox and fix violations. Change-Id: I97ef88c9cfd56774e47f789cbbcf8ccfe85d7737
* | httpclient: remove unused debug kwargsJulien Danjou2016-05-021-5/+1
|/ | | | | | | | | | | | | | | This has been deprecated for a while and is now not even used anymore. Indeed, nothing in the code use the attribute keystoneclient.httpclient.HTTPClient.debug_log. Furthermore, removing the debug keyword argument from the signature of keystoneclient.httpclient.HTTPClient.__init__ has no impact since this signature include **kwargs, which in Python means that you it will accept any keyword-argument. Any code that would still pass the debug argument to that method will therefore not notice any difference and will not fail. Change-Id: Iaae4febf3f13f6a66ad0e792dc2347b4699f65c0
* Fix D400 PEP257 violation.Navid Pustchi2016-04-231-1/+1
| | | | | | | | Currently tox ignores D400. D400: First line should end with a period. This change removes it and make keystoneclient docstrings compliant with it. Change-Id: I29ecb4c58bb03c0b9a3be0b7a74d18fb06a350f2
* Fix D401 PEP257 violation.Navid Pustchi2016-04-231-4/+4
| | | | | | | | Currently tox ignores D401. 401: First line should be in imperative mood. This change removes it and make keystoneclient docstrings compliant with it. Change-Id: If34ff12d18390b357342cf29f2d116dd3c86a44d
* Removing bandit.yaml in favor of defaultsChristopher J Schaefer2016-04-191-11/+17
| | | | | | | | | | | Removing old configuration options for build-in defaults of latest bandit functionality. Also, marking flagged items with _# nosec_ with a descriptive comment on why the code is acceptable as is. Co-Authored-By: Christopher J Schaefer <cjschaef@us.ibm.com> Co-Authored-By: Tom Cocozzello <tjcocozz@us.ibm.com> Change-Id: I138ebd46a8be195177361a9c3306bb70423b639d
* Merge "Deprecate adapter"Jenkins2016-02-121-1/+1
|\
| * Deprecate adapterJamie Lennox2016-02-031-1/+1
| | | | | | | | | | | | | | | | This involves switching keystoneclient to use the adapter on keystoneauth. Change-Id: I02780b0c00e3865f083b4bca98bff81127ed2277 Implements: bp deprecate-to-ksa
* | Merge "Remove python 2.5 workaround"Jenkins2016-02-041-6/+0
|\ \
| * | Remove python 2.5 workaroundBrant Knudson2016-01-311-6/+0
| |/ | | | | | | | | | | | | keystoneclient doesn't support python 2.5 so remove this workaround code. Messing with global variables is a mistake anyways. Change-Id: I1567508cb1931b8c5365cfe6584e5a732c459db0
* | Update keyring requirementsBrant Knudson2016-01-311-2/+3
|/ | | | | | | As of commit 05c2bcef the minimum keyring version is 5.5.1, so update the version that httpclient will use. Change-Id: I877b9d40b8bc4f89754d64d29d82a9e3a3f2dd04
* use positional library instead of utilsSteve Martinelli2016-01-251-4/+4
| | | | | | swap instances of utils.positional with the positional library. Change-Id: Id8a9961e68d287a802f25512fc970829e9feb5c2
* Merge "Address hacking check H405"Jenkins2016-01-231-2/+4
|\
| * Address hacking check H405lin-hua-cheng2016-01-131-2/+4
| | | | | | | | | | | | | | | | | | Previously, there were a string of commits to keystone that addresed ignored hacking checks. This commit does the same for H405 in keystoneclient. This also modifies our tox.ini so that we no longer ignore H405 violations. Change-Id: I2af152e5425a0e9c82314039fdbb90d661c22680 Closes-Bug: 1482773
* | Deprecate the baseclient.ClientJamie Lennox2015-12-171-1/+1
|/ | | | | | | | | | We don't want to support other clients subclassing this. Deprecate it for removal. As far as I know noone else is using this class. Change-Id: Iad0ea860bd07c657d7094018c037b003ea92dc28 Implements: bp deprecate-to-ksa
* Proper deprecation for httpclient.USER_AGENTBrant Knudson2015-08-291-2/+6
| | | | | | | | | | | | httpclient's USER_AGENT constant wasn't properly deprecated since the deprecation was only a comment. Proper deprecation requires use of warnings/debtcollector and documentation, but since this is a module symbol there's no way to put out a warning, so it's just documentation in this case. bp deprecations Change-Id: I02c77c690a31eea40935d2756748382abec86867
* Deprecate create HTTPClient without sessionBrant Knudson2015-08-291-7/+33
| | | | | | | | | The comments indicated that creating a HTTPClient without a session is deprecated, but there was no warning generated. bp deprecations Change-Id: I44796cbff95a7bbdd6e7a58e5cfb8360bdae5477
* Proper deprecation for Session.construct()Brant Knudson2015-08-131-1/+1
| | | | | | | | | | Session.construct() wasn't properly deprecated since the deprecation was only mentioned in the docstring. Proper deprecation requires use of warnings/debtcollector and documentation. bp deprecations Change-Id: Ieff238aff9d39cfbbb80381b2392c33d0359acb3
* Deprecate ServiceCatalog(region_name)Brant Knudson2015-08-131-1/+6
| | | | | | | | | | | | | | | | | | There was a FIXME to deprecate ServiceCatalog's region_name parameter and property. This is now deprecated. Note that debtcollector isn't used here since the deprecation happens on ServiceCatalog's __init__() to catch use in subclasses of ServiceCatalog. ServiceCatalog also has a factory function that constructs the correct instance and the factory function always passes region_name, so it's always using the deprecated kwarg even when region_name isn't passed to the factory. It's not worth figuring out how to do this with debtcollector. bp deprecations Change-Id: I0e64712474ca2767f3c0ade919359132450f6776
* Stop using .keys() on dicts where not neededBrant Knudson2015-08-061-1/+1
| | | | | | | | Iterating over a dict results in the keys. Using the 'in' operator on a dict checks if it's a key. Change-Id: I6affbfa1a79a9e8c0b5b304078a7a8e4e792eecd
* Proper deprecation for HTTPClient session and adapter propertiesBrant Knudson2015-08-041-5/+16
| | | | | | | | | | | HTTPClient's forwarded session and adapter properties weren't properly deprecated since the deprecations was only mentioned in the docstring. Proper deprecation requires use of warnings/ debtcollector and documentation. bp deprecations Change-Id: Iea76d7bbc3bdeb13f7fdb097f13e007b4dd85c8d
* Proper deprecation for HTTPClient.request methodsBrant Knudson2015-08-041-21/+49
| | | | | | | | | | | | | HTTPClient.request and related methods weren't properly deprecated since they were only mentioned in the docstrings. Proper deprecation requires use of warnings/debtcollector and documentation. Also, fixed places where the deprecated request method was called. bp deprecations Change-Id: I0a16933252937ca046793bb6eb2e5cc5da03c9ae
* Proper deprecation for HTTPClient.tenant_id|nameBrant Knudson2015-08-041-2/+23
| | | | | | | | | | | HTTPClient tenant_id and tenant_name properties weren't properly deprecated since they were only mentioned in the docstring. Proper deprecation requires use of warnings/debtcollector and documentation. bp deprecations Change-Id: I3c2f87df14bc9f8ffd82b99919fd1048123d0669
* Proper deprecation for HTTPClient tenant_id, tenant_name parametersBrant Knudson2015-08-041-3/+11
| | | | | | | | | | | | | HTTPClient() tenant_id and tenant_name parameters weren't properly deprecated since they were only mentioned in the docstring. Proper deprecation requires use of warnings/debtcollector and documentation. Also fixed a bunch of places in the tests where tenant_id and tenant_name were still being used despite being deprecated. bp deprecations Change-Id: I9c4f596b8ff10aede6c417886638a942cb18044c
* Proper deprecation for httpclient.request()Brant Knudson2015-07-261-2/+14
| | | | | | | | | | httpclient.request() wasn't properly deprecated since it was only mentioned in a comment. Proper deprecation requires use of warnings/debtcollector and documentation. bp deprecations Change-Id: Id35d64a8b2d536c5de90e398b2a7680fa30881d6
* Stop using deprecated AccessInfo.auth_url and management_urlBrant Knudson2015-07-241-2/+8
| | | | | | | | | | | The comments for the auth_url and management_url properties say that they're deprecated and to use the service catalog, but internal code was using the deprecated function. The code needs to be changed to use non-deprecated function. bp deprecations Change-Id: I6ada821fe305650d22e58a55192332f0f4986537
* tox env for BanditBrant Knudson2015-06-031-1/+1
| | | | | | | | | A tox env is created for the Bandit static code analyzer for security. bp bandit Change-Id: I8c0178befec77fe3d29b411a15ceed9a020820b5
* Adapter version is a tupleBrant Knudson2015-04-301-1/+5
| | | | | | | | The docstring for Adapter says that the version is a tuple like (3,0), but the HttpClient was passing a string like "v3". Closes-Bug: 1450272 Change-Id: I74b009d68f5601bda3ae92b3c8de1ecef00d8316
* Change oslo.serialization to oslo_serializationBrant Knudson2015-01-311-1/+1
| | | | | | | | The oslo libraries are moving away from namespace packages. bp drop-namespace-packages Change-Id: I76dc9f733b222144f0274f8854877587c3501d1e
* Allow fetching user_id/project_id from authJamie Lennox2015-01-051-0/+6
| | | | | | | | | | | This would ideally not be required however when building certain URLs the current user_id is needed. And when communicating with certain services we need to have access to the current project id. It seems better to allow plugins to give up the information if they have it than do various hacks to try and get it from them. Change-Id: Ib61b0628702806268be623a9987a922a60b04165 Closes-Bug: #1364724
* Pass all adapter parameters through to adapterJamie Lennox2014-12-051-4/+27
| | | | | | | | | | | We can't simply pass through kwargs to the adapter for compatibility reasons however make sure that we accept the appropriate arguments and pass them to adapter. Also add some notes to try and keep them up to date. Closes-Bug: #1399492 Change-Id: If72295590483bb52fcf5a0d59cf95f3e49ea69c8
* Correct documenting constructor parametersBrant Knudson2014-12-041-58/+56
| | | | | | | | | | When the docs are rendered to HTML, any docs on __init__ are not displayed. The parameters to the constructor have to be documented on the class rather than on the __init__ method. Also, corrected other minor issues in the same areas. Change-Id: Ic56da33f6b99fe5efb636c289e3c4e1569f0c84c
* Make keystoneclient use an adapterJamie Lennox2014-11-211-57/+153
| | | | | | | | | | | | | | | | | | | | | Apart from making keystoneclient follow the same patterns of using an adapter that we are trying to push onto other clients this severs the cyclical dependency between managers and the client object. There are a few changes that have had to be rolled into one to make the transition work. These can't be separated unfortunately as they are interdependent. * managers are now passed the adapter instead of the client. They therefore don't have reference to the other managers on the client. * The adapter has been subclassed to provide user_id as there are some managers that require user_id be provided for changing passwords etc. * client.auth_url has been replaced with a call to get_endpoint which is supported by the adapter. * management=True has been removed from all the managers and they now correctly set the interface they want. Change-Id: I49fbd50571f0c1484e1cbc3dcb2159d25b21b1bc
* Merge "Cleanup docs - raises class"Jenkins2014-11-181-3/+4
|\
| * Cleanup docs - raises classBrant Knudson2014-10-181-3/+4
| | | | | | | | | | | | | | | | | | The argument to the :raises: directive is the class name. If the class name is a valid reference it's rendered as a link to the class. This change cleans up the :raises: directives to use the reference correctly and use a valid class reference. Change-Id: I84188b60de0ab4c6b5b2fb5a203c43bfde094707
* | I18nBrant Knudson2014-10-281-9/+13
| | | | | | | | | | | | | | | | | | | | | | Keystoneclient didn't provide translated messages. With this change, the messages are marked for translation. DocImpact Implements: blueprint keystoneclient-i18n Change-Id: I85263a71671a1dffed524185266e6bb7ae559630
* | Merge "Prevent AttributeError if no authorization"Jenkins2014-10-271-1/+1
|\ \