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
95aef9bb
Commit
95aef9bb
authored
7 years ago
by
Guillaume ROUSSE
Browse files
Options
Downloads
Patches
Plain Diff
more explicit usage syntax
parent
e709ff8c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/account-manager-client.pl
+54
-55
54 additions, 55 deletions
bin/account-manager-client.pl
with
54 additions
and
55 deletions
bin/account-manager-client.pl
+
54
−
55
View file @
95aef9bb
...
...
@@ -23,29 +23,30 @@ use IdPAccountManager::AuthenticationToken;
use
IdPAccountManager::
Logger
;
my
%options
;
unless
(
GetOptions
(
\
%options
,
'
add_test_account
',
'
account_profile=s
',
'
sp_entityid=s
',
'
list_test_accounts
',
'
parse_federation_metadata
',
'
list_service_providers
',
'
list_authentication_tokens
',
'
get_authentication_token
',
'
add_authentication_token
',
'
email_address=s
',
'
token=s
',
'
send_notice
',
'
filter_expired
',
'
delete
',
'
add_service_provider
',
'
contacts=s
',
'
displayname=s
'
)
)
{
pod2usage
(
-
message
=>
"
unknown option, aborting
\n
",
-
verbose
=>
0
);
}
if
(
$options
{'
add_test_account
'})
{
GetOptions
(
\
%options
,
'
account_profile=s
',
'
contacts=s
',
'
delete
',
'
displayname=s
',
'
email_address=s
',
'
filter_expired
',
'
sp_entityid=s
',
'
token=s
',
)
or
pod2usage
(
-
message
=>
"
unknown option, aborting
\n
",
-
verbose
=>
0
);
my
$action
=
$ARGV
[
0
];
pod2usage
(
-
message
=>
"
no action given, aborting
\n
",
-
verbose
=>
0
)
unless
$action
;
if
(
$action
eq
'
add_test_account
')
{
pod2usage
(
-
message
=>
"
missing account_profile option, aborting
\n
",
...
...
@@ -71,7 +72,7 @@ if ($options{'add_test_account'}) {
printf
"
Account created:
\n\t
userid: user%d
\n\t
password: %s
\n
",
$test_account
->
get
('
id
'),
$test_account
->
get
('
user_password
');
}
elsif
(
$
op
tion
s
{
'
list_test_accounts
'
}
)
{
}
elsif
(
$
ac
tion
eq
'
list_test_accounts
')
{
my
%args
;
if
(
$options
{'
sp_entityid
'})
{
...
...
@@ -109,7 +110,7 @@ if ($options{'add_test_account'}) {
printf
"
Update simpleSamlPhp configuration file...
\n
";
}
}
elsif
(
$
op
tion
s
{
'
parse_federation_metadata
'
}
)
{
}
elsif
(
$
ac
tion
eq
'
parse_federation_metadata
')
{
my
$federation_metadata
=
IdPAccountManager::
SAMLMetadata
->
new
();
die
"
unable to load federation metadata
\n
"
...
...
@@ -135,7 +136,7 @@ if ($options{'add_test_account'}) {
$federation_metadata
->
{'
federation_metadata_as_hashref
'},
0
,
\
*STDOUT
);
}
elsif
(
$
op
tion
s
{
'
add_service_provider
'
}
)
{
}
elsif
(
$
ac
tion
eq
'
add_service_provider
')
{
pod2usage
(
-
message
=>
"
missing sp_entityid option, aborting
\n
",
...
...
@@ -174,7 +175,7 @@ if ($options{'add_test_account'}) {
printf
"
Service Provider created
\n
";
}
elsif
(
$
op
tion
s
{
'
list_service_providers
'
}
)
{
}
elsif
(
$
ac
tion
eq
'
list_service_providers
')
{
my
%args
;
...
...
@@ -188,7 +189,7 @@ if ($options{'add_test_account'}) {
$service_provider
->
print
();
}
}
elsif
(
$
op
tion
s
{
'
list_authentication_tokens
'
}
)
{
}
elsif
(
$
ac
tion
eq
'
list_authentication_tokens
')
{
my
%args
;
if
(
$options
{'
sp_entityid
'})
{
...
...
@@ -221,7 +222,7 @@ if ($options{'add_test_account'}) {
}
}
elsif
(
$
op
tion
s
{
'
get_authentication_token
'
}
)
{
}
elsif
(
$
ac
tion
eq
'
get_authentication_token
')
{
my
%args
;
if
(
$options
{'
token
'})
{
...
...
@@ -242,8 +243,7 @@ if ($options{'add_test_account'}) {
$authentication_token
->
print
();
}
elsif
(
$options
{'
add_authentication_token
'})
{
}
elsif
(
$action
eq
'
add_authentication_token
')
{
pod2usage
(
-
message
=>
"
missing email_address option, aborting
\n
",
...
...
@@ -281,7 +281,7 @@ if ($options{'add_test_account'}) {
$authentication_token
->
print
();
}
elsif
(
$
op
tion
s
{
'
send_notice
'
}
)
{
}
elsif
(
$
ac
tion
eq
'
send_notice
')
{
pod2usage
(
-
message
=>
"
missing email_address option, aborting
\n
",
...
...
@@ -305,10 +305,9 @@ if ($options{'add_test_account'}) {
}
else
{
pod2usage
(
-
message
=>
"
missing argument
, aborting
\n
",
-
message
=>
"
invalid action '
$action
'
, aborting
\n
",
-
verbose
=>
0
);
}
__END__
...
...
@@ -319,41 +318,41 @@ account-manager-client.pl - Command line client to the Test Account manager
=head1 SYNOPSIS
B<account-manager-client.pl> B<
--
add_test_account>
B<account-manager-client.pl> B<add_test_account>
S<B<--account_profile> I<string>>
S<B<--sp_entityid> I<string>>
B<account-manager-client.pl> B<
--
list_test_accounts>
B<account-manager-client.pl> B<list_test_accounts>
S<[B<--account_profile> I<string>]>
S<[B<--sp_entityid> I<string>]>
[B<--filter_expired>]
[B<--delete>]
B<account-manager-client.pl> B<
--
parse_federation_metadata>
B<account-manager-client.pl> B<parse_federation_metadata>
S<[B<--sp_entityid> I<string>]>
B<account-manager-client.pl> B<
--
add_service_provider>
B<account-manager-client.pl> B<add_service_provider>
S<B<--sp_entityid> I<string>>
S<B<--contact> I<string>>
S<[B<--displayname> I<string>]>
B<account-manager-client.pl> B<
--
list_service_providers>
B<account-manager-client.pl> B<list_service_providers>
B<account-manager-client.pl> B<
--
list_authentication_tokens>
B<account-manager-client.pl> B<list_authentication_tokens>
S<B<--sp_entityid> I<string>>
S<[B<--token> I<string>]>
[B<--filter_expired>]
[B<--delete>]
B<account-manager-client.pl> B<
--
get_authentication_token>
B<account-manager-client.pl> B<get_authentication_token>
S<B<--sp_entityid> I<string>>
S<[B<--token> I<string>]>
B<account-manager-client.pl> B<
--
add_authentication_token>
B<account-manager-client.pl> B<add_authentication_token>
S<B<--sp_entityid> I<string>>
S<B<--email_address> I<string>>
B<account-manager-client.pl> B<
--
send_notice>
B<account-manager-client.pl> B<send_notice>
S<B<--email_address> I<string>>
=head1 DESCRIPTION
...
...
@@ -364,64 +363,64 @@ functions.
=head1 EXAMPLES
$> account-manager-client.pl
--
add_test_account \
$> account-manager-client.pl add_test_account \
--sp_entityid=https://test.federation.renater.fr/test/ressource
--account_profile=student1 \
Adds a new test account.
$> account-manager-client.pl
--
list_test_accounts \
$> account-manager-client.pl list_test_accounts \
--sp_entityid=https://test.federation.renater.fr/test/ressource \
--account_profile=student1
List all test accounts. Criterias can be added to filter test accounts.
$> account-manager-client.pl
--
list_test_accounts --filter_expired
$> account-manager-client.pl list_test_accounts --filter_expired
List all expired test accounts.
$> account-manager-client.pl
--
list_test_accounts --filter_expired \
$> account-manager-client.pl list_test_accounts --filter_expired \
--delete
Remove all expired test accounts from DB.
$> account-manager-client.pl
--
parse_federation_metadata
$> account-manager-client.pl parse_federation_metadata
Parses the SAML metadata file, as defined by the
C<federation_metadata_file_path> configuration parameter.
$> account-manager-client.pl
--
list_authentication_tokens \
$> account-manager-client.pl list_authentication_tokens \
--sp_entityid=https://test.federation.renater.fr/test/ressource \
--token=dhj67sjJ
List all authentication tokens. Criterias can be added to filter tokens.
$> account-manager-client.pl
--
list_authentication_tokens \
$> account-manager-client.pl list_authentication_tokens \
--filter_expired
List all expired authentication tokens.
$> account-manager-client.pl
--
list_authentication_tokens \
$> account-manager-client.pl list_authentication_tokens \
--filter_expired --delete
Remove all expired authentication tokens from DB.
$> account-manager-client.pl
--
get_authentication_token \
$> account-manager-client.pl get_authentication_token \
--token=dhj67sjJ
Get informations on a token.
$> account-manager-client.pl
--
add_authentication_token \
$> account-manager-client.pl add_authentication_token \
--email_address=john@my.fqdn \
--sp_entityid=https://test.federation.renater.fr/test/ressource
Adds a new test account.
$> account-manager-client.pl
--
send_notice --email_address=john@my.fqdn
$> account-manager-client.pl send_notice --email_address=john@my.fqdn
Sends a mail notice to the specified email address.
$> account-manager-client.pl
--
add_service_provider \
$> account-manager-client.pl add_service_provider \
--sp_entityid=='https://test.federation.renater.fr/test/ressource _
--displayname='Test SP' --contacts=email1@dom,email2@dom
...
...
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