Support POST /tokens only - issue #5

This commit is contained in:
Ziad Sawalha 2011-06-01 05:06:51 -05:00
parent 4891277fcb
commit df49b1dd71
5 changed files with 14 additions and 10 deletions

View File

@ -199,7 +199,7 @@ in troubleshooting:
# Get a token for a tenant
$ curl -d '{"passwordCredentials": {"username": "joeuser", "password": "secrete", "tenant": "1234"}}' -H "Content-type: application/json" http://localhost:8081/v2.0/tokens
$ curl -d '{"passwordCredentials": {"username": "joeuser", "password": "secrete", "tenantId": "1234"}}' -H "Content-type: application/json" http://localhost:8081/v2.0/tokens
</pre>
#### Load Testing
@ -207,7 +207,7 @@ in troubleshooting:
<pre>
# Create post data
$ echo '{"passwordCredentials": {"username": "joeuser", "password": "secrete", "tenant": "1234"}}' > post_data
$ echo '{"passwordCredentials": {"username": "joeuser", "password": "secrete", "tenantId": "1234"}}' > post_data
# Call Apache Bench
@ -230,6 +230,10 @@ Initial support for using keystone as nova's identity component has been started
Assuming you added the test data using bin/sampledata.sh, you can then use joeuser/secrete
## SWIFT Integration
See swift-quick-start.txt in docs folder
## I want OpenStack (all of it)
To get an opinionated install of nova, keystone, dashboard and glance using openstack apis:

View File

@ -60,7 +60,7 @@
</copyright>
<releaseinfo>API v2.0</releaseinfo>
<productname>Keystone - OpenStack Identity</productname>
<pubdate>2011-05-27</pubdate>
<pubdate>2011-06-01</pubdate>
<legalnotice role="apache2">
<annotation>
<remark>Copyright details are filled in by the template.</remark>
@ -756,7 +756,7 @@ Host: identity.api.openstack.org/v1.1/
<tr>
<td colspan="1"> &GET; </td>
<td colspan="1">/tenants</td>
<td colspan="4">Get a list of tenants accessible with suplied token.</td>
<td colspan="4">Get a list of tenants accessible with supplied token.</td>
</tr>
</tbody>
</informaltable>
@ -865,7 +865,7 @@ Host: identity.api.openstack.org/v1.1/
<tbody>
<tr>
<td colspan="1"> &GET; </td>
<td colspan="4">/tokens</td>
<td colspan="4">/tokens/<parameter>tokenId</parameter></td>
<td colspan="3">Validate a token.</td>
</tr>
<tr>

View File

@ -711,6 +711,7 @@ def user_role_add(values):
def user_tenant_create(values):
#TODO(ZIAD): Update model / fix this
user_tenant_ref = models.UserTenantAssociation()
user_tenant_ref.update(values)
user_tenant_ref.save()

View File

@ -573,10 +573,8 @@ class KeystoneAPI(wsgi.Router):
# Token Operations
mapper.connect("/v2.0/tokens", controller=auth_controller,
action="authenticate")
mapper.connect("/v2.0/tokens/{token_id}", controller=auth_controller,
action="delete_token",
conditions=dict(method=["DELETE"]))
action="authenticate",
conditions=dict(method=["POST"]))
# Tenant Operations
tenant_controller = TenantController(options)
@ -639,7 +637,8 @@ class KeystoneAdminAPI(wsgi.Router):
# Token Operations
auth_controller = AuthController(options)
mapper.connect("/v2.0/tokens", controller=auth_controller,
action="authenticate")
action="authenticate",
conditions=dict(method=["POST"]))
mapper.connect("/v2.0/tokens/{token_id}", controller=auth_controller,
action="validate_token",
conditions=dict(method=["GET"]))