summaryrefslogtreecommitdiff
path: root/keystoneclient/adapter.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of positional decoratorMorgan Fainberg2017-08-071-2/+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
* Removing bandit.yaml in favor of defaultsChristopher J Schaefer2016-04-191-2/+4
| | | | | | | | | | | 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
* Deprecate adapterJamie Lennox2016-02-031-0/+7
| | | | | | | | This involves switching keystoneclient to use the adapter on keystoneauth. Change-Id: I02780b0c00e3865f083b4bca98bff81127ed2277 Implements: bp deprecate-to-ksa
* use positional library instead of utilsSteve Martinelli2016-01-251-3/+2
| | | | | | swap instances of utils.positional with the positional library. Change-Id: Id8a9961e68d287a802f25512fc970829e9feb5c2
* Allow passing logger object to requestJamie Lennox2015-03-161-1/+7
| | | | | | | | | | It can become difficult to trace the client that created HTTP requests as the logging all goes through the keystoneclient.session logger. Allow passing the logger through the request function and make it able to be set via the adapter so it can be set once per client instantiation. Change-Id: Id45c315bee9a56f1c241210d667470751bf689d5 Closes-Bug: #1421868
* 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
* Surface the user_id and project_id beyond the pluginJamie Lennox2015-01-231-0/+34
| | | | | | | | | | | | | | Having the user_id and project_id exposed in the plugin is a good first step however we don't really expect the user to be interacting with the plugins directly often - particularly as you need to pass session to the methods. Exposing get_user_id and get_project_id on the session and the adapter in this way is very similar to the way we expose get_token and get_endpoint on the session and adapter for use higher up. Related-Bug: #1364724 Change-Id: If2f868c3ddc19133f18446e74f8e1b560a4798fa
* get_endpoint should return the overrideJamie Lennox2014-12-071-0/+3
| | | | | | | | | | | | | If your adapter has an endpoint_override set then this value will be consumed by session and used in preference to whatever you give to endpoint_filter. This means that if you ask the adapter for the endpoint it is going to use to query a URL you expect to get back the override because this is where it will be sent. Closes-Bug: #1400174 Change-Id: I707e549a4fa349d0e9a0bdac61a2573aa2e5b434
* Pass all adapter parameters through to adapterJamie Lennox2014-12-051-0/+2
| | | | | | | | | | | 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-18/+17
| | | | | | | | | | 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
* Merge "Docstring cleanup for return type"Jenkins2014-12-021-2/+4
|\
| * Docstring cleanup for return typeBrant Knudson2014-10-151-2/+4
| | | | | | | | | | | | | | The :returns: directive doesn't take an argument. To specify the return type, use the :rtype: directive. Change-Id: I3aaab824792333b3f75a10af92f5b712cc9b4ff6
* | Merge "Cleanup docs - raises class"Jenkins2014-11-181-2/+4
|\ \
| * | Cleanup docs - raises classBrant Knudson2014-10-181-2/+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
* | Use oslo.utils and oslo.serializationSteve Martinelli2014-10-151-1/+2
|/ | | | | | | Left timeutils and strutils in openstack/common since they are used in openstack/common/apiclient and memorycache. Change-Id: Idb5f09c159d907dfba84cd1f7501f650318af7d9
* Allow retrying some failed requestsJamie Lennox2014-09-161-1/+9
| | | | | | | | | | | | | | | | | | | Connection Errors can be transient and there are many clients (including auth_token middleware) that allow retrying requests that fail. We should support this in the session, disabled by default, rather than have multiple implementations for it. For the moment I have purposefully not added it as an option to Session.__init__ though I can see arguments for it. This can be added later if there becomes a particular need. I have also purposefully distinguished between Connection Errors (and connect_retries) and HTTP errors. I don't know a good way to generalize retrying on HTTP errors and they can be added later if required. Blueprint: session-retries Change-Id: Ia219636663980433ddb9c00c6df7c8477df4ef99
* Expose auth methods on the adapterJamie Lennox2014-09-011-8/+41
| | | | | | | | | | | | Provide access to get_token, get_endpoint and invalidate to the adapter. The adapter is essentially created per individual client and it can be useful to know things like the endpoint that requests will be sent to based on the parameters that are included in the endpoint_filter. This essentially allows us to emulate the management_url and auth_token properties of the existing clients. Change-Id: Ic01bc52bb38e8fb72e7a6d93bfd2944b11d0b070
* Add version parameter to adapter.Jamie Lennox2014-09-011-1/+5
| | | | | | | | | | | | The version parameter was left out of adapter previously because setting a version number triggers discovery and I felt that it was not ready for the other services. However if it isn't set then it won't be used and we may as well implement it here once rather than have the individual services that do support it override it themselves. Change-Id: I707380a01175dc19b59de32cbb8fd2bb123d7335
* Allow providing an endpoint_override to requestsJamie Lennox2014-09-011-3/+8
| | | | | | | | | | | | As much as I'd prefer not to need this functionality there are plenty of existing clients that we want to have use the adapter that can accept a bypass argument such that it ignores the service catalog and uses that URL for all requests. We therefore need to be able to support similar functionality in our adapter. Change-Id: I206705241ff9b84967d0d9c089b4795bcc26b65e
* Use jsonutils to load adapter responseJamie Lennox2014-07-151-1/+2
| | | | | | | | | This is not technically needed, however we and the libraries we use, aren't very good about keeping our strings and bytes straight for python 3. jsonutils has an attempt to decode stage that means we can let it manage the correct types. Change-Id: I2caf4a5b9a04495aa0286f2b6e3193a17ff246e5
* Session AdaptersJamie Lennox2014-06-251-0/+115
A Session is a global object that can be shared around. There are however many variables (those passed to session.request) that are specific to the client that will be using that session. These often need to be set for every request going through a client. For this purpose we have a Session Adapter. An adapter is like a view on a session. Where the session maintains very global state the adapter maintains state relevant to a specific usage of a session. These might be things like User-Agent which wants to be set per client using the session, or possibly even auth plugins if we share a common session object amongst a number of clients with different plugins. Almost anything that gets passed to a Session.request() call is suitable to go into an adapter (the exceptions are essentially the body data and method which only makes sense per call) Implements: blueprint session-propagation Change-Id: I100c791806674213d3cdb5389d4b0a1cf88c82dd