| 1 | package AWS::CLI::Config; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 5 | ▶ | use 5.008001; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Carp (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 5 | ▶ | use autodie; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | our $VERSION = "0.03"; | |||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 5 | my $DEFAULT_PROFILE = 'default'; | |||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 5 | my $CREDENTIALS; | |||||||||||||||||||||||||||||||||||||||||
| 15 | my %CREDENTIALS_PROFILE_OF; | ||||||||||||||||||||||||||||||||||||||||||
| 16 | 5 | my $CONFIG; | |||||||||||||||||||||||||||||||||||||||||
| 17 | 5 | my %CONFIG_PROFILE_OF; | |||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | BEGIN: { | ||||||||||||||||||||||||||||||||||||||||||
| 20 | 5 | my %accessor_of = ( | |||||||||||||||||||||||||||||||||||||||||
| 21 | access_key_id => +{ env => 'AWS_ACCESS_KEY_ID', key => 'aws_access_key_id' }, | ||||||||||||||||||||||||||||||||||||||||||
| 22 | secret_access_key => +{ env => 'AWS_SECRET_ACCESS_KEY', key => 'aws_secret_access_key' }, | ||||||||||||||||||||||||||||||||||||||||||
| 23 | session_token => +{ env => 'AWS_SESSION_TOKEN', key => 'aws_session_token' }, | ||||||||||||||||||||||||||||||||||||||||||
| 24 | region => +{ env => 'AWS_DEFAULT_REGION' }, | ||||||||||||||||||||||||||||||||||||||||||
| 25 | output => +{}, | ||||||||||||||||||||||||||||||||||||||||||
| 26 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | MK_ACCESSOR: { | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 5 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 5 | for my $attr (keys %accessor_of) { | |||||||||||||||||||||||||||||||||||||||||
| 31 | 25 | my $func = __PACKAGE__ . "::$attr"; | |||||||||||||||||||||||||||||||||||||||||
| 32 | 25 | *{$func} = _mk_accessor($attr, %{$accessor_of{$attr}}); | |||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | sub _mk_accessor { | ||||||||||||||||||||||||||||||||||||||||||
| 38 | 25 | ▶ | my $attr = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_mk_accessor: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 25 | my %opt = @_; | |||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 25 | my $env_var = $opt{env}; | |||||||||||||||||||||||||||||||||||||||||
| 42 | 25 | ▶ | my $profile_key = $opt{key} || $attr; | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$opt{'key'} || $attr
MC/DC0%0/2
$opt{'key'} || $attr
$opt{'key'}
$attr
Truth table66%2/3
A || B
A= $opt{'key'}B= $attr
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | return sub { | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 5 | ▶ | if ($env_var && exists $ENV{$env_var} && $ENV{$env_var}) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=9 SCAR=23.4
Branch: 1 branch
Condition83%5/6
$env_var and exists $ENV{$env_var} and $ENV{$env_var}
$env_var and exists $ENV{$env_var}
MC/DC66%2/3
$env_var and exists $ENV{$env_var} and $ENV{$env_var}
$env_var
exists $ENV{$env_var}
$ENV{$env_var}
Truth table75%3/4
A and B and C
A= $env_varB= exists $ENV{$env_var}C= $ENV{$env_var}
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 1 | return $ENV{$env_var}; | |||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | 4 | ▶ | my $profile = shift || _default_profile(); | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
shift() || _default_profile()
MC/DC0%0/2
shift() || _default_profile()
shift()
_default_profile()
Truth table33%1/3
A || B
A= shift()B= _default_profile()
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | 4 | my $credentials = credentials($profile); | |||||||||||||||||||||||||||||||||||||||||
| 52 | 4 | ▶ | if ($credentials && $credentials->$profile_key) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$credentials and $credentials->$profile_key
MC/DC50%1/2
$credentials and $credentials->$profile_key
$credentials
$credentials->$profile_key
Truth table66%2/3
A and B
A= $credentialsB= $credentials->$profile_key
| |||||||||||||||||||||||||||||||||||||||||||
| 53 | 2 | return $credentials->$profile_key; | |||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | 2 | my $config = config($profile); | |||||||||||||||||||||||||||||||||||||||||
| 57 | 2 | ▶ | if ($config && $config->$profile_key) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$config and $config->$profile_key
MC/DC0%0/2
$config and $config->$profile_key
$config
$config->$profile_key
Truth table33%1/3
A and B
A= $configB= $config->$profile_key
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | 2 | return $config->$profile_key; | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 62 | 25 | }; | |||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | sub credentials { | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | my $profile = shift || _default_profile(); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
credentials: not called CC=5 SCAR=34.0
Pod
documented
Condition0%0/3
shift() || _default_profile()
MC/DC0%0/2
shift() || _default_profile()
shift()
_default_profile()
Truth table0%0/3
A || B
A= shift()B= _default_profile()
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | $CREDENTIALS ||= sub { | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | my $path = File::Spec->catfile(_default_dir(), 'credentials'); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | return +{} unless (-r $path); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | return _parse($path); | |||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | }->(); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$CREDENTIALS ||= sub {
my $path = "File::Spec"->catfile(_default_dir(), "credentials");
return {} unless -r $path;
return _parse($path);
}
->()
MC/DC0%0/2
$CREDENTIALS ||= sub {
my $path = "File::Spec"->catfile(_default_dir(), "credentials");
return {} unless -r $path;
return _parse($path);
}
->()
$CREDENTIALS
sub {
my $path = "File::Spec"->catfile(_default_dir(), "credentials");
return {} unless -r $path;
return _parse($path);
}
->()
Truth table0%0/3
A ||= B
A= $CREDENTIALSB= sub {
my $path = "File::Spec"->catfile(_default_dir(), "credentials");
return {} unless -r $path;
return _parse($path);
}
->()
| |||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | return unless (exists $CREDENTIALS->{$profile}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | $CREDENTIALS_PROFILE_OF{$profile} ||= AWS::CLI::Config::Profile->_new($CREDENTIALS->{$profile}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$CREDENTIALS_PROFILE_OF{$profile} ||= "AWS::CLI::Config::Profile"->_new($CREDENTIALS->{$profile})
MC/DC0%0/2
$CREDENTIALS_PROFILE_OF{$profile} ||= "AWS::CLI::Config::Profile"->_new($CREDENTIALS->{$profile})
$CREDENTIALS_PROFILE_OF{$profile}
"AWS::CLI::Config::Profile"->_new($CREDENTIALS->{$profile})
Truth table0%0/3
A ||= B
A= $CREDENTIALS_PROFILE_OF{$profile}B= "AWS::CLI::Config::Profile"->_new($CREDENTIALS->{$profile})
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | return $CREDENTIALS_PROFILE_OF{$profile}; | |||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | sub config { | ||||||||||||||||||||||||||||||||||||||||||
| 78 | 3 | ▶ | my $profile = shift || _default_profile(); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
config: called CC=5 SCAR=17.5
Pod
documented
Condition66%2/3
shift() || _default_profile()
MC/DC0%0/2
shift() || _default_profile()
shift()
_default_profile()
Truth table66%2/3
A || B
A= shift()B= _default_profile()
| |||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | $CONFIG ||= sub { | ||||||||||||||||||||||||||||||||||||||||||
| 81 | my $path | ||||||||||||||||||||||||||||||||||||||||||
| 82 | = (exists $ENV{AWS_CONFIG_FILE} && $ENV{AWS_CONFIG_FILE}) | ||||||||||||||||||||||||||||||||||||||||||
| 83 | ? $ENV{AWS_CONFIG_FILE} | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 1 | ▶ | : File::Spec->catfile(_default_dir(), 'config'); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=16.1
Branch: 1 branch
Condition33%1/3
exists $ENV{"AWS_CONFIG_FILE"} and $ENV{"AWS_CONFIG_FILE"}
MC/DC0%0/2
exists $ENV{"AWS_CONFIG_FILE"} and $ENV{"AWS_CONFIG_FILE"}
exists $ENV{"AWS_CONFIG_FILE"}
$ENV{"AWS_CONFIG_FILE"}
Truth table33%1/3
A and B
A= exists $ENV{"AWS_CONFIG_FILE"}B= $ENV{"AWS_CONFIG_FILE"}
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | 1 | ▶ | return +{} unless (-r $path); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | 1 | return _parse($path); | |||||||||||||||||||||||||||||||||||||||||
| 88 | 3 | ▶ | }->(); | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$CONFIG ||= sub {
my $path = exists $ENV{"AWS_CONFIG_FILE"} && $ENV{"AWS_CONFIG_FILE"} ? $ENV{"AWS_CONFIG_FILE"} : "File::Spec"->catfile(_default_dir(), "config");
return {} unless -r $path;
return _parse($path);
}
->()
MC/DC0%0/2
$CONFIG ||= sub {
my $path = exists $ENV{"AWS_CONFIG_FILE"} && $ENV{"AWS_CONFIG_FILE"} ? $ENV{"AWS_CONFIG_FILE"} : "File::Spec"->catfile(_default_dir(), "config");
return {} unless -r $path;
return _parse($path);
}
->()
$CONFIG
sub {
my $path = exists $ENV{"AWS_CONFIG_FILE"} && $ENV{"AWS_CONFIG_FILE"} ? $ENV{"AWS_CONFIG_FILE"} : "File::Spec"->catfile(_default_dir(), "config");
return {} unless -r $path;
return _parse($path);
}
->()
Truth table66%2/3
A ||= B
A= $CONFIGB= sub {
my $path = exists $ENV{"AWS_CONFIG_FILE"} && $ENV{"AWS_CONFIG_FILE"} ? $ENV{"AWS_CONFIG_FILE"} : "File::Spec"->catfile(_default_dir(), "config");
return {} unless -r $path;
return _parse($path);
}
->()
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | 3 | ▶ | return unless (exists $CONFIG->{$profile}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 2 | ▶ | $CONFIG_PROFILE_OF{$profile} ||= AWS::CLI::Config::Profile->_new($CONFIG->{$profile}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$CONFIG_PROFILE_OF{$profile} ||= "AWS::CLI::Config::Profile"->_new($CONFIG->{$profile})
MC/DC0%0/2
$CONFIG_PROFILE_OF{$profile} ||= "AWS::CLI::Config::Profile"->_new($CONFIG->{$profile})
$CONFIG_PROFILE_OF{$profile}
"AWS::CLI::Config::Profile"->_new($CONFIG->{$profile})
Truth table33%1/3
A ||= B
A= $CONFIG_PROFILE_OF{$profile}B= "AWS::CLI::Config::Profile"->_new($CONFIG->{$profile})
| |||||||||||||||||||||||||||||||||||||||||||
| 92 | 2 | return $CONFIG_PROFILE_OF{$profile}; | |||||||||||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||
| 95 | sub _base_dir { | ||||||||||||||||||||||||||||||||||||||||||
| 96 | 2 | ▶ | ($^O eq 'MSWin32') ? $ENV{USERPROFILE} : $ENV{HOME}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_base_dir: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||
| 99 | sub _default_dir { | ||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | File::Spec->catdir(_base_dir(), '.aws'); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_default_dir: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | sub _default_profile { | ||||||||||||||||||||||||||||||||||||||||||
| 104 | (exists $ENV{AWS_DEFAULT_PROFILE} && $ENV{AWS_DEFAULT_PROFILE}) | ||||||||||||||||||||||||||||||||||||||||||
| 105 | ? $ENV{AWS_DEFAULT_PROFILE} | ||||||||||||||||||||||||||||||||||||||||||
| 106 | 6 | ▶ | : $DEFAULT_PROFILE; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_default_profile: called CC=3 SCAR=14.2
Branch: 1 branch
Condition33%1/3
exists $ENV{"AWS_DEFAULT_PROFILE"} and $ENV{"AWS_DEFAULT_PROFILE"}
MC/DC0%0/2
exists $ENV{"AWS_DEFAULT_PROFILE"} and $ENV{"AWS_DEFAULT_PROFILE"}
exists $ENV{"AWS_DEFAULT_PROFILE"}
$ENV{"AWS_DEFAULT_PROFILE"}
Truth table33%1/3
A and B
A= exists $ENV{"AWS_DEFAULT_PROFILE"}B= $ENV{"AWS_DEFAULT_PROFILE"}
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||
| 109 | sub _parse { | ||||||||||||||||||||||||||||||||||||||||||
| 110 | 1 | ▶ | my $file = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_parse: called CC=10 SCAR=23.2
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | 1 | ▶ | my $profile = shift || _default_profile(); | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
shift() || _default_profile()
MC/DC0%0/2
shift() || _default_profile()
shift()
_default_profile()
Truth table33%1/3
A || B
A= shift()B= _default_profile()
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||
| 113 | 1 | my $hash = {}; | |||||||||||||||||||||||||||||||||||||||||
| 114 | 1 | my $nested = {}; | |||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||
| 116 | 1 | my $contents; | |||||||||||||||||||||||||||||||||||||||||
| 117 | { | ||||||||||||||||||||||||||||||||||||||||||
| 118 | 1 | local $/ = undef; | |||||||||||||||||||||||||||||||||||||||||
| 119 | 1 | open my $fh, '<', $file; | |||||||||||||||||||||||||||||||||||||||||
| 120 | 1 | $contents = <$fh>; | |||||||||||||||||||||||||||||||||||||||||
| 121 | 1 | close( $fh ); | |||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | 1 | foreach my $line (split /\n/, $contents) { | |||||||||||||||||||||||||||||||||||||||||
| 125 | 8 | chomp $line; | |||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||
| 127 | 8 | ▶ | $profile = $1 if $line =~ /^\[(?:profile )?([\w]+)\]/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | 8 | my ($indent, $key, $value) = $line =~ /^(\s*)([\w]+)\s*=\s*(.*)/; | |||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | 8 | ▶ | next if !defined $key or $key eq q{}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not defined $key or $key eq ""
MC/DC50%1/2
not defined $key or $key eq ""
not defined $key
$key eq ""
Truth table66%2/3
not(A) or B
A= not defined $keyB= $key eq ""
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | 6 | ▶ | if (length $indent) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 1 | $nested->{$key} = $value; | |||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||
| 135 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 136 | # Reset nested hash | ||||||||||||||||||||||||||||||||||||||||||
| 137 | 5 | ▶ | $nested = {} if keys %{$nested}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 138 | 5 | ▶ | $hash->{$profile}{$key} = ($key and $value) ? $value : $nested; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$key and $value
MC/DC50%1/2
$key and $value
$key
$value
Truth table66%2/3
A and B
A= $keyB= $value
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | 1 | return $hash; | |||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||
| 145 | PROFILE: { | ||||||||||||||||||||||||||||||||||||||||||
| 146 | package AWS::CLI::Config::Profile; | ||||||||||||||||||||||||||||||||||||||||||
| 147 | 5 | ▶ | use 5.008001; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 148 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 149 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||
| 151 | 5 | my @ACCESSORS; | |||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||
| 153 | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||
| 154 | 5 | ▶ | @ACCESSORS = qw( | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | aws_access_key_id | ||||||||||||||||||||||||||||||||||||||||||
| 156 | aws_secret_access_key | ||||||||||||||||||||||||||||||||||||||||||
| 157 | aws_session_token | ||||||||||||||||||||||||||||||||||||||||||
| 158 | region | ||||||||||||||||||||||||||||||||||||||||||
| 159 | output | ||||||||||||||||||||||||||||||||||||||||||
| 160 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | 5 | ▶ | use Object::Tiny @ACCESSORS; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||
| 165 | sub _new { | ||||||||||||||||||||||||||||||||||||||||||
| 166 | 6 | ▶ | my $class = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_new: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | 6 | my $data = shift; | |||||||||||||||||||||||||||||||||||||||||
| 168 | 6 | return bless $data, $class; | |||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||
| 172 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 173 | __END__ | ||||||||||||||||||||||||||||||||||||||||||