CPAN
view release on metacpan or search on metacpan
(Andreas Koenig, Slaven Rezic)
* introduces experimental support for plugins/hooks (#apw2014 in
Salzburg; Andreas Koenig, Branislav Zahradnik)
* catches more user errors on the 'o conf' commandline (Andreas Koenig)
* integrates the App::Cpan sources taken over from brian with lots of
cleanup from him, so that they have less chance to digress (brian d foy)
* fixes clear_credentials that were completely broken (Len Jaffe)
* fixes typos (David Horner)
2014-08-06 k <andk@cpan.org>
* release 2.06-TRIAL
* lazy load CPAN::Meta::Requirements (David Golden)
* fix $rtt handling in App::Cpan (Peter Martini)
* now with 421 distroprefs files (but a good portion of them seems
outdated)
2010-10-26 Andreas J. Koenig <andk@cpan.org>
* release 1.94_62
* address RT #62064: build_requires_install_policy set to "no" did not
work correctly (reported by Xavier Bergade)
* address RT ##55091: don't ask the proxy credentials if proxy_user
empty (fixed by Robert Bohne)
* address RT #55093: no_proxy doesn't work with more then one entries
(fixed by Robert Bohne)
2010-10-03 Andreas J. Koenig <andk@cpan.org>
* release 1.94_61
* address RT #61735: stop talking about sending test reports by email (Schwern)
t/30shell.t
t/31sessions.t
t/32pushyhttps.t
t/41distribution.t
t/42distroprefs.t
t/43distroprefspref.t
t/44cpanmeta.t
t/50pod.t
t/51pod.t
t/52podcover.t
t/60credentials.t
t/70_critic.t
t/71_minimumversion.t
t/97-compile.t
t/97-cpan1-test-mirror/authors/01mailrc.txt.gz
t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/CHECKSUMS
t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Make-Fails.tgz
t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Prereq-Fails.tgz
t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Test-Fails.tgz
t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Unsupported-OS.tgz
t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Works-Fine.tgz
SHA256 c679062d80e47ead37833b376a39b59a15a9802377af9da7f5490b1ffda87573 t/30shell.t
SHA256 588b69440bf64e455d0df4ae0eb69a277c3b1b2fae3dcfc8d1a826208f5c2ec2 t/31sessions.t
SHA256 5efd3fa9c952b475944b1b8842ad1201f4b3f76a81ae7e7e84dd8a7f09dc01d4 t/32pushyhttps.t
SHA256 c847ec5a936b94f487cfbf3004f74d67865e76e0f6882327b3674b6a14963ba9 t/41distribution.t
SHA256 2fd819be405ba20f826762dc1016915d3161366ff9e376bc164ae0462d7fa36f t/42distroprefs.t
SHA256 8a4a56cc37db20fb5ad4609de2c52204d7a691f53ac9163199fd94de845d72b9 t/43distroprefspref.t
SHA256 5c50557110b48f014e75ffef607daeecfff3069da15b36129bcee9d72d23f5cf t/44cpanmeta.t
SHA256 6109dadab614d170fc3db10b00a4c41c221860b1b1085a54af9a5f9f52480494 t/50pod.t
SHA256 0657e7155d910b080f43102b2e6a39aedda9edd194eaff68d2b83a61fdecd31e t/51pod.t
SHA256 9aaf0c99fae8190f0ec95e00e0c82fdcf2ad7301068c11dc0f74b94c4d79f3c9 t/52podcover.t
SHA256 6946b931083b7695a9db936b92a6ff2b41e4da7481c97a64d76cd30b588676e8 t/60credentials.t
SHA256 944d150594e43c6c637775c06f6f194a4cdbf6608a6372b945592352db6d62e2 t/70_critic.t
SHA256 490c093022f61eb1e4c0e9bf608aac98db0ae686486c43151ab2867d6d5c7ec4 t/71_minimumversion.t
SHA256 f9b47cf6624e12b110bf4c6e6d0e5acfc547c4fdd16e618c814d43b5eb9edba8 t/97-compile.t
SHA256 ae49798b4d3ff3fe9d3f7e0bedf10ef7d8872ff38a833fd851fa044f076f432e t/97-cpan1-test-mirror/authors/01mailrc.txt.gz
SHA256 b7b62c864c2a69c98189d0cfbcae2dc967f82464aa0732c0a15af56ba1c6a418 t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/CHECKSUMS
SHA256 405d7d03ae407d23bdb507d703fd752fb4365ad4be16e759e2da5f56899426a5 t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Make-Fails.tgz
SHA256 6c04aede4835e8b4810cbacc60deba40e16d96b1b45f4ebd95d7cdf5a2e207d1 t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Prereq-Fails.tgz
SHA256 5a3ede2fb9741ecc311ae71c5062b0058c3980c7a332ba63fa337f91beb163bb t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Test-Fails.tgz
SHA256 a0f16f2f4f17e26f8bb5fe3d68929356014d4527caeb7a4862577dc27e60b4dc t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Unsupported-OS.tgz
SHA256 a2c5b54ce7dd68a1f2d04020eaa921bc9b2edcf475c7da3cd43b77d4c18283b1 t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Works-Fine.tgz
lib/CPAN/FTP.pm view on Meta::CPAN
if ($host =~ /\Q$domain\E$/) { # cf. LWP::UserAgent
$want_proxy = 0;
last DOMAIN;
}
}
} else {
$CPAN::Frontend->mywarn(" Could not determine host from http_proxy '$http_proxy'\n");
}
if ($want_proxy) {
my($user, $pass) =
CPAN::HTTP::Credentials->get_proxy_credentials();
$ret = {
proxy_user => $user,
proxy_pass => $pass,
http_proxy => $http_proxy
};
}
}
return $ret;
}
lib/CPAN/HTTP/Client.pm view on Meta::CPAN
# C<_${mode}_type> is 'basic' or 'digest'
# C<_${mode}_params> will be the challenge parameters from the 401/407 headers
sub _auth_headers {
my ($self, $uri, $mode) = @_;
# Get names for our mode-specific attributes
my ($type_key, $param_key) = map {"_" . $mode . $_} qw/_type _params/;
# If _prepare_auth has not been called, we can't prepare headers
return unless $self->{$type_key};
# Get user credentials for mode
my $cred_method = "get_" . ($mode ? "proxy" : "non_proxy") ."_credentials";
my ($user, $pass) = CPAN::HTTP::Credentials->$cred_method;
# Generate the header for the mode & type
my $header = $mode eq 'proxy' ? 'Proxy-Authorization' : 'Authorization';
my $value_method = "_" . $self->{$type_key} . "_auth";
my $value = $self->$value_method($user, $pass, $self->{$param_key}, $uri);
# If we didn't get a value, we didn't have the right modules available
return $value ? ( $header, $value ) : ();
}
# Extract authentication parameters from headers, but clear any prior
# credentials if we failed (so we might prompt user for password again)
sub _get_auth_params {
my ($self, $response, $mode) = @_;
my $prefix = $mode eq 'proxy' ? 'Proxy' : 'WWW';
my ($type_key, $param_key) = map {"_" . $mode . $_} qw/_type _params/;
if ( ! $response->{success} ) { # auth failed
my $method = "clear_${mode}_credentials";
CPAN::HTTP::Credentials->$method;
delete $self->{$_} for $type_key, $param_key;
}
($self->{$type_key}, $self->{$param_key}) =
$self->_get_challenge( $response, "${prefix}-Authenticate");
return $self->{$type_key};
}
# Extract challenge type and parameters for a challenge list
sub _get_challenge {
lib/CPAN/HTTP/Credentials.pm view on Meta::CPAN
# -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*-
# vim: ts=4 sts=4 sw=4:
package CPAN::HTTP::Credentials;
use strict;
use vars qw($USER $PASSWORD $PROXY_USER $PROXY_PASSWORD);
$CPAN::HTTP::Credentials::VERSION = $CPAN::HTTP::Credentials::VERSION = "1.9601";
sub clear_credentials {
clear_non_proxy_credentials();
clear_proxy_credentials();
}
sub clear_non_proxy_credentials {
undef $USER;
undef $PASSWORD;
}
sub clear_proxy_credentials {
undef $PROXY_USER;
undef $PROXY_PASSWORD;
}
sub get_proxy_credentials {
my $self = shift;
if ($PROXY_USER && $PROXY_PASSWORD) {
return ($PROXY_USER, $PROXY_PASSWORD);
}
if ( defined $CPAN::Config->{proxy_user}
&& $CPAN::Config->{proxy_user}
) {
$PROXY_USER = $CPAN::Config->{proxy_user};
$PROXY_PASSWORD = $CPAN::Config->{proxy_pass} || "";
return ($PROXY_USER, $PROXY_PASSWORD);
lib/CPAN/HTTP/Credentials.pm view on Meta::CPAN
my $username_prompt = "\nProxy authentication needed!
(Note: to permanently configure username and password run
o conf proxy_user your_username
o conf proxy_pass your_password
)\nUsername:";
($PROXY_USER, $PROXY_PASSWORD) =
_get_username_and_password_from_user($username_prompt);
return ($PROXY_USER,$PROXY_PASSWORD);
}
sub get_non_proxy_credentials {
my $self = shift;
if ($USER && $PASSWORD) {
return ($USER, $PASSWORD);
}
if ( defined $CPAN::Config->{username} ) {
$USER = $CPAN::Config->{username};
$PASSWORD = $CPAN::Config->{password} || "";
return ($USER, $PASSWORD);
}
my $username_prompt = "\nAuthentication needed!
lib/CPAN/LWP/UserAgent.pm view on Meta::CPAN
return if $SETUPDONE;
if ($CPAN::META->has_usable('LWP::UserAgent')) {
require LWP::UserAgent;
@ISA = qw(Exporter LWP::UserAgent); ## no critic
$SETUPDONE++;
} else {
$CPAN::Frontend->mywarn(" LWP::UserAgent not available\n");
}
}
sub get_basic_credentials {
my($self, $realm, $uri, $proxy) = @_;
if ( $proxy ) {
return CPAN::HTTP::Credentials->get_proxy_credentials();
} else {
return CPAN::HTTP::Credentials->get_non_proxy_credentials();
}
}
sub no_proxy {
my ( $self, $no_proxy ) = @_;
return $self->SUPER::no_proxy( split(',',$no_proxy) );
}
# mirror(): Its purpose is to deal with proxy authentication. When we
# call SUPER::mirror, we really call the mirror method in
# LWP::UserAgent. LWP::UserAgent will then call
# $self->get_basic_credentials or some equivalent and this will be
# $self->dispatched to our own get_basic_credentials method.
# Our own get_basic_credentials sets $USER and $PASSWD, two globals.
# 407 stands for HTTP_PROXY_AUTHENTICATION_REQUIRED. Which means
# although we have gone through our get_basic_credentials, the proxy
# server refuses to connect. This could be a case where the username or
# password has changed in the meantime, so I'm trying once again without
# $USER and $PASSWD to give the get_basic_credentials routine another
# chance to set $USER and $PASSWD.
sub mirror {
my($self,$url,$aslocal) = @_;
my $result = $self->SUPER::mirror($url,$aslocal);
if ($result->code == 407) {
CPAN::HTTP::Credentials->clear_credentials;
$result = $self->SUPER::mirror($url,$aslocal);
}
$result;
}
1;
t/60credentials.t view on Meta::CPAN
#use FindBin qw($Bin);
#use lib "$Bin/../lib";
#use lib "$Bin/../blib";
use CPAN;
use Test::More tests => 5;
my $TRUE = 1;
my $FALSE = undef;
test_can_get_basic_credentials();
test_get_basic_credentials_for_proxy();
test_get_basic_credentials_without_proxy();
# exit;
#############################################################################
sub test_can_get_basic_credentials {
set_up();
can_ok('CPAN::LWP::UserAgent', 'get_basic_credentials');
can_ok('CPAN::HTTP::Credentials', 'get_proxy_credentials');
can_ok('CPAN::HTTP::Credentials', 'get_non_proxy_credentials');
}
sub test_get_basic_credentials_for_proxy {
set_up();
$CPAN::Config->{proxy_user} = 'proxy_username';
$CPAN::Config->{proxy_pass} = 'proxy_password';
my @proxy_credentials =
CPAN::LWP::UserAgent->get_basic_credentials('realm', 'uri', $TRUE);
is_deeply(\@proxy_credentials,
[$CPAN::Config->{proxy_user}, $CPAN::Config->{proxy_pass}],
'get_basic_credentials for proxy');
}
sub test_get_basic_credentials_without_proxy {
set_up();
$CPAN::Config->{username} = 'test_username';
$CPAN::Config->{password} = 'test_password';
my @credentials =
CPAN::LWP::UserAgent->get_basic_credentials('realm', 'uri', $FALSE);
is_deeply(\@credentials,
[$CPAN::Config->{username}, $CPAN::Config->{password}],
'get_basic_credentials for non-proxy');
}
sub set_up {
undef $CPAN::Config->{username};
undef $CPAN::Config->{password};
undef $CPAN::Config->{proxy_user};
undef $CPAN::Config->{proxy_pass};
undef $CPAN::HTTP::Credentials::USER;
undef $CPAN::HTTP::Credentials::PASSWORD;
}
( run in 0.302 second using v1.01-cache-2.11-cpan-4d50c553e7e )