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

simplification: rename TestAccount as Account

parent f5b1296c
No related branches found
No related tags found
No related merge requests found
......@@ -19,8 +19,8 @@ use AccountManager::Token;
use AccountManager::Token::Manager;
use AccountManager::ServiceProvider;
use AccountManager::ServiceProvider::Manager;
use AccountManager::TestAccount;
use AccountManager::TestAccount::Manager;
use AccountManager::Account;
use AccountManager::Account::Manager;
use AccountManager::SAMLMetadata;
use AccountManager::Tools;
......@@ -93,7 +93,7 @@ sub add_account {
$configuration->{service}->{account_validity_period};
my $password = AccountManager::Tools::generate_password();
my $account = AccountManager::TestAccount->new(
my $account = AccountManager::Account->new(
db => $db,
profile => $options{profile},
sp_entityid => $options{sp_entityid},
......@@ -127,7 +127,7 @@ sub list_accounts {
}
my $accounts =
AccountManager::TestAccount::Manager->get_testaccounts(db => $db, %args);
AccountManager::Account::Manager->get_accounts(db => $db, %args);
if (! @$accounts) {
printf "No matching test account in DB\n";
......@@ -143,7 +143,7 @@ sub list_accounts {
}
printf "%d accounts removed\n", scalar @$accounts;
$accounts = AccountManager::TestAccount::Manager->get_testaccounts(
$accounts = AccountManager::Account::Manager->get_accounts(
db => $db
);
......
......@@ -27,7 +27,7 @@ CREATE TABLE `serviceproviders` (
UNIQUE KEY `entityid` (`entityid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
CREATE TABLE `testaccounts` (
CREATE TABLE `accounts` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`password_hash` varchar(50) NOT NULL,
`creation_date` date DEFAULT NULL,
......
package AccountManager::TestAccount;
package AccountManager::Account;
use strict;
use warnings;
......@@ -6,7 +6,7 @@ use warnings;
use base 'AccountManager::DB::Object';
__PACKAGE__->meta->setup(
table => 'testaccounts',
table => 'accounts',
columns => [
id => { type => 'bigserial', not_null => 1 },
......
package AccountManager::Account::Manager;
use strict;
use warnings;
use base qw(Rose::DB::Object::Manager);
use AccountManager::Account;
sub object_class { 'AccountManager::Account' }
__PACKAGE__->make_manager_methods('accounts');
1;
package AccountManager::TestAccount::Manager;
use strict;
use warnings;
use base qw(Rose::DB::Object::Manager);
use AccountManager::TestAccount;
sub object_class { 'AccountManager::TestAccount' }
__PACKAGE__->make_manager_methods('testaccounts');
1;
......@@ -10,8 +10,8 @@ use Template;
use Log::Any::Adapter;
use List::MoreUtils qw(uniq);
use AccountManager::TestAccount;
use AccountManager::TestAccount::Manager;
use AccountManager::Account;
use AccountManager::Account::Manager;
use AccountManager::Token;
use AccountManager::ServiceProvider;
use AccountManager::SAMLMetadata;
......@@ -470,7 +470,7 @@ sub req_validate_token {
foreach my $profile (split(/, */, $profiles)) {
my $password = AccountManager::Tools::generate_password();
my $account = AccountManager::TestAccount->new(
my $account = AccountManager::Account->new(
db => $self->{db},
profile => $profile,
sp_entityid => $entity,
......@@ -494,7 +494,7 @@ sub req_validate_token {
}
## Update simpleSAMLphp configuration to enable test accounts
my $accounts = AccountManager::TestAccount::Manager->get_testaccounts(
my $accounts = AccountManager::Account::Manager->get_accounts(
db => $self->{db}
);
......
......@@ -8,8 +8,8 @@ nobase_modules_DATA = \
AccountManager/SAMLMetadata.pm \
AccountManager/ServiceProvider.pm \
AccountManager/ServiceProvider/Manager.pm \
AccountManager/TestAccount.pm \
AccountManager/TestAccount/Manager.pm \
AccountManager/Account.pm \
AccountManager/Account/Manager.pm \
AccountManager/Tools.pm \
AccountManager/WebRequest.pm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment