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

simplify configuration format

parent 3a6ebed9
No related branches found
No related tags found
No related merge requests found
...@@ -53,14 +53,13 @@ AccountManager::Entity->delete_entities(all => 1); ...@@ -53,14 +53,13 @@ AccountManager::Entity->delete_entities(all => 1);
$db->dbh()->do('ALTER TABLE entities AUTO_INCREMENT = 1'); $db->dbh()->do('ALTER TABLE entities AUTO_INCREMENT = 1');
my %seen; my %seen;
foreach my $id (split(/, */, $configuration->{groups}->{list})) { foreach my $id (keys %{$configuration->{federations}}) {
my $spec = $configuration->{$id};
next unless $spec->{type} eq 'metadata';
print "processing federation $id\n" if $options{verbose}; print "processing federation $id\n" if $options{verbose};
my $file = File::Temp->new();
print "downloading metadata from url $spec->{url}\n" if $options{verbose}; my $file = File::Temp->new();
my $response = $ua->get($spec->{url}, ':content_file' => $file->filename()); my $url = $configuration->{federations}->{$id};
print "downloading metadata from url $url\n" if $options{verbose};
my $response = $ua->get($url, ':content_file' => $file->filename());
if (!$response->is_success()) { if (!$response->is_success()) {
$db->rollback(); $db->rollback();
die "failed to download federation metadata: " . $response->status_line(); die "failed to download federation metadata: " . $response->status_line();
......
...@@ -11,23 +11,10 @@ templates_dir = @templatesdir@ ...@@ -11,23 +11,10 @@ templates_dir = @templatesdir@
templates_theme = edugain templates_theme = edugain
accounts_file = /var/lib/access-check/accounts.php accounts_file = /var/lib/access-check/accounts.php
[groups] [federations]
list = self, renater, edugain # list of all federations from which to fetch metadata
edugain = https://mds.edugain.org/
[self] aconet = https://eduid.at/md/aconet-registered.xml
type = organization
label = my own organization
[renater]
type = metadata
file = /var/lib/access-check/renater.xml
label = fédération Education-Recherche
[edugain]
type = link
url = https://access-check.edugain.org
label = eduGAIN
message = eduGAIN Access Check
[logger] [logger]
file = /var/log/access-check/manager.log file = /var/log/access-check/manager.log
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment