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
This commit is contained in:
parent
fdc2b81893
commit
5a7306e0e7
1 changed files with 7 additions and 1 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue