summaryrefslogtreecommitdiff
path: root/openstackclient/identity/client.py
Commit message (Collapse)AuthorAgeFilesLines
* osc-lib: shellDean Troyer2016-08-051-4/+3
| | | | | | | | | | | | | Convert to using ClientManager and OpenStackShell from osc-lib. * Change all internal uses of ClientManager private attributes that are now public in osc-lib's ClientManager. Leave back-compat copies in place in OSC's clientManager so we don't break plugins. * Put some work-arounds in place for changes in osc-lib that we need until a new release makes it through the g-r and u-c change process. * Add a test for Unicode decoding of argv in shell.main() to parallel the one in osc-lib. Change-Id: I85289740d4ca081f2aca8c9b40ec422ad25d302c
* Standardize import formatshizhihui2016-07-221-0/+1
| | | | | | | | According to the rule in http://docs.openstack.org/developer/hacking/#imports I modify some irregular import format. Change-Id: Ibf29ccaf3ddec4a956334cc3368ebee7a66e282c
* osc-lib: api.authDean Troyer2016-06-301-1/+1
| | | | | | Move auth plugin checking to osc-lib. Change-Id: I673d9c2d6e8bbf724c3000459a729e831d747814
* Fix i18n problems for common files in identityTang Chen2016-06-141-3/+4
| | | | | | | Some missing parts in identity. Change-Id: I8777b845613d7d7df36ac3c198da552e11aaad1b Partial-bug: #1574965
* osc-lib: utilsDean Troyer2016-06-131-1/+2
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* Fixed a bunch of spacingBrandon Palm2016-02-231-1/+2
| | | | | | | Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
* Change Identity API default version to 3Steve Martinelli2015-10-091-1/+1
| | | | | | | | | | Devstack now issues all v3 OSC commands for our CI, and since v3 has everything v2 has, we should be able to switch to v3. Furthermore, most OSC users were initially using OSC since they were looking to exploit v3 keystone capabilities. Change-Id: If7de86946f6dd0f148aa5f526155cccf90adfcc3
* Do not set default versions in parsed argsTerryHowe2015-07-181-5/+3
| | | | | | | | | | | Setting default versions in parsed args makes it so OCC cannot tell if the argument was parsed, an environment variable was set or it is just defaulted. In order to set api versions from OCC, it will have to be defaulted after processing OCC. Closes-Bug: #1453229 Change-Id: I4d065919397b783f3bdd4022c986c0234a7a16e6
* Rename endpoint type to interfaceTerryHowe2015-07-151-3/+2
| | | | | Change-Id: I4e21d09bc747e8210f4f79a1d6c4c7ccf2f25d1c Closes-Bug: #1454392
* Add --os-endpoint-type cli optional argumentRoxana Gherle2015-07-021-1/+6
| | | | | | | | | | | | User should be able to specify the endpoint type through a CLI optional argument/ENV variable setting. We will name this new optional argument: --os-endpoint-type (Env: OS_ENDPOINT_TYPE) and based on the value given, the service API will use that specific endpoint type. Possible values: public, admin, internal. DocImpact Closes-Bug: #1454392 Change-Id: Ife3d4e46b44c0ddcd712b1130e27e362545a9a29
* Raise AttributeError for unknown attributesJamie Lennox2015-03-051-1/+0
| | | | | | | | | Not returning a value is the same as returning None. In the event that someone asks ClientManager for an attribute that doesn't exist it should raise AttributeError in the same way as other python objects rather than return an empty value. Change-Id: Id0ee825e6527c831c38e3a671958ded362fb96e1
* Add region name for identity and volume clientsSteve Martinelli2015-01-211-0/+1
| | | | | | | | | We do not take into account region names for identity and volume clients. Change-Id: I4263e9013226b0adc6b9ad7540d6ad3efb42e809 Co-Authored-By: Eric Helgeson <erichelgeson@gmail.com> Related-Bug: #1405416
* Liberalize version matching a bitDean Troyer2014-11-161-4/+6
| | | | | | | | | | | | | | | | | For class-loading purposes we can just use the major version, so accept that. Only Identity and Compute were affected; Compute is included just to be pedantically complete. For command groups we also just use the major version so fix Compute and the version option handling. Change the internal default for Identity to a simple '2' so it is also consistent with the rest of the world. Then comes microversioning... Closes-Bug: #1292638 Change-Id: Ibaf823b31caa288a83de38d2c258860b128b87d8
* Remove ClientManager._service_catalogDean Troyer2014-10-181-20/+4
| | | | | | | | | | Anything that needs a service catalog can get it directly from auth_ref.service_catalog, no need to carry the extra attribute. ClientManager.get_endpoint_for_service_type() reamins the proper method to get an endpoint for clients that still need one directly. Change-Id: I809091c9c71d08f29606d7fd8b500898ff2cb8ae
* Support for keystone auth pluginsMatthieu Huin2014-10-091-15/+6
| | | | | | | | | | | | | | | | | | | | | | | This patch allows the user to choose which authentication plugin to use with the CLI. The arguments needed by the auth plugins are automatically added to the argument parser. Some examples with the currently available authentication plugins:: OS_USERNAME=admin OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v2.0 \ OS_PASSWORD=admin openstack user list OS_USERNAME=admin OS_PROJECT_DOMAIN_NAME=default OS_USER_DOMAIN_NAME=default \ OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v3 OS_PASSWORD=admin \ OS_IDENTITY_API_VERSION=3 OS_AUTH_PLUGIN=v3password openstack project list OS_TOKEN=1234 OS_URL=http://service_url:35357/v2.0 \ OS_IDENTITY_API_VERSION=2.0 openstack user list The --os-auth-plugin option can be omitted; if so the CLI will attempt to guess which plugin to use from the other options. Change-Id: I330c20ddb8d96b3a4287c68b57c36c4a0f869669 Co-Authored-By: Florent Flament <florent.flament-ext@cloudwatt.com>
* Use Keystone client session.SessionDean Troyer2014-09-081-23/+13
| | | | | | | | | | | | | | This replaces the restapi requests wrapper with the one from Keystone client so we can take advantage of the auth plugins. As a first step only the v2 and v3 token and password plugins are supported. This maintainis no changes to the command options or environment variables. The next steps will include reworking the other API client interfaces to fully utilize the single auth session. Blueprint: ksc-session-auth Change-Id: I47ec63291e4c3cf36c8061299a4764f60b36ab89
* Merge "Change app.restapi to app.client_manager.session"Jenkins2014-09-061-0/+10
|\
| * Change app.restapi to app.client_manager.sessionDean Troyer2014-08-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | This is step 1 toward using Keystone client's session.Session as the primary session/requests interface in OSC. * Move the session create into ClientManager and rename 'restapi' attribute to 'session' * Set up ClientManager and session loggers * Fix container and object command references to restapi/api Change-Id: I013d81520b336c7a6422cd22c05d1d65655e64f8
* | Make Identity client load like the othersDean Troyer2014-08-281-0/+21
|/ | | | | | | | | | | | | | This does a couple of things: * Loads the Identity client module in the same manner as the other 'base' clients (where 'base' == 'included in the OSC repo') * Changes the entry point group name for the base clients to 'openstack.cli.base'. The extension group name remains the same. * Loads the base modules first followed by the extension modules. This load order ensures that the extension module commands are all loaded _after_ the base commands, allowing extensions to now override the base commands. Change-Id: I4b9ca7f1df6eb8bbe8e3f663f3065c2ed80ce20b
* More make_client() logging cleanupDean Troyer2014-07-261-1/+1
| | | | Change-Id: I5af4b9c52c69d6e31e6ca5f90d5880c097880a71
* Clean up make_client() loggingDean Troyer2014-07-081-2/+4
| | | | Change-Id: I0b6760a6401b50e3dfb891af75424ae89df42ebc
* trust authenticationMatthieu Huin2014-07-031-0/+2
| | | | | | | | | This patch enables authenticating by using a trust. The trust ID must be set with the parameter --os-trust-id or the env variable OS_TRUST_ID. Trusts are available for the identity v3 API. Co-Authored-By: Florent Flament <florent.flament@cloudwatt.com> Change-Id: Iacc389b203bbadda53ca31a7f5a9b8b6e1a1f522
* Use cacert values when creating identity clientJamie Lennox2014-02-261-1/+4
| | | | | | | | These were ignored when the client was created with a username and password. Change-Id: Id7557a5b07a41c7f79ab1a05ede385da31889940 Closes-Bug: #1284957
* Python 3: fix a syntax errorCyril Roelandt2014-02-111-1/+1
| | | | | | "raise AttributeError, name" is invalid in Python 3. Change-Id: Id61bd3747f49c2bd810cbfeae56506e7ed9d2bd0
* Add support for specifying custom domainsPaul Belanger2014-01-071-0/+6
| | | | | | | | | | | | Add the ability to pass user_domain_id / user_domain_name, domain_id / domain_name, and project_domain_id / project_domain_name to keystone. These parameters are the first step needed to getting multi-domain support working via the CLI. Closes-Bug: #1198171 Change-Id: I81a8534913978ff1cce01ec02741ae477e8c5fa4 Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com> Signed-off-by: Bo Tang <btang@cs.utsa.edu>
* Expand support for command extensionsDean Troyer2013-11-211-0/+2
| | | | | | | | | | | | Allows client libraries to have complete access to the rest of the OSC ClientManager. In addition, extension libraries can define global options (for API version options/env vars) and define versioned API entry points similar to the in-repo commands. The changes to ClientManager exposed some issues in the existing object api tests that needed to be cleaned up. Change-Id: Ic9662edf34c5dd130a2f1a69d2454adefc1f8a95
* Add options to support TLS certificate verificationDean Troyer2013-10-071-1/+4
| | | | | | | | | | Add --os-cacert and --verify|--insecure options using the same sematics as the other project CLIs. --verify is included for completeness. Bug: 1236608 Change-Id: I8a116d790db5aa4cb17a2207efedce7cb229eba3
* Add Identity v2 role and service testsDean Troyer2013-09-041-1/+2
| | | | | | | | | * Add current auth info (auth_ref) to ClientManager * Fix identity.v2_0.role.ListUserRole to get default user/project from ClientManager.auth_ref * Fix identity.v2_0.role.AddRole call to roles.add_user_role() Change-Id: Ie8bf41c491d97b0292a2b86bdc9b7580989a7f97
* Merge "Remove tenant round 1 - global options"Jenkins2013-07-311-2/+2
|\
| * Remove tenant round 1 - global optionsDean Troyer2013-07-311-2/+2
| | | | | | | | | | | | | | | | | | Change the global auth options to use 'project', leave the original tenant options in place but silent for compatability with the existing project CLI auth options. This is the only compatibility for tenant usage in this changeover. Change-Id: I3cce6e552f18822cc9f445ec5f301b0f5d9003f8
* | Add security group commandsDean Troyer2013-07-291-1/+12
|/ | | | | | | | | | | | | | * Add security group: create, delete, list, set, show * Add server: add secgroup, remove secgroup * Add security group rule: create, delete, list * Add Oslo's strutils and gettextutils * Adds parseractions.RangeAction() to handle option arguments of either a single number or a range of numbers: '--port 25' or '--port 1024:65535' Blueprint: nova-client Change-Id: Iad2de1b273ba29197709fc4c6a1036b4ae99725f
* Upgraded to PEP8 1.3.3 to stay aligned with Nova, etc.Josh Kearney2013-01-311-8/+5
| | | | | | | | Made all the necessary changes to pass new PEP8 standards. Also cleaned up docstrings to conform to the HACKING stanards. Change-Id: Ib8df3030da7a7885655689ab5da0717748c9edbe
* Merge "Standardize on a copyright header and ensure all files have them."Jenkins2013-01-281-12/+10
|\
| * Standardize on a copyright header and ensure all files have them.Josh Kearney2013-01-241-12/+10
| | | | | | | | Change-Id: I64812bca01ca655c9cf9239a0daea84907082a29
* | v3 identity - group and project apiSteve Martinelli2013-01-281-0/+1
|/ | | | | | | | | | | updated with latest comments modified entry points in setup.py added group.py (v3) added project.py (v3) fixed indentation updated to include new headers Change-Id: Ice68b6c5bacb68d2e95321d903043056a9b8e810
* Clean up test environment and remove unused imports.Josh Kearney2013-01-221-1/+0
| | | | | | First round of adding more complete unit test coverage. Change-Id: Ic1979c499ca6fcb784892a95954a3527539c4e53
* Move get_client_class() to common.utilsDean Troyer2012-05-111-14/+6
| | | | | | * add constants for API_NAME Change-Id: I8ccf72f032227e0a452d96303181549b1b11a5d1
* Add API versioning supportDean Troyer2012-05-101-3/+22
| | | | | | | | | * Specific versions supported are managed in XXXXXX.client.py with a mapping from version to client class. This is based on the scheme that is included in novaclient; none of the other client libs have that capability. Change-Id: I930b197f1189e7f52c3b0096e73e0773cf925542
* Add copyright notices and update datesDean Troyer2012-05-101-0/+17
| | | | Change-Id: I54a7d99328143205ab97ea930aeeeb69fe92c76c
* More identity client configDean Troyer2012-05-101-9/+16
| | | | | | | | | | | | | | * move auth option checking back to OpenStackShell() to keep the shell-level interaction at that level; add checking for token flow options * make identity.client.make_client() configure keystoneclient.v2_0.Client() properly for both password flow and token flow auth * eliminated ClientManager.init_token(), set _service_catalog in __init__() * compute client handles token flow Change-Id: I42481b5424489387798c4ec6d3e2a723ab1e6067
* Add Identity to ClientManagerDean Troyer2012-05-041-0/+20
* Make the Identity client in identity.client.make_client() * Auth via ClientManager.identity * Skip extra auth roundtrip in compute client Change-Id: I0190639e38f83997c233195f6cc27ff3afdfba10