• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item6678: Hard-coded LWP::UserAgent

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension OpenIdRpContrib Normal New   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

The current OpenID.pm has a hardcoded use LWP::UserAgent;. When you configure the contrib to use a different user, such as:

$TWiki::cfg{OpenIdRpContrib}{ua_class} = "LWPx::ParanoidAgent";

...you get a runtime error. http://search.cpan.org/~mart/Net-OpenID-Consumer-1.03/lib/Net/OpenID/Consumer.pm recommends to use LWPx::ParanoidAgent.

Fix: Remove the hard-coded use LWP::UserAgent; and dynamically load the specified module.

Patch:

--- OpenID.pm.save6   2011-02-07 23:02:34.000000000 -0800
+++ OpenID.pm   2011-04-05 18:01:10.000000000 -0700
@@ -43,7 +43,6 @@
 use Error qw( :try );               # included with Perl
 use TWiki::LoginManager::TemplateLogin;   # included with TWiki
 use TWiki::UI::Register;            # included with TWiki
-use LWP::UserAgent;                  # CPAN dependency
 use Cache::FileCache;               # CPAN dependency
 use Net::OpenID::Consumer;            # CPAN dependency
 
@@ -629,6 +628,7 @@
     } elsif (( defined $loginName ) and length( $loginName )) {
 
        # we don't have a response, so prepare a request for OpenID provider
+        eval 'require '.$ua_class;
         my $csr = Net::OpenID::Consumer->new(
          cache => $cache,
          consumer_secret => $consumer_secret,

-- TWiki:Main/PeterThoeny - 2011-04-06

ItemTemplate
Summary Hard-coded LWP::UserAgent
ReportedBy TWiki:Main.PeterThoeny
Codebase 4.3.2, ~twiki4
SVN Range TWiki-5.0.1, Tue, 29 Mar 2011, build 20831
AppliesTo Extension
Component OpenIdRpContrib
Priority Normal
CurrentState New
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Topic revision: r1 - 2011-04-06 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback