Commit 7d456f98 authored by Jérome Perrin's avatar Jérome Perrin

access_token: rename token scripts

As script return user_ids it's more logical to name them *_getUserId
parent 3f70e6bf
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccessToken_getExternalLogin</string> </value>
<value> <string>AccessToken_getUserId</string> </value>
  • The intent of foo.Person_getUserId() was to be a backward compatible way of doing foo.getUserId() when the code does not know whether the new PAS ERP5Login plugin is enabled.

    If we use the same naming scheme, I think it should be with a similar intent. Otherwise, wouldn't it be better to have a <some portal type>_getUserValue and let PAS plugin call getUserId on it ?

  • Yes, thanks, I thought a bit about this naming conflict but yes it's better to use another name. I like the getUserValue you are suggesting.

Please register or sign in to reply
</item>
</dictionary>
</pickle>
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>RestrictedAccessToken_getExternalLogin</string> </value>
<value> <string>OneTimeRestrictedAccessToken_getUserId</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -19,7 +19,7 @@ if access_token_document.getValidationState() == 'validated':
# use hmac.compare_digest and not string comparison to avoid timing attacks
if not hmac.compare_digest(access_token_document.getReference(), reference):
return None
agent_document = access_token_document.getAgentValue()
if agent_document is not None:
result = agent_document.Person_getUserId()
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OneTimeRestrictedAccessToken_getExternalLogin</string> </value>
<value> <string>RestrictedAccessToken_getUserId</string> </value>
</item>
</dictionary>
</pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment