Go to file
2011-04-20 21:07:49 +05:30
2011-04-18 19:26:30 +05:30
2011-04-19 18:50:22 -05:00
2011-04-19 18:50:22 -05:00
2011-04-20 21:07:49 +05:30

Description


Dependencies:
* Install SQLite3

Setup:
Install http://pypi.python.org/pypi/setuptools
sudo easy_install Paste
sudo easy_install PasteDeploy
sudo easy_install PasteScript
sudo easy_install simplejson
sudo easy_install eventlet
sudo easy_install webob


Tables:
CREATE TABLE groups (group_id varchar(255),tenant_id varchar(255),group_desc varchar(255));
CREATE TABLE tenants(tenant_id INTEGER, tenant_desc varchar(255), tenant_enabled INTEGER, PRIMARY KEY(tenant_id ASC));
CREATE TABLE token (token_id varchar(255),expires datetime);
CREATE TABLE users(username varchar(255), password varchar(255));


Run:
python setup.py build
sudo python setup.py install
paster serve keystone/keystone.ini
paster serve echo/echo/echo.ini


Issues:


Demo:
Start server:
python identity.py

Add Tenant:
curl -i -X POST -H "Content-Type: application/json" -d '{"tenant": { "id": "123456", "description": "A description ...", "enabled": true } }' http://localhost:8080/tenants

Get token:
curl -i -X POST -H "Content-Type: application/json" -d '{"username": "john", "password": "secret" }' http://localhost:8080/tokens
curl -i -X POST -H "Content-Type: application/json" -d '{"username":"jack", "password": "secret","tenant_id":"1" }'http://localhost:8080/tokens

Add User:(Test Function)
curl -i -X POST -H "Content-Type: application/json" -d '{"username": "john", "password": "secret" }' http://localhost:8080/users


Validate good token:
curl -i -X GET -H "Content-Type: application/json"  http://localhost:8080/token/abcdefghijklmnopqrstuvwxy

Validate bad token:
curl -i -X GET -H "Content-Type: application/json"  http://localhost:8080/token/abcdefghijklmnopqrstuvbad


Update Tenant
 curl -i -X PUT -H "Content-Type: application/json" -d '{"tenant": { "description": "A new description update ..." } }' http://localhost:8080/tenants/1234

Get Tenant
 curl -i -X GET -H "Content-Type: application/json" -d '{}' http://localhost:8080/tenants/1234

Get Tenants
 curl -i -X GET -H "Content-Type: application/json" -d '{}' http://localhost:8080/tenants


Delete Tenant
 curl -i -X DELETE -H "Content-Type: application/json" -d '{}' http://localhost:8080/tenants/1234

Create Tenant group:
curl -i -X POST -H "Content-Type: application/json" -d '{"group": { "id": "admin","description":"Administrator" } }' http://localhost:8080/v1.0/tenant/1/groups
Get tenant groups:
curl -i -X GET -H "Content-Type: application/json"  http://localhost:8080/v1.0/tenant/:tenantId/groups

GET TENANT GROUP:
curl -i -X GET -H "Content-Type: application/json"  http://localhost:8080/v1.0/tenant/:tenantId/groups/:groupId

GET GROUP USERS:
v1.0/tenants/groups/:groupId/users', method='GET'
curl -i -X GET -H "Content-Type: application/json"  http://localhost:8080/v1.0/tenants/groups/:groupId/users

ADD USER TO TENANT  group:

curl -i -X PUT -H "Content-Type: application/json" -d '{"username": "john" }' http://localhost:8080/tenants/123456/groups/user/users

DELETE USER FROM  TENANT GROUP:
curl -i -X DELETE -H "Content-Type: application/json" -d '{"username": "john" }' http://localhost:8080/tenants/123456/groups/user/users


Create a user:
 curl -i -X POST -H "Content-Type: application/json" -d '{"user": {"username": "jacky", "password": "secret","email":"jacky@example.com","enabled": true } }' http://localhost:8080/tenants/111/users


Echo:
Start server with PAPI-Auth Middleware:
paster serve echo.ini --reload

 Validate Token:
 curl -i -X GET -H "Content-Type: application/json" -H "X-Auth-Token: fad94013a5b3b836dbc18" -d '{"test": "something"}' http://127.0.0.1:8090/


Using SOAPUI:

Download SOAPUI: http://sourceforge.net/projects/soapui/files/
To Test Identity Service:
   File->New soapUI Project:
   ProjectName: KeyStone
   Initial WSDL/WADL: keystone/identity.wadl
   [OK]

   Select Request, set parameters, select "Accept"
   SOAP UI works best with XML, it will fill in most parameters for
   in that case.  For JSON, SOAPUI will still help you fill in
   parameters and headers, but that's it.

To Test Echo Service:
   File->New soapUI Project:
   ProjectName: Echo
   Initial WSL/WADL: echo/echo.wadl
Description
RETIRED, further work has moved to Debian project infrastructure
Readme 27 MiB