« blib/lib/Lemonldap/NG/Portal/Lib/RESTProxy.pm
↑ Summary
blib/lib/Lemonldap/NG/Portal/UserDB/OpenIDConnect.pm »
| 1 | package Lemonldap::NG::Portal::UserDB::WebID; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Mouse; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Lemonldap::NG::Portal::Main::Constants qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | PE_OK | ||||||||||||||||||||||||||||
| 7 | PE_ERROR | ||||||||||||||||||||||||||||
| 8 | PE_MISSINGREQATTR | ||||||||||||||||||||||||||||
| 9 | 1 | ); | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | extends 'Lemonldap::NG::Portal::Main::UserDB'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | our $VERSION = '2.19.0'; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | # INITIALIZATION | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub init { | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 18 | 0 | return 1; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # RUNNING METHODS | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub getUser { | ||||||||||||||||||||||||||
|
Subroutine
getUser: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 24 | 0 | return PE_OK; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | ▶ | sub findUser { | ||||||||||||||||||||||||||
|
Subroutine
findUser: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 28 | 0 | return PE_OK; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | ▶ | sub setSessionInfo { | ||||||||||||||||||||||||||
|
Subroutine
setSessionInfo: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 32 | 0 | my ( $self, $req ) = @_; | |||||||||||||||||||||||||||
| 33 | 0 | ▶ | unless ( $req->data->{_webid} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 0 | $self->logger->error('No webid object found'); | |||||||||||||||||||||||||||
| 35 | 0 | return PE_ERROR; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | my %vars = ( | ||||||||||||||||||||||||||||
| 39 | 0 | %{ $self->conf->{exportedVars} }, | |||||||||||||||||||||||||||
| 40 | 0 | %{ $self->conf->{webIDExportedVars} } | |||||||||||||||||||||||||||
| 41 | ); | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | while ( my ( $k, $v ) = each %vars ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 0 | my $attr = $k; | |||||||||||||||||||||||||||
| 44 | 0 | my $req; | |||||||||||||||||||||||||||
| 45 | 0 | ▶ | $attr =~ s/^!// and $req = 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 46 | 0 | eval { $req->{sessionInfo}->{$attr} = $req->data->{_webid}->get($v) }; | |||||||||||||||||||||||||||
| 47 | 0 | ▶ | $self->logger->error("Unable to get $v from FOAF document: $@") | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | if ($@); | ||||||||||||||||||||||||||||
| 49 | 0 | ▶ | if ( $req and not $req->{sessionInfo}->{$attr} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$req and not $req->{"sessionInfo"}{$attr}
MC/DC0%0/2
$req and not $req->{"sessionInfo"}{$attr}
$req
not $req->{"sessionInfo"}{$attr}
Truth table0%0/3
A and not(B)
A= $reqB= not $req->{"sessionInfo"}{$attr}
| |||||||||||||||||||||||||||||
| 50 | 0 | $self->userLogger->warn( | |||||||||||||||||||||||||||
| 51 | "Required attribute $v is missing (user: $req->{user})"); | ||||||||||||||||||||||||||||
| 52 | 0 | return PE_MISSINGREQATTR; | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | return PE_OK; | |||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 1 | 1; | |||||||||||||||||||||||||||