Ok, it's late, so please go easy on me.

I've been looking into the IAuthenticator[1][2] interface.  It's used to
"authenticate" the user.  Basically it checks if the REMOTE_USER env
variable is set or if the trac_auth cookie is set.  Not horribly
complicated.  Now, I'm working on merging the account manager plugin
into core[3] (most everything except registration and email verification)

As I'm digging into this, I'm questioning the way in which we use the
IAuthenticate interface.

First, AFAICT, we're only calling the authenticate() method on perm
requests and requests for the authname (req.perm and req.authname).
This seems kind of stupid to me.  Seems to me that we should be calling
authenticate once for each request.

Fortunately, due to the lazy evaluation code of the request[4], we
aren't constantly calling the authenticate() function.  However, we
generally make the call twice for every request (once for use of
req.authname[5], once for use of req.perm[6]).

Seems to me that it's better to simply call the authenticate method
explicitly at the beginning of every request and simply set req.authname.

Does anyone know why we're not doing so?  Is there some code path or
reason that I'm not seeing?  Again, I admit that it's a bit late, so if
anyone can help enlighten me I would be very grateful.

-John


[1] http://trac.edgewall.org/browser/trunk/trac/web/api.py#L570
[2] http://trac.edgewall.org/browser/trunk/trac/web/main.py#L135
[3] http://trac.edgewall.org/browser/sandbox/accountmanager -- note, I
haven't made a commit yet
[4] http://trac.edgewall.org/browser/trunk/trac/web/api.py#L194
[5] http://trac.edgewall.org/browser/trunk/trac/web/main.py#L155
[6] http://trac.edgewall.org/browser/trunk/trac/web/main.py#L276

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to