Serialized/Server/UCSPI/NegKrb5.pm

filter: Statementstmt 51.7% 15 / 29 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 33.3% 1 / 3 totaltotal 44.4% 20 / 45 CC 4 SCAR 16.9
CC
4
Cov
43%
subject
12.0
krb5_realm
6.0
new
2.0
CRAP 5.4
« Serialized/Server/UCSPI/IPC.pm ↑ Summary Serialized/ACL.pm »
1 #
2 # $HeadURL: https://svn.oucs.ox.ac.uk/people/oliver/pub/librpc-serialized-perl/trunk/lib/RPC/Serialized/Server/UCSPI/NegKrb5.pm $
3 # $LastChangedRevision: 1321 $
4 # $LastChangedDate: 2008-10-01 16:16:56 +0100 (Wed, 01 Oct 2008) $
5 # $LastChangedBy: oliver $
6 #
7 package RPC::Serialized::Server::UCSPI::NegKrb5;
8 {
9 1 $RPC::Serialized::Server::UCSPI::NegKrb5::VERSION = '1.123630';
10 }
11  
12 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use base 'RPC::Serialized::Server::UCSPI';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 ▶use RPC::Serialized::Exceptions;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
20 0 my $class = shift;
21 0 my $params = RPC::Serialized::Config->parse(@_);
22  
23 0 my $self = $class->SUPER::new($params);
24 0 $self->{KRB5_REALM} = $params->me->{krb5_realm};
25  
26 0 return $self;
27 }
28  
29 # FIXME should be an accessor?
30 0 ▶sub krb5_realm {
Subroutine krb5_realm: not called CC=2 SCAR=17.9
Pod undocumented
31 0 my $self = shift;
32 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
33 0 $self->{KRB5_REALM} = shift;
34 }
35 0 return $self->{KRB5_REALM};
36 }
37  
38 0 ▶sub subject {
Subroutine subject: not called CC=3 SCAR=24.8
Pod undocumented
39 0 my $self = shift;
40  
41 my $rprinc = $ENV{NEGKRB5REMOTEPRINC}
42 0 ▶ or throw_authz 'NEGKRB5REMOTEPRINC not set';
Branch: 1 branch
BranchTrueFalseTotal
my $rprinc = $ENV{"NEGKRB5REMOTEPRINC"} or throw_authz("NEGKRB5REMOTEPRINC not set") 0 0 0
43  
44 0 my $realm = $self->{KRB5_REALM};
45 0 ▶ ( my $subject = $rprinc ) =~ s/\@\Q$realm\E$//
Branch: 1 branch
BranchTrueFalseTotal
(my $subject = $rprinc) =~ s/\@\Q$realm\E$// or throw_authz("Realm for principal $rprinc not recognized") 0 0 0
46 or throw_authz "Realm for principal $rprinc not recognized";
47  
48 0 return $subject;
49 }
50  
51 1 1;
52  
« Serialized/Server/UCSPI/IPC.pm ↑ Summary Serialized/ACL.pm »