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

simplification: rename ServiceProvider as Service

parent 47bd9d12
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,8 @@ use Pod::Usage;
use AccountManager::Token;
use AccountManager::Token::Manager;
use AccountManager::ServiceProvider;
use AccountManager::ServiceProvider::Manager;
use AccountManager::Service;
use AccountManager::Service::Manager;
use AccountManager::Account;
use AccountManager::Account::Manager;
use AccountManager::SAMLMetadata;
......@@ -195,7 +195,7 @@ sub add_provider {
) unless $options{contacts};
## Check if entry already exists in DB first
my $provider = AccountManager::ServiceProvider->new(
my $provider = AccountManager::Service->new(
db => $db,
entityid => $options{sp_entityid}
);
......@@ -206,7 +206,7 @@ sub add_provider {
$provider->contacts($options{contacts});
$provider->displayname($options{displayname}) if $options{displayname};
} else {
$provider = AccountManager::ServiceProvider->new(
$provider = AccountManager::Service->new(
db => $db,
entityid => $options{sp_entityid},
contacts => $options{contacts},
......@@ -223,7 +223,7 @@ sub add_provider {
sub list_providers {
my %args;
my $providers = AccountManager::ServiceProvider::Manager->get_serviceproviders(db => $db, %args);
my $providers = AccountManager::Service::Manager->get_services(db => $db, %args);
if (! @$providers) {
printf "No service provider in DB\n";
......
......@@ -18,7 +18,7 @@ CREATE TABLE `tokens` (
CONSTRAINT token_email_entity UNIQUE (email_address(50),sp_entityid(50))
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `serviceproviders` (
CREATE TABLE `services` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`entityid` varchar(200) NOT NULL,
`displayname` varchar(500) DEFAULT NULL,
......
package AccountManager::ServiceProvider;
package AccountManager::Service;
use strict;
use warnings;
......@@ -8,7 +8,7 @@ use base 'AccountManager::DB::Object';
use List::MoreUtils qw(any);
__PACKAGE__->meta->setup(
table => 'serviceproviders',
table => 'services',
columns => [
id => { type => 'bigserial', not_null => 1 },
......
package AccountManager::Service::Manager;
use strict;
use warnings;
use base qw(Rose::DB::Object::Manager);
use AccountManager::Service;
sub object_class { 'AccountManager::Service' }
__PACKAGE__->make_manager_methods('services');
1;
package AccountManager::ServiceProvider::Manager;
use strict;
use warnings;
use base qw(Rose::DB::Object::Manager);
use AccountManager::ServiceProvider;
sub object_class { 'AccountManager::ServiceProvider' }
__PACKAGE__->make_manager_methods('serviceproviders');
1;
......@@ -13,7 +13,7 @@ use List::MoreUtils qw(uniq);
use AccountManager::Account;
use AccountManager::Account::Manager;
use AccountManager::Token;
use AccountManager::ServiceProvider;
use AccountManager::Service;
use AccountManager::SAMLMetadata;
use AccountManager::Tools;
......@@ -215,7 +215,7 @@ sub req_select_sp {
}
# Create a persistent service provider object
my $provider = AccountManager::ServiceProvider->new(
my $provider = AccountManager::Service->new(
db => $self->{db},
entityid => $self->{in}->{sp_entityid}
);
......@@ -290,7 +290,7 @@ sub req_generate_token {
return;
}
my $provider = AccountManager::ServiceProvider->new(
my $provider = AccountManager::Service->new(
db => $self->{db},
entityid => $self->{in}->{sp_entityid},
);
......
......@@ -6,8 +6,8 @@ nobase_modules_DATA = \
AccountManager/DB.pm \
AccountManager/DB/Object.pm \
AccountManager/SAMLMetadata.pm \
AccountManager/ServiceProvider.pm \
AccountManager/ServiceProvider/Manager.pm \
AccountManager/Service.pm \
AccountManager/Service/Manager.pm \
AccountManager/Account.pm \
AccountManager/Account/Manager.pm \
AccountManager/Tools.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