summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-09-08 07:27:09 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-09-08 07:27:09 +0000
commit5a7306e0e7873abb952cf38ef4f6bb93d5e6409a (patch)
treeca1ec32f1153cd7d06c2859255d1233155635e75
parentfdc2b81893d01dd50de436c4238cc5d8c657a74a (diff)
Add support nickname property to WSGI / GAE integration code.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@993642 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-cpp/trunk/modules/wsgi/scdl.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sca-cpp/trunk/modules/wsgi/scdl.py b/sca-cpp/trunk/modules/wsgi/scdl.py
index 309f7f91f8..6b22e92823 100644
--- a/sca-cpp/trunk/modules/wsgi/scdl.py
+++ b/sca-cpp/trunk/modules/wsgi/scdl.py
@@ -194,6 +194,8 @@ def evalProperty(p):
return lambda: hostProperty(cadr(p), environ)
if car(p) == "user":
return lambda: userProperty(cadr(p))
+ if car(p) == "nickname":
+ return lambda: nicknameProperty(cadr(p))
if car(p) == "email":
return lambda: emailProperty(cadr(p))
return lambda: cadr(p)
@@ -207,7 +209,11 @@ def currentUser():
def userProperty(v):
user = currentUser()
- return user.user_id() if user else v
+ return user.federated_identity() if user else v
+
+def nicknameProperty(v):
+ user = currentUser()
+ return user.nickname() if user else v
def hostProperty(v, e):
return e.get("HTTP_HOST", e.get("SERVER_NAME", v)).split(":")[0]