Commit 0d491e96 authored by Xavier Guimard's avatar Xavier Guimard

Use same name for SP rules (#1330)

parent e3bd1757
...@@ -119,7 +119,7 @@ sub run { ...@@ -119,7 +119,7 @@ sub run {
$self->userLogger->error('CAS service not configured'); $self->userLogger->error('CAS service not configured');
return PE_CAS_SERVICE_NOT_ALLOWED; return PE_CAS_SERVICE_NOT_ALLOWED;
} }
if ( my $rule = $self->appRules->{$app} ) { if ( my $rule = $self->spRules->{$app} ) {
if ( $rule->( $req, $req->sessionInfo ) ) { if ( $rule->( $req, $req->sessionInfo ) ) {
$self->logger->debug("CAS service $service access allowed"); $self->logger->debug("CAS service $service access allowed");
} }
......
...@@ -198,7 +198,7 @@ sub run { ...@@ -198,7 +198,7 @@ sub run {
} }
# Check if this RP is authorizated # Check if this RP is authorizated
if ( my $rule = $self->rpRules->{$rp} ) { if ( my $rule = $self->spRules->{$rp} ) {
unless ( $rule->( $req, $req->sessionInfo ) ) { unless ( $rule->( $req, $req->sessionInfo ) ) {
$self->userLogger->warn( 'User ' $self->userLogger->warn( 'User '
. $req->sessionInfo->{ $self->conf->{whatToTrace} } . $req->sessionInfo->{ $self->conf->{whatToTrace} }
......
...@@ -25,7 +25,7 @@ has ua => ( ...@@ -25,7 +25,7 @@ has ua => (
has casSrvList => ( is => 'rw', default => sub { {} }, ); has casSrvList => ( is => 'rw', default => sub { {} }, );
has casAppList => ( is => 'rw', default => sub { {} }, ); has casAppList => ( is => 'rw', default => sub { {} }, );
has appRules => ( is => 'rw', default => sub { {} }, ); has spRules => ( is => 'rw', default => sub { {} }, );
# RUNNING METHODS # RUNNING METHODS
...@@ -65,7 +65,7 @@ sub loadApp { ...@@ -65,7 +65,7 @@ sub loadApp {
. $self->p->HANDLER->tsv->{jail}->error ); . $self->p->HANDLER->tsv->{jail}->error );
return 0; return 0;
} }
$self->appRules->{$_} = $rule; $self->spRules->{$_} = $rule;
} }
} }
return 1; return 1;
......
...@@ -36,7 +36,7 @@ use constant PHONE => [qw/phone_number phone_number_verified/]; ...@@ -36,7 +36,7 @@ use constant PHONE => [qw/phone_number phone_number_verified/];
has oidcOPList => ( is => 'rw', default => sub { {} }, ); has oidcOPList => ( is => 'rw', default => sub { {} }, );
has oidcRPList => ( is => 'rw', default => sub { {} }, ); has oidcRPList => ( is => 'rw', default => sub { {} }, );
has rpAttributes => ( is => 'rw', default => sub { {} }, ); has rpAttributes => ( is => 'rw', default => sub { {} }, );
has rpRules => ( is => 'rw', default => sub { {} } ); has spRules => ( is => 'rw', default => sub { {} } );
# return LWP::UserAgent object # return LWP::UserAgent object
has ua => ( has ua => (
...@@ -128,7 +128,7 @@ sub loadRPs { ...@@ -128,7 +128,7 @@ sub loadRPs {
. $self->p->HANDLER->tsv->{jail}->error ); . $self->p->HANDLER->tsv->{jail}->error );
return 0; return 0;
} }
$self->rpRules->{$rp} = $rule; $self->spRules->{$rp} = $rule;
} }
} }
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment