Re: Bio/Graphics/Browser2/UserDB.pm : possibleupdate ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Bio/Graphics/Browser2/UserDB.pm : possibleupdate ?

Keiran Raine
Hi Lincoln,

Would this explain why I'm having trouble getting PAM group level authentication to work?

Issue:
Mark datasource as 'restrict group xxx'.
Login as appropriate user.
Tracks intermittently don't render and logs show 'UNAUTHORIZED ATTEMPT'.

I'm working with an older version of the browser and was waiting to try in a newer release before reporting but as this is likely related thought I should mention it now.

Keiran

Sent from my Android phone using TouchDown (www.nitrodesk.com)


-----Original Message-----
From: Lincoln Stein [[hidden email]]
Received: Monday, 04 Mar 2013, 19:11
To: Frédéric Sapet [[hidden email]]
CC: [hidden email] [[hidden email]]
Subject: Re: [Gmod-gbrowse] Bio/Graphics/Browser2/UserDB.pm : possibleupdate ?


The db handle caching system must not be working correctly. I will fix it.

L

On Monday, March 4, 2013, Frédéric Sapet wrote:

> i have noticed that my sessions database was overwhelmed by connections.
>
> It's in a way the same problem I have noticed with LDAPAuthenticate.pm,
> the first connection is no saved, so each time you need data from the
> database, GGB will create a new one !
>
> This is related to a bug described in
> Bio/Graphics/Browser2/UserTracks/Database.pm
> # BUG: Two copies of UserDB; one here and one in the Render object
>
> I have done something, which is not maybe the best way to do this, but it
> does the trick.
>
> I've added a class variable in Bio/Graphics/Browser2/UserDB.pm :
>
> our $alreadyLoggedIn;
>
> and then the new method will become :
>
> sub new {
>   my $class   = shift;
>   my $globals = shift;
>
>   my $VERSION = '0.5';
>   my $credentials  = $globals->user_account_db
>       || "DBI:mysql:gbrowse_login;user=gbrowse;password=gbrowse";
>   my $login;
>   if (!defined $alreadyLoggedIn) {
>     $login = DBI->connect($credentials);
>     $alreadyLoggedIn = $login;
>   }
>   else {
>     $login = $alreadyLoggedIn;
>   }
>   unless ($login) {
>       confess "Could not open login database $credentials";
>   }
>
>   my $self = bless {
>       dbi      => $login,
>       globals  => $globals,
>       openid   => HAVE_OPENID,
>       register => HAVE_SMTP,
>   }, ref $class || $class;
>
>   return $self;
> }
>
> it avoids some connections to the database.
>
> By the way, I have a question about the $globals object. This is a
> Bio::Graphics::Browser2 object.  I have noticed that this object is not
> always the same through the different calls of
> Bio/Graphics/Browser2/UserDB.pm even when I work with the same datasource
> on the interface. I though that the same object should be reused ? (and so
> the class variable be more powerfull)
>
> thank you.
>
> Fred
>
>
--
Lincoln D. Stein
Director, Informatics and Biocomputing Platform
Ontario Institute for Cancer Research
101 College St., Suite 800
Toronto, ON, Canada M5G0A3
416 673-8514
Assistant: Renata Musa <[hidden email]>



--
 The Wellcome Trust Sanger Institute is operated by Genome Rese
arch
 Limited, a charity registered in England with number 1021457 and a

 company registered in England with number 2742969, whose registered
 
office is 215 Euston Road, London, NW1 2BE.



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: Bio/Graphics/Browser2/UserDB.pm : possibleupdate ?

Lincoln Stein
I will be reviewing the whole authentication/authorization system. Sounds like these are related bugs.

Lincoln


On Tue, Mar 5, 2013 at 3:10 AM, Keiran Raine <[hidden email]> wrote:
Hi Lincoln,

Would this explain why I'm having trouble getting PAM group level authentication to work?

Issue:
Mark datasource as 'restrict group xxx'.
Login as appropriate user.
Tracks intermittently don't render and logs show 'UNAUTHORIZED ATTEMPT'.

I'm working with an older version of the browser and was waiting to try in a newer release before reporting but as this is likely related thought I should mention it now.

Keiran

Sent from my Android phone using TouchDown (www.nitrodesk.com)


-----Original Message-----
From: Lincoln Stein [[hidden email]]
Received: Monday, 04 Mar 2013, 19:11
To: Frédéric Sapet [[hidden email]]
CC: [hidden email] [[hidden email]]
Subject: Re: [Gmod-gbrowse] Bio/Graphics/Browser2/UserDB.pm : possibleupdate ?


The db handle caching system must not be working correctly. I will fix it.

L

On Monday, March 4, 2013, Frédéric Sapet wrote:

> i have noticed that my sessions database was overwhelmed by connections.
>
> It's in a way the same problem I have noticed with LDAPAuthenticate.pm,
> the first connection is no saved, so each time you need data from the
> database, GGB will create a new one !
>
> This is related to a bug described in
> Bio/Graphics/Browser2/UserTracks/Database.pm
> # BUG: Two copies of UserDB; one here and one in the Render object
>
> I have done something, which is not maybe the best way to do this, but it
> does the trick.
>
> I've added a class variable in Bio/Graphics/Browser2/UserDB.pm :
>
> our $alreadyLoggedIn;
>
> and then the new method will become :
>
> sub new {
>   my $class   = shift;
>   my $globals = shift;
>
>   my $VERSION = '0.5';
>   my $credentials  = $globals->user_account_db
>       || "DBI:mysql:gbrowse_login;user=gbrowse;password=gbrowse";
>   my $login;
>   if (!defined $alreadyLoggedIn) {
>     $login = DBI->connect($credentials);
>     $alreadyLoggedIn = $login;
>   }
>   else {
>     $login = $alreadyLoggedIn;
>   }
>   unless ($login) {
>       confess "Could not open login database $credentials";
>   }
>
>   my $self = bless {
>       dbi      => $login,
>       globals  => $globals,
>       openid   => HAVE_OPENID,
>       register => HAVE_SMTP,
>   }, ref $class || $class;
>
>   return $self;
> }
>
> it avoids some connections to the database.
>
> By the way, I have a question about the $globals object. This is a
> Bio::Graphics::Browser2 object.  I have noticed that this object is not
> always the same through the different calls of
> Bio/Graphics/Browser2/UserDB.pm even when I work with the same datasource
> on the interface. I though that the same object should be reused ? (and so
> the class variable be more powerfull)
>
> thank you.
>
> Fred
>
>

--
Lincoln D. Stein
Director, Informatics and Biocomputing Platform
Ontario Institute for Cancer Research
101 College St., Suite 800
Toronto, ON, Canada M5G0A3
416 673-8514
Assistant: Renata Musa <[hidden email]>



--
 The Wellcome Trust Sanger Institute is operated by Genome Research
 Limited, a charity registered in England with number 1021457 and a
 company registered in England with number 2742969, whose registered
 office is 215 Euston Road, London, NW1 2BE.




--
Lincoln D. Stein
Director, Informatics and Biocomputing Platform
Ontario Institute for Cancer Research
101 College St., Suite 800
Toronto, ON, Canada M5G0A3
416 673-8514
Assistant: Renata Musa <[hidden email]>

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse