54 Commits

Author SHA1 Message Date
Brant Knudson
b5a5af1c3b Add OS-SIMPLE-CERT support for v3.
There was no API support for the OS-SIMPLE-CERT v3 extension.

bp auth-token-use-client

Change-Id: Ic3d36018fc2e5a5a0da8d37a7fa58b77b8fa8e15
2015-03-05 19:34:44 -06:00
Brant Knudson
86ac254fee Change oslo.serialization to oslo_serialization
The oslo libraries are moving away from namespace packages.

bp drop-namespace-packages

Change-Id: I76dc9f733b222144f0274f8854877587c3501d1e
2015-01-31 08:03:37 -06:00
Jamie Lennox
b0e68b06b3 Make keystoneclient use an adapter
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
2014-11-21 08:03:23 +10:00
Jenkins
2e900a9347 Merge "Cleanup docs - raises class" 2014-11-18 19:18:13 +00:00
Brant Knudson
fece74ca3e I18n
Keystoneclient didn't provide translated messages. With this
change, the messages are marked for translation.

DocImpact

Implements: blueprint keystoneclient-i18n

Change-Id: I85263a71671a1dffed524185266e6bb7ae559630
2014-10-28 20:33:19 +00:00
Brant Knudson
14a6d80116 Cleanup docs - raises class
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
2014-10-18 17:59:08 -05:00
Steve Martinelli
802301ca17 Use oslo.utils and oslo.serialization
Left timeutils and strutils in openstack/common since they are used in
openstack/common/apiclient and memorycache.

Change-Id: Idb5f09c159d907dfba84cd1f7501f650318af7d9
2014-10-15 04:25:50 +00:00
Henry Nash
98b240fe50 Add support for endpoint policy.
This adds the client library class for the endpoint policy extension.

Implements: bp endpoint-policy
Change-Id: I7153d7a093f4299d7f912b0b4a9a02ffacdb9e69
2014-09-18 22:27:15 +01:00
wanghong
18ceee9696 move attributes of v3.client.Client into alphabetical order
Just make self.users be consistent with the other assignments.

Change-Id: Ib3053774e9dd905eb4ef50668d6638ce19750177
2014-08-07 09:48:28 +08:00
wanghong
07d45effef expose the revoke token for V3
Implement the v3 revoke token method for CLI.

Change-Id: Ib01f6341e087866ca05862c200e6c783fb1a8ff5
Closes-Bug: #1331972
2014-08-06 09:43:56 +08:00
Brant Knudson
d8408f6250 Docstrings for usability.
The keystoneclient docstrings should give guidance for an
application developer to actually use the library. Here's a start.

Partial-Bug: #1330769
Change-Id: I1a9434704d0cd6b58de76933ff78c8d5c0aa3e3b
2014-07-12 01:06:50 +02:00
Jamie Lennox
320fa59f13 Remove _factory methods from auth plugins
This was a simple factory that would give compatibility for the existing
client to load up the appropriate auth plugin. A more robust plugin
loading mechanism is coming for this and having it available encourages
other auth plugins that they should be using that where they shouldn't.

Just remove it from the auth plugin class. It shouldn't be used by
anyone else so lets keep it on the client objects.

Blueprint: plugin-params
Change-Id: I0618b646f302300d41c7dd7153a1c0bdc237a745
2014-06-09 23:43:16 +00:00
Rodrigo Duarte Sousa
bb6c144a4a Fix attributes ordering at v3/client.py
Fix attributes alphabetical ordering at
v3/client.py.

Change-Id: I1ca71a56a6a710b231a8ed770835d45d3cf01cda
2014-05-28 06:30:19 -03:00
Rodrigo Duarte Sousa
0b0d2d3a9a Add /role_assignments endpoint support
This patch adds role assignments list support
to keystoneclient.

Created RoleAssignment resource and RoleAssignmentManager
classes. RoleAssignmentManager only implements the list()
method, the other inherited methods from base.CrudManager
raises a MethodNotImplemented error with customized messages.

This bp is complimented with the OSC part:
https://blueprints.launchpad.net/python-openstackclient/+spec/roles-assignment-list

Change-Id: I164b58b67ff42320238e943ddfa9d0a8aadd0a6d
Implements: blueprint roles-assignment-support
Closes-Bug: #1246310
2014-05-27 14:08:50 +00:00
Jenkins
a95edc7f38 Merge "Regions Management" 2014-05-08 02:54:10 +00:00
Steve Martinelli
205cd521a7 OAuth request/access token and consumer support for oauth client API
Add support for creating request and access tokens,
and to authorize request tokens. Also adding basic CRUD for
consumer entities.

DocImpact
Change-Id: Ib9d0b223f202a7e33cbad1602da5be7479cd3284
implements: bp add-oauth-support
2014-05-07 20:02:27 +00:00
Adam Young
51ed045a28 Regions Management
Client code for v3 API regions implementation.

Change-Id: I5c1526457395ba3fb06977bea775ff572ec840ba
Closes-Bug: 1289519
2014-05-07 14:48:25 -04:00
guang-yee
eff1960daf Implement endpoint filtering functionality on the client side.
bp/endpoint-filtering

Change-Id: I48cb8dbd2720bb0c5777712b68a8a5b8f3bf7f60
2014-04-15 18:00:16 -07:00
Marek Denis
49f74fd84d Add CRUD operations for Identity Providers.
Add relevant methods for adding, updating, listing, getting, and deleting
Identity Provider objects.

Change-Id: Ib77781b507d2c06c368a1877eb716ec7fe2d88e4
Implements: blueprint federation-crud-operations
2014-04-09 20:50:53 +02:00
Jenkins
2e092ffef7 Merge "Adds to Keystone to convert V2 endpoints to V3" 2014-03-26 18:24:12 +00:00
root
af29801150 Adds to Keystone to convert V2 endpoints to V3
The Domain Quota Management Driver uses the V3 Authentication Token.
Also, it tries to contact Keystone for getting list of projects in a
domain using V3 API like /v3/projects?domain_id=<id>. But the
keystone v3/client.py default uses V2 API and hence code changed
to convert V2 endpoints for V3 endpoints. This change is required
to implement blue print domain-quota-driver-api

Change-Id: If62ffc5e5252477bbe4d80f14c0a7653e11d5403
Closes-Bug: 1260916
2014-03-26 10:46:46 -05:00
Jamie Lennox
b07fbb91c6 Handle URLs via the session and auth_plugins
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
2014-03-25 12:32:23 -05:00
Joe Gordon
242ffeb19a Revert "Add request/access token and consumer..."
This reverts commit 2e7bdb872e9660178451f71b35976a980f047300.

This commit I9137e3426c82c73855ae0e50317cfd6477195318 is the second
patch that broke stable/havana by introducing a dependency on oauthlib,
but oauthlib isn't in the stable/havana branch of global dependencies
(fix in progress Ib2e2aa2e75e7b7b43e0534eeb62e748d1edc0bc3). And we use
trunk clients in stable/havana gate jobs. So this patch broke both heat
and horizon, both of which import this file to support keystone's v3 API.

This is the final patch in reverting bp add-oauth-support.

Commit subject was (but exceeds maximum pep8 subject length):
Revert "Add request/access token and consumer support for keystoneclient"

Fixes-Bug: #1292797

Change-Id: Ib45fb39b01ddcf5c8fc0179811efded84c0cb908
2014-03-15 02:41:25 -07:00
Steve Martinelli
2e7bdb872e Add request/access token and consumer support for keystoneclient
Add support for creating request and access tokens,
and to authorize request tokens. Also adding basic CRUD for
consumer entities.

implements: bp add-oauth-support

Change-Id: I9137e3426c82c73855ae0e50317cfd6477195318
2014-03-12 16:22:44 -05:00
Jamie Lennox
0267c98f56 Privatize auth construction parameters
Privatize some of the automatic auth plugin construction work. At some
point we are going to need to have this pluggable and i'm not sure the
current methods will suffice. It's better to keep this private until we
are sure rather than be stuck with a public API.

Change-Id: I2a10a9b28bef6c094b1330a0524f1c516f5103fd
Closes-Bug: #1287488
2014-03-04 12:40:21 +10:00
Jamie Lennox
7f1881211d Create V3 Auth Plugins
Extract the authentication code from a v3 client and move it to a series
of auth plugins. As v3 authentication can contain multiple
authentication methods this concept is represented by an AuthMethod. An
auth plugin then is provided with multiple mechanisms to authenticate
with.

There is also some helper class for the standard case where you only
need to authenticate with one method.

When a v3 client wants to do authentication it will create a new v3 auth
plugin, do the authentication and then take that result for the client
to use.

Change-Id: I5fa6a6e1c2e114e1428e35b723700c63a3cbed44
blueprint: auth-plugins
2014-02-21 14:25:45 +10:00
Jenkins
7439c45e46 Merge "Adjust import items according to hacking import rule" 2014-01-30 11:11:31 +00:00
Jamie Lennox
06d93cb0d8 Respect region name when processing domain URL
When deprecating the use of management_url from service_catalog we
updated the management_url setter for the project scoped token, however
we missed the domain scoped token case.

There is actually nothing we can do here to test this scenario as the
backwards compatibility code that was installed handles this for us and
there is no problem, however we should not be internally relying on
deprecated code.

Change-Id: I59bac4d9d74f2eb8bc6edd40518c7cd5a4fe1343
2014-01-21 12:04:45 +10:00
Eric Guo
252b6e423d Adjust import items according to hacking import rule
This patch adjust import items and add missing blank lines acording
to http://docs.openstack.org/developer/hacking/#imports
{{stdlib imports in human alphabetical order}}
\n
{{third-party lib imports in human alphabetical order}}
\n
{{project imports in human alphabetical order}}
\n
\n
{{begin your code}}

hacking project also enforce some checks for import group.
Let make the change in keytoneclient

Change-Id: Ic83bd5ee426905588f4a2d555851a9a01fc69f02
2014-01-17 23:21:38 +08:00
Jamie Lennox
8442be96f0 Fix missed management_url setter in v3 client
Setting management_url is intended to mean that this is an overriding
URL not one received from the service catalog. This was fixed for
project scoped tokens but was missed from domain scoped tokens.

Change-Id: I8484f4a26a5695ef7ae962918ad442fe20bd2caa
Related Change: I2fa41e2ae1b853bbb254698cf94b9314eb0f0903
Related-Bug: #1252927
2013-12-20 11:14:36 +10:00
Jenkins
581265448c Merge "Properly handle Regions in keystoneclient" 2013-12-11 03:57:36 +00:00
Jamie Lennox
d4c06d3035 Properly handle Regions in keystoneclient
Region name is taken as a parameter but is ignored in all communication
with the service catalog. Currently region can be stored in the token
data and then requests to url functions will return the appropriate
region. This is the wrong approach because there is nothing specific to
the token (or auth_data) that is region specific. Instead region
information should be held by the client.

Closes-Bug: 1147530
Closes-Bug: 1255992
Change-Id: I812aa89c8b4af28e294e63926a7f88e8246fffc5
2013-12-04 06:57:32 -06:00
Jamie Lennox
fd0a176a49 Discover supported APIs
Allow discovery of the API versions a server supports and create an
appropriate client based on this.

Implements: blueprint api-version-discovery
Change-Id: I63e6759889066a784dc47e35152c82e1ead7951d
2013-12-03 12:00:03 +10:00
Jenkins
789f40d21e Merge "Use OSLO jsonutils instead of json module" 2013-08-30 02:24:42 +00:00
Jamie Lennox
6da9262b03 Use OSLO jsonutils instead of json module
For most things there is very little difference, but as we have a
jsonutils module we should probably be using it.

Change-Id: I406ea81bb56ad90cc9ff9b8b58b0d35b694dc802
2013-08-26 10:18:11 +10:00
Steven Hardy
735dc8ffb5 clearer error when authenticate called without auth_url
Fixes bug #1212729

Change-Id: Icd55b77fcd58db182e5c0fe0c230e7fc9d8a57ff
2013-08-23 13:43:02 +01:00
Steven Hardy
2c5ac69c8a Initial Trusts support
Implements client support for the basic trusts API operations,
note this does not include support for the roles subpath operations,
support for those can be added in a subsequent patch.

Change-Id: I0c6ba12bad5cc8f3f10697d2a3dcf4f3be8c7ece
blueprint: delegation-impersonation-support
2013-08-20 23:16:46 +01:00
Jamie Lennox
b7c6f604e7 Rename client.py to httpclient.py
The discoverable entry point is to be client.Client however adding this
functionality to the current client.py is impossible as we end up with
circular dependencies.

This patch simply renames the current client.py to httpclient.py to make
future patches that will modify client.py more readable.

Required for: blueprint api-version-discovery

Change-Id: Ibcea03f6e1df0ae05329297166a8b8117fc3ce7b
2013-08-10 17:30:09 +10:00
Dolph Mathews
e2ffd5317b flake8: fix alphabetical imports and enable H306
Change-Id: I0f4fcc9796e8529e7217dc24abe95660633cad33
2013-08-01 17:09:55 -05:00
Jamie Lennox
f2b4e91410 Client V3 shouldn't inherit V2
Client V3 is a completely different implementation of the API, if we
want to intermix the V2 and V3 APIs then we don't need to version our
client at all.

Change-Id: I80579cd41df73ccfc6c8feb76843772829afac4e
2013-07-23 17:44:54 +10:00
Dirk Mueller
fe8f9023ac Fix and enable H401
Remove leading spaces from doc comments.

Change-Id: I75b055c0d64dda478c63839d44158e301900107f
2013-06-27 01:28:30 +02:00
lin-hua-cheng
2239c3b27c Implements v3 auth client.
Added support for domain scoping.

Enhancement on AccessInfo to support reading v2/v3 token information.

Enhancement on ServiceCatalog for reading/filtering v2/v3 service
catalog information.

Change-Id: Ibb678b9933d3673e37d0fba857a152a3c5d2b4f4
2013-06-20 23:28:31 -07:00
Dolph Mathews
6f27af4a0c Fix unused imports(flake8 F401, F999)
- F401: imported but unused
- F999: syntax error in doctest

Fixing a couple of the F401's simply required fixing the doctests syntax
where the imports were actually in use.

Change-Id: If78abbb143daf8d005a71c5ab52836df29c5e0cd
2013-06-03 13:05:12 +00:00
Wu Wenxiang
aaf3aa977f modify mistake in comment
init should be v3.0 rather than 2.0 in keystoneclient/v3/client.py

Change-Id: I54bcbaed38edcc9c0fb0a0138c1ee38492fd933d
2013-04-17 10:50:53 -07:00
Henry Nash
d37a3fb06c Add support for user groups
This initial change provides the support in keystoneclient to match the api
specified in the blueprint.  Keystone itself does not yet support these
calls, so if you actually called these, then you would get an error from
the server. However the changes should be benign in terms of other api calls.

Blueprint keystone/+spec/user-groups
Api changes: review.openstack.org/#/c/18138

DocImpact

Change-Id: I9abfa82b39fa0c6d58fe0d22622944d3e6be39be
2012-12-21 18:28:02 +00:00
Dolph Mathews
6c84d7bf85 v3 Credential CRUD
Change-Id: I646ff7db3ccf827f912ebdb78fdf8d765d52c26c
2012-10-09 22:57:35 +00:00
Dolph Mathews
298b1c4903 v3 User CRUD
Change-Id: Ieea3c474ce3795e2c97e399988228cdb2715f2ef
2012-10-08 23:06:36 +00:00
Dolph Mathews
577c78c991 v3 Project CRUD
Change-Id: I027dbba3a0573fde590295be5b31e3701d8c01f5
2012-10-08 23:04:09 +00:00
Dolph Mathews
f885c0d09a v3 Role CRUD
Change-Id: Iacb6e56ef60537b7cd3a4fbe3db1f0db1604fdc2
2012-10-08 23:02:30 +00:00
Dolph Mathews
ac3beb3671 v3 Domain CRUD
Change-Id: I830055dc3bd079715403029a85890c40b687f632
2012-10-08 22:59:54 +00:00