handle the case where a provider doees not provide a Full Name#7
handle the case where a provider doees not provide a Full Name#7dkg wants to merge 1 commit intotrac-hacks:masterfrom
Conversation
Without this patch, when an OpenID provider declines to provide a full name, trac crashes by accessing the authname variable before it was initialized. If no full name is provided, fall back to the OpenID URL as the user's identity.
|
Thanks for the report and fix. I've made a couple of comments/questions inline with your patch (see above.) Do they seem sane? |
|
if remote_user is somehow not a string or evaluates to false, i think you'll want those checks. |
|
hm, maybe you can ditch the first check and use: if type(b) == str and self.lowercase_authname: instead (as the lower check) |
|
My concern is that If a check for an empty or non-string |
|
I don't think there's any sense in computing the authname if allowed is false, so i wouldn't move it outside of the "if allowed" check. And i agree that the plugin should do something more like bailing out cleanly if authname ends up not being a string. |
This, I think, fixes the issue raised in pull request #7.
|
Okay, I think I’ve cleaned up the If you have no major complaints I'll make a PyPI release. |
|
On 05/21/2013 07:28 PM, dairiki wrote:
thanks! I've just tested and it seems to work for me.
that would be great, thanks! please let me know when you've done that Regards, |
|
Done. This is on PyPI as TracAuthOpenId==0.4.3. Thanks for the kick to get this done! |
Without this patch, when an OpenID provider declines to provide a full
name, trac crashes by accessing the authname variable before it was
initialized.
If no full name is provided, fall back to the OpenID URL as the user's
identity.