App-MtAws
view release on metacpan or search on metacpan
lib/App/MtAws/ConfigDefinition.pm view on Meta::CPAN
sub check_https
{
if (present('protocol') and value('protocol') eq 'https') {
if (LWP::UserAgent->is_protocol_supported("https")) {
# to get LWP version, use LWP->VERSION instead of LWP::UserAgent->VERSION
error('LWP::UserAgent 6.x required to use HTTPS') unless LWP->VERSION() ge '6';
require LWP::Protocol::https;
error('LWP::Protocol::https 6.x required to use HTTPS') unless LWP::Protocol::https->VERSION && LWP::Protocol::https->VERSION ge '6';
} else {
error('IO::Socket::SSL or LWP::Protocol::https is not installed');
}
}
return;
}
sub check_max_size
{
if (present('check-max-file-size')) {
if (value('check-max-file-size') > 10_000 * value('partsize')) {
seen('check-max-file-size'), error(message('partsize_vs_maxsize',
t/integration/config_engine_lwp.t view on Meta::CPAN
fake_config key=>'mykey', secret => 'mysecret', region => 'myregion', protocol => 'https', sub {
disable_validations qw/journal secret key filename dir/ => sub {
no warnings 'redefine';
my $res = config_create_and_parse(@$_);
ok ! defined $res->{errors};
{
local *LWP::UserAgent::is_protocol_supported = sub { 0 };
my $res = config_create_and_parse(@$_);
cmp_deeply $res->{errors}, ['IO::Socket::SSL or LWP::Protocol::https is not installed'];
}
{
local *LWP::VERSION = sub { 5 };
my $res = config_create_and_parse(@$_);
cmp_deeply $res->{errors}, ['LWP::UserAgent 6.x required to use HTTPS'];
}
{
local *LWP::Protocol::https::VERSION = sub { 5 };
( run in 0.525 second using v1.01-cache-2.11-cpan-4d50c553e7e )