Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12592 closed enhancement (fixed)

Avoid disabling login/logout in slave projects

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: SharedCookieAuthPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description (last modified by Ryan J Ollos)

The Configuration directives state that LoginModule must be disabled in slave projects. This is also discussed in #5566. However, it would be ideal if we could prevent expiring the cookie, and thus avoid the need to disable the LoginModule in slave projects.

The proposed change will work-around the existing behavior. Ideally though, we could do a bit better by adding the feature to Trac, as an optional Component residing in tracopt.web.auth (trac:#12257).

Attachments (0)

Change History (10)

comment:1 Changed 8 years ago by Ryan J Ollos

Description: modified (diff)

comment:2 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 15075:

0.1.5dev: Prevent expiring the cookie

Fixes #12592.

comment:3 Changed 8 years ago by Ryan J Ollos

Owner: changed from agitronic to Ryan J Ollos

I'd be interested to know if anyone sees a better way to avoid expiring the cookie. I considered subclassing LogingModule, but felt that [15075] was a simpler solution.

Documentation modified in SharedCookieAuthPlugin@14.

comment:4 Changed 8 years ago by Ryan J Ollos

In 15076:

0.1.5dev: Refactor to use get_environments

This change was inspired by the similar feature implemented
in AccountManagerPlugin.

Refs #12592.

comment:5 Changed 8 years ago by Jun Omae

I don't look closely however I think use_cache=True argument should be used for open_environment(). In [15076], it seems Environment instance is created on every request and every Trac environment. That would be very slow.

comment:6 Changed 8 years ago by Ryan J Ollos

The list of RequestDispatcher objects is cached: sharedcookieauthplugin/trunk/sharedcookieauth/sharedcookieauth.py@15076:24,37-38#L23, so open_environment will only be called once for each environment.

comment:7 Changed 8 years ago by Ryan J Ollos

In 15085:

0.1.5dev: Simplify test for delegated auth

Fixed recursion error in [15076] due to delegating auth
to self.

Refs #12592.

comment:8 in reply to:  6 Changed 8 years ago by Jun Omae

Replying to rjollos:

The list of RequestDispatcher objects is cached: sharedcookieauthplugin/trunk/sharedcookieauth/sharedcookieauth.py@15076:24,37-38#L23, so open_environment will only be called once for each environment.

Okay. I consider there is another issue. The cached RequestDispatcher instances have Environment instance which has old configurations if trac.ini of the environment is changed. The Environment instances wouldn't be reloaded forever.

comment:9 Changed 8 years ago by Ryan J Ollos

Thanks for spotting the issue. The issue also exists in version 0.1.4, which I tagged before starting work. I created ticket #12596 to address the issue.

comment:10 Changed 8 years ago by Ryan J Ollos

In 15091:

0.1.5dev: Rename method added in [15075]

  • Document internal methods.

Refs #12592

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.