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

use a default service section

parent 6f1ecf34
Branches
Tags
No related merge requests found
......@@ -98,7 +98,7 @@ sub add_account {
die "Failed to save test account\n"
unless $test_account->save(
accounts_validity_period => $configuration->{_}->{accounts_validity_period}
accounts_validity_period => $configuration->{service}->{account_validity_period}
);
printf "Account created:\n\tuserid: user%d\n\tpassword: %s\n",
......
# Validity period of test accounts, in days
accounts_validity_period = 7
# Token validity period, in hours
tokens_validity_period = 2
# Templates directory
templates_dir = @templatesdir@
# Development feature
# hard-coded list of contactPersons
# these email addresses will be added to the list of contacts for any SP
dev_sp_contact = john@my.fqdn, sarah@my.fqdn
# From field use by the account manager
notice_from = edugain-access-check.fqdn
# federation metadata local copy path
federation_metadata_file = @sysconfdir@/edugain-md.xml
# Valid account profiles
account_profiles = fullset1, limitedset1, generic1, student1, student2, teacher1, teacher2, alumni1, librarywalkin1, employee1, researcher1
# Path to sendmail executable
sendmail_path = /usr/sbin/sendmail
......@@ -47,3 +36,11 @@ scope = my.fqdn
entityid = https://my.fqdn/simplesaml/saml2/idp/metadata.php
displayname = eduGAIN Access Check
accounts_file = @sysconfdir@/accounts.php
[service]
# validity period of test accounts, in days
account_validity_period = 7
# valid account profiles
account_profiles = fullset1, limitedset1, generic1, student1, student2, teacher1, teacher2, alumni1, librarywalkin1, employee1, researcher1
# override contacts defined in metadata if defined
contacts = john@my.fqdn, sarah@my.fqdn
......@@ -126,7 +126,7 @@ sub execute {
SCRIPT_NAME => $ENV{SCRIPT_NAME}
},
conf => {
accounts_validity_period => $self->{configuration}->{accounts_validity_period},
accounts_validity_period => $self->{configuration}->{service}->{account_validity_period},
app_name => $self->{configuration}->{app}->{name},
app_url => $self->{configuration}->{app}->{url},
idp_scope => $self->{configuration}->{idp}->{scope},
......@@ -258,10 +258,10 @@ sub req_select_sp {
}
}
if ($self->{configuration}->{_}->{dev_sp_contact}) {
if ($self->{configuration}->{service}->{contacts}) {
# replace SP contacts
$provider->contacts(
split(/, */, $self->{configuration}->{_}->{dev_sp_contact})
split(/, */, $self->{configuration}->{service}->{contacts})
);
}
......@@ -299,10 +299,10 @@ sub req_generate_token {
return;
}
if ($self->{configuration}->{_}->{dev_sp_contact}) {
if ($self->{configuration}->{service}->{contacts}) {
# replace SP contacts
$provider->contacts(
split(/, */, $self->{configuration}->{_}->{dev_sp_contact})
split(/, */, $self->{configuration}->{service}->{contacts})
);
}
......@@ -464,7 +464,7 @@ sub req_validate_token {
## create test accounts
my @accounts;
foreach my $profile (split(/, */, $self->{configuration}->{_}->{account_profiles})) {
foreach my $profile (split(/, */, $self->{configuration}->{service}->{account_profiles})) {
my $account = IdPAccountManager::TestAccount->new(
db => $self->{db},
profile => $profile,
......@@ -473,7 +473,7 @@ sub req_validate_token {
);
next unless $account;
next unless $account->save(
accounts_validity_period => $self->{configuration}->{_}->{accounts_validity_period}
accounts_validity_period => $self->{configuration}->{service}->{account_validity_period}
);
push @accounts, $account;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment