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

simplification: rename AuthenticationToken as Token

parent 4c93ca72
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,8 @@ use Getopt::Long qw(:config auto_help);
use Log::Any::Adapter;
use Pod::Usage;
use AccountManager::AuthenticationToken;
use AccountManager::AuthenticationToken::Manager;
use AccountManager::Token;
use AccountManager::Token::Manager;
use AccountManager::ServiceProvider;
use AccountManager::ServiceProvider::Manager;
use AccountManager::TestAccount;
......@@ -256,7 +256,7 @@ sub list_tokens {
}
my $tokens =
AccountManager::AuthenticationToken::Manager->get_authenticationtokens(db => $db, %args);
AccountManager::Token::Manager->get_tokens(db => $db, %args);
if (!@$tokens) {
printf "No corresponding token found in DB\n";
......@@ -284,7 +284,7 @@ sub get_token {
}
my $token =
AccountManager::AuthenticationToken->new(db => $db, %args);
AccountManager::Token->new(db => $db, %args);
die "No corresponding token found in DB\n"
unless $token->load();
......@@ -311,7 +311,7 @@ sub add_token {
) unless $options{sp_entityid};
# delete any previous token for the same email/service couple
my $old_token = AccountManager::AuthenticationToken->new(
my $old_token = AccountManager::Token->new(
db => $db,
email_address => $options{email_address},
sp_entityid => $options{sp_entityid}
......@@ -322,7 +322,7 @@ sub add_token {
}
# compute a new token
my $token = AccountManager::AuthenticationToken->new(
my $token = AccountManager::Token->new(
db => $db,
email_address => $options{email_address},
sp_entityid => $options{sp_entityid},
......
......@@ -6,7 +6,7 @@
-- --------------------------------------------------------
CREATE TABLE `authenticationtokens` (
CREATE TABLE `tokens` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`token` varchar(50) NOT NULL,
`email_address` varchar(200) NOT NULL,
......
package AccountManager::AuthenticationToken::Manager;
use strict;
use warnings;
use base qw(Rose::DB::Object::Manager);
use AccountManager::AuthenticationToken;
sub object_class { 'AccountManager::AuthenticationToken' }
__PACKAGE__->make_manager_methods('authenticationtokens');
1;
package AccountManager::AuthenticationToken;
package AccountManager::Token;
use strict;
use warnings;
......@@ -6,7 +6,7 @@ use warnings;
use base 'AccountManager::DB::Object';
__PACKAGE__->meta->setup(
table => 'authenticationtokens',
table => 'tokens',
columns => [
id => { type => 'bigserial', not_null => 1 },
......
package AccountManager::Token::Manager;
use strict;
use warnings;
use base qw(Rose::DB::Object::Manager);
use AccountManager::Token;
sub object_class { 'AccountManager::Token' }
__PACKAGE__->make_manager_methods('tokens');
1;
......@@ -12,7 +12,7 @@ use List::MoreUtils qw(uniq);
use AccountManager::TestAccount;
use AccountManager::TestAccount::Manager;
use AccountManager::AuthenticationToken;
use AccountManager::Token;
use AccountManager::ServiceProvider;
use AccountManager::SAMLMetadata;
use AccountManager::Tools;
......@@ -321,7 +321,7 @@ sub req_generate_token {
}
# delete any previous token for the same email/service couple
my $old_token = AccountManager::AuthenticationToken->new(
my $old_token = AccountManager::Token->new(
db => $self->{db},
email_address => $self->{in}->{email_address},
sp_entityid => $self->{in}->{sp_entityid}
......@@ -339,7 +339,7 @@ sub req_generate_token {
}
# compute a new token
my $token = AccountManager::AuthenticationToken->new(
my $token = AccountManager::Token->new(
db => $self->{db},
email_address => $self->{in}->{email_address},
sp_entityid => $self->{in}->{sp_entityid},
......@@ -424,7 +424,7 @@ sub req_validate_token {
return;
}
my $token = AccountManager::AuthenticationToken->new(
my $token = AccountManager::Token->new(
db => $self->{db},
token => $self->{in}->{authentication_token}
);
......
modulesdir = $(pkgdatadir)/lib
nobase_modules_DATA = \
AccountManager/AuthenticationToken.pm \
AccountManager/AuthenticationToken/Manager.pm \
AccountManager/Token.pm \
AccountManager/Token/Manager.pm \
AccountManager/DB.pm \
AccountManager/DB/Object.pm \
AccountManager/SAMLMetadata.pm \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment