Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Access Check - Account manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Access Check - Account manager
Commits
b24e3d0d
Commit
b24e3d0d
authored
3 years ago
by
Guillaume ROUSSE
Browse files
Options
Downloads
Patches
Plain Diff
switch to Syntax::Keyword::Try
parent
3dde0041
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/access-check-manager.pl
+9
-7
9 additions, 7 deletions
bin/access-check-manager.pl
bin/update-metadata
+28
-29
28 additions, 29 deletions
bin/update-metadata
with
37 additions
and
36 deletions
bin/access-check-manager.pl
+
9
−
7
View file @
b24e3d0d
...
...
@@ -13,6 +13,7 @@ use DateTime;
use
English
qw(-no_match_vars)
;
use
Getopt::
Long
qw(:config auto_help)
;
use
Pod::
Usage
;
use
Syntax::Keyword::
Try
;
use
AccountManager::Data::
Account
;
use
AccountManager::Data::
Entity
;
...
...
@@ -151,15 +152,15 @@ sub list_accounts {
db
=>
$db
);
eval
{
try
{
AccountManager::Tools::
update_ssp_authsources
(
$configuration
->
{
setup
}
->
{
templates_dir
},
$configuration
->
{
setup
}
->
{
accounts_file
},
$accounts
);
}
;
die
"
failed to update simpleSAMLphp configuration file:
$
EVAL_ERROR
"
if
$EVAL_ERROR
;
}
catch
(
$error
)
{
die
"
failed to update simpleSAMLphp configuration file:
$
error
"
}
printf
"
Update simpleSamlPhp configuration file...
\n
";
}
...
...
@@ -169,12 +170,13 @@ sub list_accounts {
sub
parse_metadata
{
my
$federation_metadata
;
eval
{
try
{
$federation_metadata
=
AccountManager::
Metadata
->
new
(
file
=>
$configuration
->
{
setup
}
->
{
federation_metadata_file
}
);
};
die
"
unable to load federation metadata:
$EVAL_ERROR
"
if
$EVAL_ERROR
;
}
catch
(
$error
)
{
die
"
unable to load federation metadata:
$error
";
}
my
$data
=
$federation_metadata
->
parse
(
id
=>
$options
{
entityid
});
...
...
This diff is collapsed.
Click to expand it.
bin/update-metadata
+
28
−
29
View file @
b24e3d0d
...
...
@@ -13,6 +13,7 @@ use Getopt::Long qw(:config auto_help);
use
List::
MoreUtils
qw(uniq)
;
use
Mojo::
UserAgent
;
use
Pod::
Usage
;
use
Syntax::Keyword::
Try
;
use
AccountManager::Data::
DB
;
use
AccountManager::Data::
Entity
;
...
...
@@ -82,24 +83,22 @@ foreach my $id (keys %{$configuration->{federations}}) {
$result
->
save_to
(
$file
->
filename
());
my
$metadata
;
eval
{
try
{
$metadata
=
AccountManager::
Metadata
->
new
(
file
=>
$file
);
};
if
(
$EVAL_ERROR
)
{
}
catch
(
$error
)
{
$db
->
rollback
();
die
"
failed to load federation metadata:
$
EVAL_ERROR
";
die
"
failed to load federation metadata:
$
error
";
}
print
"
parsing metadata from file
$file
\n
"
if
$options
{
verbose
};
my
$entities
;
eval
{
try
{
$entities
=
$metadata
->
parse
();
};
if
(
$EVAL_ERROR
)
{
}
catch
(
$error
)
{
$db
->
rollback
();
die
"
failed to parse federation metadata:
$
EVAL_ERROR
";
die
"
failed to parse federation metadata:
$
error
";
}
foreach
my
$entry
(
@$entities
)
{
...
...
@@ -118,28 +117,28 @@ foreach my $id (keys %{$configuration->{federations}}) {
);
$entity
->
update
();
}
else
{
eval
{
$entity
=
AccountManager::Data::
Entity
->
new
(
db
=>
$db
,
type
=>
$entry
->
{
type
},
entityid
=>
$entry
->
{
entityid
},
display_name
=>
$entry
->
{
display_name
},
information_url
=>
$entry
->
{
information_url
},
organization_url
=>
$entry
->
{
organization_url
},
);
if
(
$entry
->
{
contacts
})
{
my
@contacts
=
uniq
grep
{
$_
}
map
{
$_
->
{
EmailAddress
}
}
@
{
$entry
->
{
contacts
}};
$entity
->
contacts
(
@contacts
);
}
$entity
->
federations
(
$id
);
$entity
=
AccountManager::Data::
Entity
->
new
(
db
=>
$db
,
type
=>
$entry
->
{
type
},
entityid
=>
$entry
->
{
entityid
},
display_name
=>
$entry
->
{
display_name
},
information_url
=>
$entry
->
{
information_url
},
organization_url
=>
$entry
->
{
organization_url
},
);
if
(
$entry
->
{
contacts
})
{
my
@contacts
=
uniq
grep
{
$_
}
map
{
$_
->
{
EmailAddress
}
}
@
{
$entry
->
{
contacts
}};
$entity
->
contacts
(
@contacts
);
}
$entity
->
federations
(
$id
);
try
{
$entity
->
save
();
};
if
(
$EVAL_ERROR
)
{
warn
"
error while processing entity
$entry
->{entityid}:
$EVAL_ERROR
";
}
catch
(
$error
)
{
warn
"
error while processing entity
$entry
->{entityid}:
$error
";
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment