summaryrefslogtreecommitdiff
path: root/keystoneclient/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Move apiclient.base.Resource into keystoneclientBrant Knudson2015-08-051-2/+91
| | | | | | | | | | | | | keystoneclient is using apiclient.base and in order to properly deprecate and eventually get rid of apiclient we need to move the symbols that keystoneclient uses out of apiclient. This change moves apiclient.base.Resource into keystoneclient.base by merging apiclient.base.Resource into the existing keystoneclient.base.Resource. apiclient.base.Resource is now renaming keystoneclient.base.Resource for backwards-compatibility. Change-Id: Id479711b7c9437aaf171def6976aab8b303ec56d
* Proper deprecation for Manager.apiBrant Knudson2015-07-261-1/+11
| | | | | | | | | | base.Manager's api property wasn't properly deprecated since all it had was documentation. Proper deprecation requires use of warnings and documentation. bp deprecations Change-Id: Ic5e218151e9b3f3b66f78729052680691d5ad582
* Prevent attempts to "filter" list() calls by globally unique IDsDolph Mathews2015-07-191-0/+11
| | | | | | | | | | | | | | | | | | | | | | This use case isn't covered by our current APIs: GET /entities?id={entity_id} Because we have a dedicated API for that: GET /entities/{entity_id} But our list() methods generally support **kwargs, which are passed as query parameters to keystone. When an 'id' is passed to keystone as a query parameter, keystone rightly ignores it and returns an unfiltered collection. This change raises a client-side TypeError (as you'd expect when you try to pass a keyword argument that a function isn't expecting), and includes a helpful suggestion to try calling get() instead. Change-Id: I100b69bbf571ad6de49ccc5ad1099c20b877d13d Closes-Bug: 1452298
* Merge "Inherited role domain calls on keystoneclient v3"1.4.0Jenkins2015-04-181-0/+5
|\
| * Inherited role domain calls on keystoneclient v3henriquetruta2015-04-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows the user to perform the following API calls through the python-keystoneclient: Assign role to user on projects owned by a domain: PUT /OS-INHERIT/domains/{domain_id}/users/{user_id}/roles/inherited_to_projects List user's inherited project roles on a domain: GET /OS-INHERIT/domains/{domain_id}/users/{user_id}/roles/inherited_to_projects Check if user has an inherited project role on domain: HEAD /OS-INHERIT/domains/{domain_id}/users/{user_id}/roles/{role_id}/inherited_to_projects Revoke an inherited project role from user on domain: DELETE /OS-INHERIT/domains/{domain_id}/users/{user_id}/roles/{role_id}/inherited_to_projects These same operations regarding groups instead of users are also available. Co-Authored-By: Raildo Mascena <raildo@lsd.ufcg.edu.br> Co-Authored-By: Samuel Medeiros <samuel@lsd.ufcg.edu.br> Change-Id: I877168e3922cdd19868d508ef9fc34d0c7e7abcb Closes-bug: 1367866
* | Implements subtree_as_ids and parents_as_idsRodrigo Duarte Sousa2015-03-131-0/+9
|/ | | | | | | | | | | This patch implements the new ways to get the project's hierarchy: 'subtree_as_ids': If True, returns projects IDs down the hierarchy as a structured dictionay. 'parents_as_ids': If True, returns projects IDs up the hierarchy as a structured dictionay. Change-Id: Ia3afe994893dfca059cb8361f7ab1c14e28e1ad5 Implements: blueprint hierarchical-multitenancy-improvements
* Correct documenting constructor parametersBrant Knudson2014-12-041-4/+3
| | | | | | | | | | 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-2/+1
| | | | | | | | | | | | | | | | | | | | | 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
* I18nBrant Knudson2014-10-281-3/+6
| | | | | | | | | | | Keystoneclient didn't provide translated messages. With this change, the messages are marked for translation. DocImpact Implements: blueprint keystoneclient-i18n Change-Id: I85263a71671a1dffed524185266e6bb7ae559630
* Extracting common code to private methodRodrigo Duarte Sousa2014-09-241-8/+5
| | | | | | Created a private method to build URL queries. Change-Id: Iaa480443e34073fa39d13d2452cd13c267a2bdd5
* Enumerate Projects with Unscoped TokensAdam Young2014-09-231-11/+19
| | | | | | | | Creating a client with a session using an Unscoped tokens now sets auth info in client. This Auth Info is necessary in order to enumerate projects. This is the standard login path for Horizon. Change-Id: I688a27cd0e7c98e7cf899ac65bb593a85171813f
* Don't log sensitive auth dataJamie Lennox2014-07-241-0/+5
| | | | | | | | | | | | | | | | Add the ability to turn off logging from the session object and then handle logging of auth requests within their own sections. This is a very simplistic ability to completely disable logging. Logging more filtered debugging can be added later. This new ability is utilized in this patch to prevent logging of requests that include passwords. This covers authenticate, password change, and user update requests that include passwords. SecurityImpact Change-Id: I3dabb94ab047e86b8730e73416c1a1c333688489 Closes-Bug: #1004114 Closes-Bug: #1327019
* Allow passing kwargs from managers to sessionJamie Lennox2014-07-231-19/+27
| | | | | | | | | | | Resource managers may need to pass certain overrides down to the session layer. The most common example would be to allow them to specify a different interface to issue a request to than is common. It is possible later that we may wish to expose this ability to users as well so that they can choose in there own programs what interface, endpoint name etc a particular request should be issued to. Change-Id: I7ee0931d4ea78cf9f463b2f0b54457226c5bea8d
* fixed typos found by RETF rulesChristian Berendt2014-05-031-1/+1
| | | | | | rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos Change-Id: I67fb3e0d02c931cb7e605ac74ea8272956afa8e1
* Use Resource class from OsloAndrey Kurilin2014-02-171-73/+2
| | | | | | | | | | | Most methods of Resource class from keystoneclient are similar to methods from common code. In the process of unification of the clients code we should reuse common functionality from Oslo. Related to blueprint common-client-library-2 Change-Id: I5858eec1596a6921dcf49dfcefb7abd4387de73b
* 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
* Prevent dictionary size from changing while iterating over its itemsCyril Roelandt2014-01-061-10/+8
| | | | | | | | | | In Python 3, dict.items() returns 'a dict_item'. Iterating over it while deleting some of the dictionary elements is forbidden. We have to iterate over a list to avoid getting this error: RuntimeError: dictionary changed size during iteration Change-Id: I43401e6eb9a31148fda4677644bf99e1b739d0dd
* Python3: replace urllib by six.moves.urllibCyril Roelandt2013-12-121-3/+11
| | | | | | This makes the code compatible with both Python 2 and 3. Change-Id: I721a5567842f2df6ce2a8af501787204daba3082
* Apply six for metaclassfujioka yuuichi2013-10-181-2/+1
| | | | | | | | | | | | | | | | | | | | The way to using metaclass has changed in Python3. Python 2.7 way: class Foo(object): __metaclass__ = FooMeta Python 3 way: class Foo(object, metaclass=FooMeta): ... The six.add_metaclass() decorator allows us to use one syntax that works for both Python 2.7 and Python 3. Change-Id: I08703a8b2927f45f4705fe085368d1ebd78b02fa Closes-Bug: #1236648
* Merge "python3: Refactor dict for python2/python3 compat"Jenkins2013-10-161-1/+1
|\
| * python3: Refactor dict for python2/python3 compatChuck Short2013-10-111-1/+1
| | | | | | | | | | | | | | | | | | Python3 changed the behavior of dict.keys such that it is now returns a dict_keys object, which is iterable but not indexable. You can get the python2 result back with an explicit call to list. Change-Id: Ic504d3929398aa82ac87d1735cf4cedea2dfc5d1 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* | Replace OpenStack LLC with OpenStack Foundation0.4.1ZhiQiang Fan2013-10-171-1/+1
|/ | | | | | | | | | Some files still use trademark OpenStack LLC in header, which should be changed to OpenStack Foundation. NOTE: tools/install_venv.py is not touched, should sync with oslo Change-Id: I01d4f6b64cf1a152c4e190407799ce7d53de845f Fixes-Bug: #1214176
* Standardize base.py with novaclientAlessio Ababilov2013-08-271-42/+141
| | | | | | | | | | | Main changes: * deprecate api variable in favour of client * add documentation * use to_slug from oslo strutils * remove Python 2.4 support * other small fixes from novaclient Change-Id: Ife54fd3207798ee03101a48bc1cda3b3f62cc5e4
* Fix and enable Gating on H404Dirk Mueller2013-08-151-17/+9
| | | | | | | Enable gating on the Hacking H404 check - docstring should start with a summary. Change-Id: I80612a15bd11f689e9e9f4dc2ff812138630ddbd
* Reorganize url creation.Jamie Lennox2013-07-291-41/+56
| | | | | | | | | | | | Make build_url extract used parameters from keyword arguments so they are not sent as the body to create, or as query parameters. Allow specifying a class level base_url that is used unless one is specifically provided. Break filtering function into a decorator as it seems the perfect usecase and it prevents a dictionary copy. Fixes: bug 1198772 Change-Id: I6d370ed504c300b9997199f351322e3083650c69
* Merge "Add find() method to CrudManager"Jenkins2013-06-061-0/+22
|\
| * Add find() method to CrudManagerDean Troyer2013-05-301-0/+22
| | | | | | | | | | | | | | Add a find() methods to CrudManager to maintain compatability with existing CLI lookups using utils.find_resource(). Change-Id: Ia9b38b975bb88fb361f3471b66f98c7e81bbc6de
* | Make ManagerWithFind abstract and fix TokenManagerAlessio Ababilov2013-05-191-0/+8
|/ | | | | | | | | ManagerWithFind requires list() method in its descendants. Make it abstract and fix its improper descendant TokenManager that do not implement list(). Change-Id: I83ae47d894c02d5cd1eb0da437dd05796d0b0160 Fixes: bug #1180393
* Revert "Use TokenManager to get token"Dolph Mathews2013-04-301-3/+2
| | | This reverts commit 22228f526d6ea08b7006be1287afe959b93c23db which appears to be breaking the keystone gating
* Use TokenManager to get tokenJulien Danjou2013-04-191-2/+3
| | | | | | | | Instead of implementing token retrieval twice, let's use the code provided by the TokenManger to get a token in raw format from Keystone. Change-Id: I769be118ee137580cabd5cabcf7843e7afe1e456 Signed-off-by: Julien Danjou <julien@danjou.info>
* Add name arguments to keystone command.Ken'ichi Ohmichi2013-01-171-3/+7
| | | | | | | | | | | | | | | | | | | | | | This patch adds name arguments to the following subcommands: * role-delete * role-get * service-delete * service-get * tenant-delete * tenant-get * tenant-update * user-delete * user-get * user-password-update * user-role-add * user-role-list * user-role-remove * user-update Fixes bug 1100648 Change-Id: I73c08c0ba553a72ec57ff3a684a00be4ef1294a6
* Use requests module for HTTP/HTTPSDean Troyer2012-12-181-1/+1
| | | | | | | | | | | | | * Implement correct certificate verification * Add requests to tools/pip-requires * Fix OS_CACERT env var help text * Add info to README * Rework tests to use requests Pinned requests module to < 1.0 as 1.0.2 is now current in pipi as of 17Dec2012. Change-Id: I120d2c12d6f20ebe2fd7182ec8988cc73f623b80
* Add command to allow users to change their own passwordDerek Higgins2012-11-271-3/+5
| | | | | | | | | | | | Fixes Bug 1082539 The Equivalent of doing curl -X PATCH http://localhost:5000/v2.0/OS-KSCRUD/users/<userid> \ -H "Content-type: application/json" \ -H "X_Auth_Token: <authtokenid>" \ -d '{"user": {"password": "ABCD", "original_password": "DCBA"}}' Change-Id: Ia1a907c5fd138c4252196145b361f43671047a1a
* fixes 1075376Joe Heck2012-11-061-2/+2
| | | | | | | removes setting loaded=True on resource loads where it hasn't been fully loaded - breaking keystone master tests Change-Id: I889782d605637f7d5bbd2462d1a2dfb1574e4624
* Fixed httplib2 mocking (bug 1050091, bug 1050097)Dolph Mathews2012-10-091-1/+4
| | | | | | | | | - 204 No Content should be mocked with empty response bodies - Content-Type headers should not be mocked with empty response bodies - httplib2 would never return None as a response body - The Identity API never expects a req/resp body with a string value of "null" Change-Id: Ie22e8e5288573268165ed06049978195955f8ca6
* Manager for generic CRUD on v3Dolph Mathews2012-10-041-0/+111
| | | | Change-Id: I15944f2e171e26b5209b55356edd1110b301310c
* Add generic entity.delete()Dolph Mathews2012-09-111-0/+3
| | | | Change-Id: I00188326b6343a4eb4d1dd1b6a24e691ffd30415
* Add support for HEAD and PATCHDolph Mathews2012-09-111-2/+7
| | | | Change-Id: Ic874c49b791e9d2cb3d44b15511cbb467a551589
* Don't need to lazy load resources loaded from APIDolph Mathews2012-09-111-3/+3
| | | | Change-Id: Ibff7feabc8cba062bc9367c6755279b88a9a3c04
* pep8 1.1 changes and updatesJoe Heck2012-06-011-2/+2
| | | | Change-Id: I8bc3582bb3f35a3d841bb1e8c03b62ba61ff92d7
* Fixes user update methods.Tihomir Trifonov2012-02-151-2/+8
| | | | | | | | | | 1. Fixes the url for user update methods to reflect extension status, e.g. 'users/{user_id}/tenant' to 'users/{user_id}/OS-KSADM/tenant', as per Keystone API. 2. Fixes the update_user method, as it expects a POST instead of PUT. Change-Id: I045ca7650b2ef8969af695900da1b4f62d4da6bd
* Updates client to work with keystone essex roles API routes.Gabriel Hurley2012-01-281-2/+4
| | | | | | | Also adds pep8 to requirements since it was missing, and adds the automatically-created venv to the gitignore list. Change-Id: Iafa05c1889d7706b79d0f9392a9ac24f2f5a1719
* Initial commit.Gabriel Hurley2011-10-251-0/+191