line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LWP::UserAgent::Keychain; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
684
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
70
|
|
4
|
2
|
|
|
2
|
|
28
|
use 5.8.1; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
138
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
976
|
use Mac::Glue ':all'; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use base qw( LWP::UserAgent ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $keychain = Mac::Glue->new("Keychain Scripting"); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub get_basic_credentials { |
13
|
|
|
|
|
|
|
my($self, $realm, $uri, $isproxy) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
for my $key ($keychain->obj(keys => keychain => "Login.keychain")->get) { |
16
|
|
|
|
|
|
|
if ($key->prop('class')->get eq 'cint' and |
17
|
|
|
|
|
|
|
$key->prop('server')->get eq $uri->host and |
18
|
|
|
|
|
|
|
$key->prop('protocol')->get eq $uri->scheme) { |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $username = $key->prop('account')->get; |
21
|
|
|
|
|
|
|
my $password = $key->prop('password')->get; |
22
|
|
|
|
|
|
|
return ($username, $password); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
return (undef, undef); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
__END__ |