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

make scope a persistent attribute

parent 24488698
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,8 @@ sub add_account {
my $test_account = IdPAccountManager::TestAccount->new(
db => $db,
profile => $options{account_profile},
sp_entityid => $options{sp_entityid}
sp_entityid => $options{sp_entityid},
scope => $configuration->{idp_scope},
);
die "Failed to create test account\n"
......@@ -147,7 +148,6 @@ sub list_accounts {
IdPAccountManager::Tools::update_ssp_authsources(
$configuration->{templates_dir},
$configuration->{idp_accounts_file},
$configuration->{idp_scope},
$accounts
);
};
......
......@@ -33,6 +33,7 @@ CREATE TABLE `testaccounts` (
`creation_date` int(11) DEFAULT NULL,
`expiration_date` int(11) DEFAULT NULL,
`profile` varchar(100) NOT NULL,
`scope` varchar(100) NOT NULL,
`sp_entityid` varchar(250) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
......@@ -16,6 +16,7 @@ __PACKAGE__->meta->setup(
creation_date => { type => 'integer' },
expiration_date => { type => 'integer' },
profile => { type => 'varchar', length => 100, not_null => 1 },
scope => { type => 'varchar', length => 100, not_null => 1 },
sp_entityid => { type => 'varchar', length => 250, not_null => 1 },
],
......@@ -114,9 +115,12 @@ sub print {
$fd = \*STDOUT unless $fd;
printf $fd
"Account ID=%s; password_hash=%s; sp_entityid=%s; profile=%s; creation_date=%s; expiration_date=%s\n",
$self->id(), $self->password_hash(),
$self->sp_entityid(), $self->profile(),
"Account ID=%s; password_hash=%s; sp_entityid=%s; profile=%s; scope=%s; creation_date=%s; expiration_date=%s\n",
$self->id(),
$self->password_hash(),
$self->sp_entityid(),
$self->profile(),
$self->scope(),
POSIX::strftime('%Y:%m:%d', localtime($self->creation_date())),
POSIX::strftime('%Y:%m:%d', localtime($self->expiration_date()));
}
......@@ -144,16 +148,6 @@ sub save {
$self->SUPER::save();
}
sub scope {
my ($self, $scope) = @_;
if ($scope) {
$self->{scope} = $scope;
} else {
return $self->{scope};
}
}
sub internal_uid {
my ($self) = @_;
return 'user' . $self->id();
......
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