Skip to content
Snippets Groups Projects
Commit 2ebb1907 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

get rid of indirect object call syntax

parent c7881cfe
Branches
Tags
No related merge requests found
...@@ -59,7 +59,7 @@ if ($options{'add_test_account'}) { ...@@ -59,7 +59,7 @@ if ($options{'add_test_account'}) {
die "Missing sp_entityid option"; die "Missing sp_entityid option";
} }
my $test_account = new IdPAccountManager::TestAccount( my $test_account = IdPAccountManager::TestAccount->new(
account_profile => $options{'account_profile'}, account_profile => $options{'account_profile'},
sp_entityid => $options{'sp_entityid'} sp_entityid => $options{'sp_entityid'}
); );
...@@ -122,7 +122,7 @@ if ($options{'add_test_account'}) { ...@@ -122,7 +122,7 @@ if ($options{'add_test_account'}) {
} }
} elsif ($options{'parse_federation_metadata'}) { } elsif ($options{'parse_federation_metadata'}) {
my $federation_metadata = new IdPAccountManager::SAMLMetadata; my $federation_metadata = IdPAccountManager::SAMLMetadata->new();
unless ( unless (
$federation_metadata->load( $federation_metadata->load(
federation_metadata_file_path => federation_metadata_file_path =>
...@@ -168,7 +168,7 @@ if ($options{'add_test_account'}) { ...@@ -168,7 +168,7 @@ if ($options{'add_test_account'}) {
## Check if entry already exists in DB first ## Check if entry already exists in DB first
my $service_provider = my $service_provider =
new IdPAccountManager::ServiceProvider( IdPAccountManager::ServiceProvider->new(
entityid => $options{'sp_entityid'}); entityid => $options{'sp_entityid'});
if ($service_provider->load(speculative => 1)) { if ($service_provider->load(speculative => 1)) {
printf "Entry for %s already in DB; update it with new data\n", printf "Entry for %s already in DB; update it with new data\n",
...@@ -179,7 +179,7 @@ if ($options{'add_test_account'}) { ...@@ -179,7 +179,7 @@ if ($options{'add_test_account'}) {
if ($options{'displayname'}); if ($options{'displayname'});
} else { } else {
$service_provider = new IdPAccountManager::ServiceProvider( $service_provider = IdPAccountManager::ServiceProvider->new(
entityid => $options{'sp_entityid'}, entityid => $options{'sp_entityid'},
contacts => $options{'contacts'}, contacts => $options{'contacts'},
displayname => $options{'displayname'} displayname => $options{'displayname'}
...@@ -250,7 +250,7 @@ if ($options{'add_test_account'}) { ...@@ -250,7 +250,7 @@ if ($options{'add_test_account'}) {
} }
my $authentication_token = my $authentication_token =
new IdPAccountManager::AuthenticationToken(%args); IdPAccountManager::AuthenticationToken->new(%args);
unless ($authentication_token->load()) { unless ($authentication_token->load()) {
die "No corresponding token found in DB\n"; die "No corresponding token found in DB\n";
...@@ -281,7 +281,7 @@ if ($options{'add_test_account'}) { ...@@ -281,7 +281,7 @@ if ($options{'add_test_account'}) {
die "Missing sp_entityid option"; die "Missing sp_entityid option";
} }
my $authentication_token = new IdPAccountManager::AuthenticationToken( my $authentication_token = IdPAccountManager::AuthenticationToken->new(
'email_address' => $options{'email_address'}, 'email_address' => $options{'email_address'},
'sp_entityid' => $options{'sp_entityid'} 'sp_entityid' => $options{'sp_entityid'}
); );
...@@ -297,7 +297,7 @@ if ($options{'add_test_account'}) { ...@@ -297,7 +297,7 @@ if ($options{'add_test_account'}) {
exit -1; exit -1;
} }
$authentication_token = new IdPAccountManager::AuthenticationToken( $authentication_token = IdPAccountManager::AuthenticationToken->new(
'email_address' => $options{'email_address'}, 'email_address' => $options{'email_address'},
'sp_entityid' => $options{'sp_entityid'} 'sp_entityid' => $options{'sp_entityid'}
); );
......
...@@ -74,7 +74,7 @@ sub list_service_providers { ...@@ -74,7 +74,7 @@ sub list_service_providers {
my $service_providers; my $service_providers;
foreach my $persistent_sp (@{$persistent_accounts}) { foreach my $persistent_sp (@{$persistent_accounts}) {
my $service_provider = my $service_provider =
new IdPAccountManager::ServiceProvider( IdPAccountManager::ServiceProvider->new(
entityid => $persistent_sp->entityid()); entityid => $persistent_sp->entityid());
$service_provider->load(); $service_provider->load();
push @$service_providers, $service_provider; push @$service_providers, $service_provider;
......
...@@ -107,7 +107,7 @@ sub list_test_accounts { ...@@ -107,7 +107,7 @@ sub list_test_accounts {
IdPAccountManager::Data::Testaccount::Manager->get_testaccounts(%args); IdPAccountManager::Data::Testaccount::Manager->get_testaccounts(%args);
my $accounts; my $accounts;
foreach my $persistent_account (@{$persistent_accounts}) { foreach my $persistent_account (@{$persistent_accounts}) {
my $account = new IdPAccountManager::TestAccount($persistent_account); my $account = IdPAccountManager::TestAccount->new($persistent_account);
push @$accounts, $account; push @$accounts, $account;
} }
...@@ -124,7 +124,7 @@ sub create_test_accounts_for_sp { ...@@ -124,7 +124,7 @@ sub create_test_accounts_for_sp {
} }
foreach my $profile (@{ $Conf::global{'account_profiles'} }) { foreach my $profile (@{ $Conf::global{'account_profiles'} }) {
my $test_account = new IdPAccountManager::TestAccount( my $test_account = IdPAccountManager::TestAccount->new(
account_profile => $profile, account_profile => $profile,
sp_entityid => $args{'sp_entityid'} sp_entityid => $args{'sp_entityid'}
); );
...@@ -153,7 +153,7 @@ IdPAccountManager::TestAccount - Manage test user accounts for the Test Identity ...@@ -153,7 +153,7 @@ IdPAccountManager::TestAccount - Manage test user accounts for the Test Identity
=head1 SYNOPSIS =head1 SYNOPSIS
my $test_account = new IdPAccountManager::TestAccount(account_profile => 'student1', my $test_account = IdPAccountManager::TestAccount->new(account_profile => 'student1',
sp_entityid => 'https://test.federation.renater.fr/test/ressource'); sp_entityid => 'https://test.federation.renater.fr/test/ressource');
unless (defined $test_account) { unless (defined $test_account) {
die "Failed to create test account"; die "Failed to create test account";
...@@ -179,7 +179,7 @@ This module allows to manage the test accounts. ...@@ -179,7 +179,7 @@ This module allows to manage the test accounts.
Class method. Create a new IdPAccountManager::TestAccount object. Class method. Create a new IdPAccountManager::TestAccount object.
Example: Example:
my $test_account = new IdPAccountManager::TestAccount(account_profile => 'student1', my $test_account = IdPAccountManager::TestAccount->new(account_profile => 'student1',
sp_entityid => 'https://test.federation.renater.fr/test/ressource'); sp_entityid => 'https://test.federation.renater.fr/test/ressource');
Supported arguments include: Supported arguments include:
......
...@@ -23,7 +23,7 @@ sub new { ...@@ -23,7 +23,7 @@ sub new {
message => '' message => ''
); );
my $http_query = new CGI; my $http_query = CGI->new();
## Input parameters ## Input parameters
my %in_vars = $http_query->Vars; my %in_vars = $http_query->Vars;
...@@ -227,7 +227,7 @@ sub req_account_wizard { ...@@ -227,7 +227,7 @@ sub req_account_wizard {
my $self = shift; my $self = shift;
$self->{logger}->log(level => LOG_INFO, message => ""); $self->{logger}->log(level => LOG_INFO, message => "");
my $federation_metadata = new IdPAccountManager::SAMLMetadata( my $federation_metadata = IdPAccountManager::SAMLMetadata->new(
logger => $self->{logger} logger => $self->{logger}
); );
...@@ -274,7 +274,7 @@ sub req_select_sp { ...@@ -274,7 +274,7 @@ sub req_select_sp {
return undef; return undef;
} }
my $federation_metadata = new IdPAccountManager::SAMLMetadata( my $federation_metadata = IdPAccountManager::SAMLMetadata->new(
logger => $self->{logger} logger => $self->{logger}
); );
...@@ -308,7 +308,7 @@ sub req_select_sp { ...@@ -308,7 +308,7 @@ sub req_select_sp {
} }
## Create a serviceprovider object to store major parameters for this SP in DB ## Create a serviceprovider object to store major parameters for this SP in DB
my $service_provider = new IdPAccountManager::ServiceProvider( my $service_provider = IdPAccountManager::ServiceProvider->new(
entityid => $self->{'param_in'}{'sp_entityid'}); entityid => $self->{'param_in'}{'sp_entityid'});
## Prepare data ## Prepare data
...@@ -347,7 +347,7 @@ sub req_select_sp { ...@@ -347,7 +347,7 @@ sub req_select_sp {
} else { } else {
$service_provider = new IdPAccountManager::ServiceProvider( $service_provider = IdPAccountManager::ServiceProvider->new(
entityid => $self->{'param_in'}{'sp_entityid'}, entityid => $self->{'param_in'}{'sp_entityid'},
contacts => join(',', @contacts), contacts => join(',', @contacts),
displayname => $display_name displayname => $display_name
...@@ -401,7 +401,7 @@ sub req_generate_token { ...@@ -401,7 +401,7 @@ sub req_generate_token {
} }
## Create a serviceprovider object to load parameters for this SP from DB ## Create a serviceprovider object to load parameters for this SP from DB
my $service_provider = new IdPAccountManager::ServiceProvider( my $service_provider = IdPAccountManager::ServiceProvider->new(
entityid => $self->{'param_in'}{'sp_entityid'}); entityid => $self->{'param_in'}{'sp_entityid'});
# Try loading DB object first # Try loading DB object first
...@@ -429,7 +429,7 @@ sub req_generate_token { ...@@ -429,7 +429,7 @@ sub req_generate_token {
return undef; return undef;
} }
my $authentication_token = new IdPAccountManager::AuthenticationToken( my $authentication_token = IdPAccountManager::AuthenticationToken->new(
'email_address' => $self->{'param_in'}{'email_address'}, 'email_address' => $self->{'param_in'}{'email_address'},
'sp_entityid' => $self->{'param_in'}{'sp_entityid'} 'sp_entityid' => $self->{'param_in'}{'sp_entityid'}
); );
...@@ -456,7 +456,7 @@ sub req_generate_token { ...@@ -456,7 +456,7 @@ sub req_generate_token {
return undef; return undef;
} }
$authentication_token = new IdPAccountManager::AuthenticationToken( $authentication_token = IdPAccountManager::AuthenticationToken->new(
'email_address' => $self->{'param_in'}{'email_address'}, 'email_address' => $self->{'param_in'}{'email_address'},
'sp_entityid' => $self->{'param_in'}{'sp_entityid'} 'sp_entityid' => $self->{'param_in'}{'sp_entityid'}
); );
...@@ -529,7 +529,7 @@ sub req_validate_token { ...@@ -529,7 +529,7 @@ sub req_validate_token {
return undef; return undef;
} }
my $authentication_token = new IdPAccountManager::AuthenticationToken( my $authentication_token = IdPAccountManager::AuthenticationToken->new(
token => $self->{'param_in'}{'authentication_token'}); token => $self->{'param_in'}{'authentication_token'});
unless ($authentication_token->load()) { unless ($authentication_token->load()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment