From 49dee35b10643d89e30cd20b9a5243c2fed112c5 Mon Sep 17 00:00:00 2001 From: Ziad Sawalha Date: Fri, 15 Apr 2011 02:35:16 -0500 Subject: Updates to identity.py and README --- README | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'README') diff --git a/README b/README index 30a219e6..536ad2df 100644 --- a/README +++ b/README @@ -3,3 +3,35 @@ Description Dependencies: * Install SQLite3 + +Setup: +Install http://pypi.python.org/pypi/setuptools +sudo easy_install PasteDeploy +sudo easy_install simplejson +sudo easy_install -U bottle + +Tables: +CREATE TABLE tenants(tenant_id INTEGER, tenant_desc varchar(255), tenant_enabled INTEGER, PRIMARY KEY(tenant_id ASC)); + +Issues: +bottle not in path on Mac OS X (added exception handling to default path) + +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 + +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 + + + + -- cgit