50 Commits

Author SHA1 Message Date
Dean Troyer
da45b34828 Add service catalog commands
'catalog list' and 'catalog show' for Identity v2

Identity v2 only so far.

Change-Id: I9df0dac3d5bb7c18f38a81bd7d29f8119462d3a5
2014-09-18 15:42:10 -05:00
Dean Troyer
ae957b176e Use Keystone client session.Session
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
2014-09-08 00:06:52 -05:00
Jenkins
3317e0abf6 Merge "Add action 'user password set' for identiy v3" 2014-09-07 15:12:18 +00:00
Mouad Benchchaoui
0069adef5c Add action 'user password set' for identiy v3
This new action will allow a user to change their own password by
either providing the new password as an argument (--password) or by
being prompted to enter the new password.
In both cases user will be prompted to enter their current password
as required by the v3 API.

Closes-Bug: #1337245
Change-Id: I5e1e0fd2b46a4502318da57f7cce2b236fb2d93d
2014-09-07 02:37:54 -04:00
Jenkins
b7816f3997 Merge "add service/interface/region filter for endpoint v3" 2014-09-06 17:02:45 +00:00
Jenkins
7a8c9a7a8a Merge "add tests for identity v3 endpoint" 2014-08-23 16:42:08 +00:00
Jenkins
fc44578f0a Merge "add tests for identity v3 domain" 2014-08-22 10:57:36 +00:00
wanghong
181f16da8a add service/interface/region filter for endpoint v3
Change-Id: I7eac5b2ff5f5a6f3f08b22dd3a48a5ae7e2c056b
Closes-Bug: #1281888
2014-08-18 16:41:15 +08:00
wanghong
99ad9ef92e add tests for identity v3 endpoint
Change-Id: I1479460473656ea4e2a48a976808371e840b49c1
Closes-Bug: #1348867
2014-08-14 20:17:54 +08:00
wanghong
2dc060cff3 add tests for identity v3 domain
Change-Id: I478215f62b51e6e73283f0304ea1b0736177d1b1
2014-08-14 20:11:00 +08:00
wanghong
19b8605224 a mistake in tests/identity/v3/test_role.py
Change test_service_show to test_role_show.

Change-Id: Ieef7fdeb9401b4dc28720c9ba14bf460ac171288
2014-08-12 19:36:57 +08:00
Jamie Lennox
5e7e94d59e Fix IDP commands
identity_client.identity_providers doesn't exist as a manager. These are
located at identity_client.federation.identity_providers. Fix the
routes.

Also fix passing id to .create() as a positional argument. This is not
allowed from keystoneclient it should be passed as a keyword argument.

Change-Id: I912c27fcee58b0723e27e9147def2cbd1c62c288
2014-07-21 10:04:47 +10:00
Terry Howe
b638488697 Domain administrator cannot do project operations
Domain administrator cannot do project operations because the
require access to the domain API (which they don't have).  When
attempting to find a domain for project operations, ignore errors
because the API returns nothing without indicating there is a
problem.  The domain administrators will have to use a domain id,
but they will still be able to do project operations.  If the user
does not have permission to read the domain table, they cannot
use domain names.

Change-Id: Ieed5d420022a407c8296a0bb3569d9469c89d752
Closes-Bug: #1317478
Closes-Bug: #1317485
2014-07-07 20:18:39 +00:00
Steve Martinelli
3bdfef827c Remove backslash usage from a few tests
Noticed these in the code, figured we should stick to not using
backslashes if possible.

Change-Id: I55e5402683141e14df7c2b38883b1f3cc2a6bb6a
2014-07-02 00:00:33 -04:00
Jenkins
ddf0c16a10 Merge "Fix PEP8 E126 and E202 errors" 2014-06-27 21:41:34 +00:00
Jenkins
58583b55ca Merge "Fix PEP8 E265 errors" 2014-06-27 21:41:33 +00:00
Dean Troyer
1fca946890 Rename token classes to match command
The token create/delete commands were renamed but not the class names.
Rename them to match.

Change-Id: Icbf9c0a954ed0332fa4c99e4ee2612bb11f89e3a
2014-06-27 09:14:58 -05:00
Dean Troyer
4914a8d107 Fix PEP8 E126 and E202 errors
Do both as they are all in the same set of files that required
major re-formatting.

Change-Id: I6e8a8ce19a55105124a33c0e2487fc4b4e06d252
2014-06-27 09:12:55 -05:00
Dean Troyer
11f3654f6e Fix PEP8 E265 errors
Change-Id: Ieb9a9af1da27d3935d1a4d3cfb61b0ccb03d099a
2014-06-27 09:12:55 -05:00
Dean Troyer
9dd3a5326c Complete Identity v3 list command filters
Complete the 'group list' and 'user list' filter options following
the refactor in https://review.openstack.org/69878

Change-Id: Ib4af417c56d4f7da4b88852f191af615cc7fa2ec
2014-06-19 13:00:02 -05:00
Jenkins
c6cc1d72d5 Merge "Refactor role list subcommand for identity v3 api" 2014-06-19 17:14:03 +00:00
Jenkins
1f2189d6de Merge "Add token delete command for identity v2" 2014-06-18 15:37:40 +00:00
Steve Martinelli
d5aaba9d82 Refactor oauth1 code for updates
The keystoneclient code for oauth1 support has changed.
As such, we should remove the delete, list and authenticate
functions, since they are not in keystoneclient.

Also, we must now pass in the project id when creating a
request token. Additionally we must now pass in roles
when authorizing a request token.

Added functional tests to ensure output and input args
are the same.

bp add-oauth-support
Change-Id: I559c18a73ad95a0c8b7a6a95f463b78334186f61
2014-06-14 17:21:17 -04:00
Jenkins
99e7660d56 Merge "Add support for extension list" 2014-06-14 06:25:38 +00:00
Jenkins
497a38903c Merge "Add role assignments list support to identity v3" 2014-06-13 20:56:27 +00:00
Qiu Yu
f78a3f1653 Refactor role list subcommand for identity v3 api
Currently parts of user list and group list command are actually
functioning as role listing, which is quite counter intuitive and
misleading.

This refactor change move role related logic to a single place of role
list command. It now allows role grants listing for user/group +
domain/project combinations.

If no user or group specified, it will list all roles in the system,
which is the default behaviour.

Change-Id: I4ced6df4b76f018d01000d28b4281ad9f252ffcc
2014-06-13 15:20:42 -05:00
Matt Fischer
4ae4dc35bd Add support for extension list
- Add support in the common section for extension list. This only
   supports Identity for now. Once the APIs for volume and compute
   are supported in the respective APIs, they will be added. Once
   network is added to this client, it will be added (the API already
   supports it).
 - Include extension fakes for volume and compute for pre-enablement.

Change-Id: Iebb0156a779887d2ab06488a2a27b70b56369376
Closes-Bug: #1319115
2014-06-11 13:40:30 -06:00
henriquetruta
58f80e4c75 Add role assignments list support to identity v3
The assignments manager and its test class were created.
Some fake stubs were also added on the fakes.py module.

The "openstack role assignment list" command was created.

Change-Id: Iae94f4fee608ea3e09ff38961ad22edc38efb89c
Implements: blueprint roles-assignment-list
Closes-Bug: 1246310
2014-05-30 15:55:24 -03:00
Terry Howe
d6321c0893 Add token delete command for identity v2
Identity v2 has undocumented support for token delete and
keystoneclient also has support.

Change-Id: Ib98d17958ceb88f7b63471691dee71fdb884ce2e
Closes-Bug: #1318442
2014-05-23 10:17:42 -06:00
Matt Fischer
dc44ec1ddf Add tests for identity endpoints
Change-Id: If15cc74fafbbe52fa86aa353f2598aa31daf0695
Closes-Bug: #1319450
2014-05-15 12:20:30 -04:00
Jenkins
a93851d6af Merge "Implement CRUD operations for Identity Providers" 2014-05-09 21:38:20 +00:00
Marek Denis
ef9496a4fc Implement CRUD operations for Identity Providers
Operations for:
    * adding Identity Provider
    * listing Identity Providers
    * showing Identity Provider
    * updating Identity Provider
    * deleting Identity Provider

Change-Id: I4557168309f93e4670116b5c3c0e29252ff0c40f
Implements: bp/add-openstackclient-federation-crud
2014-04-24 14:55:54 +02:00
Jenkins
845f6705bf Merge "Fix the project option to user list so it filters" 2014-04-23 23:11:48 +00:00
Jamie Lennox
022b6d95d1 Pass arguments to v3 keystoneclient by kwarg
Keystoneclient has added the positional decorator which emits a warning
if arguments aren't passed by keyword. This means we are getting
warnings in certain places in openstackclient.

Change-Id: Ic5446cd6f122cbb56fce543011386d53bc31fe18
Closes-Bug: #1302199
2014-04-04 08:09:43 +10:00
Terry Howe
e72072adc3 Fix the project option to user list so it filters
The --project option to the user list command was not implemented
* Allow users to be filted by project
* Support id or name of project with the find_resource command
* Make sure the report does not contain duplicates

Change-Id: Ic0e10cccd7749d38a7d4b80bbdc68e61a660084b
Closes-Bug: #1177255
2014-04-01 09:03:45 -06:00
Steven Hardy
0c0803d363 identity v3 allow project list filtering by domain
The underlying keystoneclient interface allows filtering by domain,
so support it in the cli interface because it makes project list
much nicer to use in a multi-domain deployment.

Change-Id: If3f5cf1205c1e9cf314f8286a3ae81bda4456b8f
Closes-Bug: #1289513
2014-03-13 09:32:21 +00:00
Terry Howe
70e6333e7d Add ability to set key value pairs in projects
Add supporto of extra key value pairs for projects (aka tenants)
* Added option --property key=value to create and set commands
* Support for versions v2 and v3

Change-Id: I84064b8b308579d1b66c83b1ed3d1a37614ec087
Closes-Bug: #1220280
2014-03-06 14:22:17 -07:00
Terry Howe
033f27fe4d Add ability to prompt for passwords for user create and set
* Add get_password method to the utilities
* Add --password-prompt option
* Call the get_password method if a prompt is requested
* Various tests

Change-Id: I1786ad531e2a2fbcc21b8bc86aac0ccd7985995a
Closes-Bug: 1100116
2014-02-21 14:42:22 -07:00
Qiu Yu
a8d828f330 Add token create subcommand for identity v3 api
Implements token create subcommand which is an equivalent of keystone
token-get command. Original "wrap" parameter for keystone token-get is
not implemented yet due to cliff Bug #1269299

This is a part of: blueprint add-identity-token-support

Change-Id: I2255021c9d1f10f757686583b1ebe40b5f3a9ecb
2014-01-29 15:59:12 +08:00
Jenkins
cb2fd0af83 Merge "Remove copyright from empty files" 2014-01-23 17:38:15 +00:00
Alexander Ignatov
ad4367839f Remove copyright from empty files
According to policy change in HACKING:
http://docs.openstack.org/developer/hacking/#openstack-licensing
empty files should no longer contain copyright notices.

Change-Id: Iba09a00f24dfbd1cd03c1c9f70ea216788e64d93
Closes-Bug: #1262424
2014-01-20 17:28:13 +04:00
Qiu Yu
4848d3ca3a Add token create subcommand for identity v2 api
Implements token create subcommand which is an equivalent of keystone
token-get command. Original "wrap" parameter for keystone token-get is
not implemented yet due to cliff Bug #1269299

This is a part of: blueprint add-identity-token-support

Change-Id: I9e4de93306f2f5959717b5219621da03961524d8
2014-01-17 17:42:01 +08:00
Dean Troyer
6460f1eb35 Complete basic test infrastructure
This finally gets all of the API tests into a common framework regarding
test classes and so forth.

Change-Id: If675347129c50dcba0bfc5b6c58f5a2ca57ff46c
2013-11-18 22:11:10 -06:00
Dean Troyer
8898e020fb Identity v3 tests
* Add project, user, role and service v3 tests
* Fix issues in commands with enable/disable
* Make commands and tests more consistent between versions
* Make formatting and comments more consistent

Change-Id: Id21e7a5abd7e421a7742f937861ec46b53095fc7
2013-09-09 14:58:28 -05:00
Dean Troyer
7a0a7d67ed Prepare for Identity v3 tests
* Split identity/fakes.py for v2_0 and v3
* Split identity/test_identity.py for v2_0 and v3
* Fix issues in commands with enable/disable
* Clean up v2 commands

Change-Id: I6e536b6a130fc556dbd7dcf9f2e76d939ca1bc1c
2013-09-09 14:52:50 -05:00
Dean Troyer
44c97cc099 Add Identity v2 role and service tests
* 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
2013-09-04 21:37:45 +00:00
Dean Troyer
eb405a88c4 Refactor fake data for projects and users
* Move fake data structures into tests/identity/fakes.py
* Use fake clients correctly and support multiple client versions

Change-Id: Icacbb2ca740b63937bd2c4442af61b620638b53e
2013-09-04 14:48:24 -05:00
Dean Troyer
22a6e8891e Add Identity v2 user tests
* implement Identity command tests for v2 user

Also re-work the user create and set commands for exclusive options
(--enable|--disable) to actually behave properly.  Yay tests!

Change-Id: Ie1ec2569b3d85a9d556ee70f2e8f69fd2a3c03c8
2013-08-19 15:26:51 -05:00
Dean Troyer
493339d4da Add Identity v2 project tests
* establish the the form of cliff command classes
* implement some common fake objects
* implement Identity command tests for v2 project
* fix stdout/stderr capture

Also re-work the project create and set commands for exclusive options
(--enable|--disable) to actually behave properly.  Yay tests!

Change-Id: Icbb313db544c1f8dd3c9af7709971838b5a4d115
2013-08-16 14:35:46 -05:00
Monty Taylor
196daf859b Move tests into project package.
There are several reasons for this. One is that the majority of
OpenStack packages behave this way. The second is that it makes writing
software that extends something easier to test (which is a clear usecase
for openstackclient) And third, tests/__init__.py implies a global
package named "tests" - which I'm pretty sure we're not providing.

Change-Id: Ic708ffd92aea78c2ffc1a8579af0587af4fca4ff
2013-06-30 23:30:54 -04:00