summaryrefslogtreecommitdiff
path: root/keystoneclient/httpclient.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
|\ \
| * | Prevent AttributeError if no authorizationAdam Young2014-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you ask client if there is a service catalog when it is unauthorized it tries to look up the service catalog on a None object. If the client is unauthorized it should always return False as there cannot be a service catalog. Change-Id: I439f71e548b8230e7ce38d1a0e9d0d8f9b205d77 Closes-Bug: 1239219
* | | Merge "Remove warning about management token"Jenkins2014-10-251-1/+1
|\ \ \ | |/ / |/| |
| * | Remove warning about management tokenMonty Taylor2014-10-121-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Because keystoneclient tries to figure out a management_url in all contexts, it means that any end-user who uses any python-*client from OpenStack that is using python-keystoneclient will always get a warning about not being able to get a management token. This is, however, not something that they need warning about, since there is no expectation they'll have one. It's distressing to see it as part of normal operation. So just remove the warning. Change-Id: Ia103a53c09c00fc09cef5fb24be546fc1da0684a
* | Use oslo.utils and oslo.serializationSteve Martinelli2014-10-151-1/+1
|/ | | | | | | Left timeutils and strutils in openstack/common since they are used in openstack/common/apiclient and memorycache. Change-Id: Idb5f09c159d907dfba84cd1f7501f650318af7d9
* Update hacking to 0.9.xSteve Martinelli2014-09-211-1/+1
| | | | | | | | | Address some issues that came up because of hacking upgrade. But ignoring H904 since the slashes are valid, as they are in comments, not code. Change-Id: Ie8a94fc71632e4130c2ec663a5c6d3f2042f8263 Closes-Bug: #1328469
* Merge "Move fake session to HTTPClient"Jenkins2014-08-261-0/+18
|\
| * Move fake session to HTTPClientJamie Lennox2014-08-211-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | The fake session object is to prevent a cyclical dependency between HTTPClient and the session from leaving hanging session objects around. This is still necessary if you construct a client the old way however if you are using the session properly then there is no cyclical dependency and so we shouldn't prevent people using the connection pooling advantages of the session. Related-Bug: #1282089 Change-Id: Ifca2c7ddd95a81af01ee43246ecc8e74abf95602
* | Add the 'auth' interface typeJamie Lennox2014-07-251-1/+1
|/ | | | | | | | | | | | There are certain requests that will always want to be sent to the auth_url. Add a new interface type to the get_endpoint command of the base identity plugin such that if you ask for the 'auth' interface it will give you the auth_url. Implements: blueprint session-auth-endpoint Change-Id: If653970354b919fdd6e80c061611c3aad129c574
* Only conditionally import working keyringSean Dague2014-07-171-2/+14
| | | | | | | | | | | | | | | | | keyring is conditionally imported if available on your platform, however not all versions of keyring actually work. Specifically we have global-requirements of >=2.1,!=3.3, so we know those are the only versions we believe work. If you are on an older platform, using system installed python-keyring, python-keystoneclient won't install a new version, because it's optional, but then will use a terriblely old verison, which explodes with dbus errors. The fix is to be more explicit on import. Change-Id: I040f7b2311d7d5a450b8b12642752ac519b206fa Closes-Bug: #1242992
* Merge "Unversioned endpoints in service catalog"Jenkins2014-06-251-0/+9
|\
| * Unversioned endpoints in service catalogJamie Lennox2014-06-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you pass a version number to the endpoint_filter then an identity plugin will make a request to the URL in the service catalog and find an appropriate URL for the requested version. It caches the response to each of the discovery queries so that it should only query once per URL. This will only work for applications that create session objects directly as the legacy model does not use the get_endpoint features of an identity plugin. This change showed an inconsistency in the docstrings between discovery and the usage of discovery so the docstring was fixed. Blueprint: endpoint-version-query Change-Id: I277f2f6ad6c8cd44f1a9c06cf07d62bc8f8b383b
* | Update keystoneclient code to account for hacking 0.9.2Steve Martinelli2014-06-191-1/+2
|/ | | | | | | | | | | | | | | | | | Fixed most of the errors reported back from hacking 0.9.2. Specifically: - E128 continuation line under-indented for visual indent - E251 unexpected spaces around keyword / parameter equals - E265 block comment should start with '# ' - H305 imports not grouped correctly - H307 like imports should be grouped together - H402 one line docstring needs punctuation - H904 Wrap long lines in parentheses instead of a backslash But opted to ignore the following for now: - E122: continuation line missing indentation or outdented - H405: multi line docstring summary not separated with an empty line Change-Id: Ib8e698d85fd598fa91435538657361a1f695ce89
* replace string format arguments with function parametersChristian Berendt2014-05-201-5/+4
| | | | | | | | | There are files containing string format arguments inside logging messages. Using logging function parameters should be preferred. Change-Id: Ibd9def4cf111d5dcf15dff64f85a723214a3c14e Closes-Bug: #1320930
* Merge "Handle URLs via the session and auth_plugins"Jenkins2014-03-251-11/+19
|\
| * Handle URLs via the session and auth_pluginsJamie Lennox2014-03-251-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | In the future clients will simply pass the service they expect to talk to and the path. This will prevent every service trying to get their own base urls from the service catalog individually. This can later be extended to have the auth plugin actually contact the URL from the service catalog which will let us have unversioned endpoints in the catalog handled from a single location. Change-Id: I80f0b5b1dbb45565fec09d1cb2c0552cfb9a72f5 blueprint: auth-plugin-endpoints
* | Start using positional decoratorJamie Lennox2014-03-251-0/+4
|/ | | | | | | | | Apply the positional decorator to functions. It has been added as I think best practice would dictate, though in some places it has been added in a way that doesn't break existing tests. Closes-Bug: #1295881 Change-Id: I4f7ddbede4cba4ab79d144ad1f9dc83ea76f204a
* Remove vim headerEric Guo2014-02-081-2/+0
| | | | | | | | We don't need vim modelines in each source file, it can be set in user's vimrc. Change-Id: Ic7a61430a0a320ce6b0c4518d9f5d988e35f8aae Closes-Bug: #1229324
* Create Authentication PluginsJamie Lennox2014-02-041-17/+26
| | | | | | | | | | | | | | Provides the framework for creating authentication plugins and using them from a session object. To allow this system to co-exist with the original client there is a bit of a hack. The client object itself is now also an authentication plugin, that supports the original client pattern. If a client is created without a session object then that session object uses the client as it's authentication plugin. Change-Id: I682c8dcd3705148aaa804a91f4ed48a5b74bdc12 blueprint: auth-plugins
* Provide a conversion function for creating sessionJamie Lennox2014-02-031-24/+8
| | | | | | | | | | | | | | Session.construct will create a session based upon the kwargs that used to be passed to a client __init__ function. This will allow clients an easy path to providing compatibility with deprecated arguments. Make use of the function throughout discovery. Discovery was initially released prior to the session object being completed and was therefore handled with the same arguments as a client. Instead we should use a session object so use the conversion function to convert those kwargs into a session object if one is not provided. Change-Id: I8dc1e0810ea6ebc6ea648ec37d7881825c566676