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

use shorter names for actions

parent e97f5d08
Branches
Tags
No related merge requests found
...@@ -60,14 +60,14 @@ IdPAccountManager::DB->register_db( ...@@ -60,14 +60,14 @@ IdPAccountManager::DB->register_db(
my $db = IdPAccountManager::DB->new(); my $db = IdPAccountManager::DB->new();
for ($action) { for ($action) {
when ('add_test_account') { add_test_account() } when ('add_account') { add_account() }
when ('list_test_accounts') { list_test_accounts() } when ('list_accounts') { list_accounts() }
when ('add_service_provider') { add_service_provider() } when ('add_provider') { add_provider() }
when ('list_service_providers') { list_service_providers() } when ('list_providers') { list_providers() }
when ('add_authentication_token') { add_authentication_token() } when ('add_token') { add_token() }
when ('get_authentication_token') { get_authentication_token() } when ('get_token') { get_token() }
when ('list_authentication_tokens') { list_authentication_tokens() } when ('list_tokens') { list_tokens() }
when ('parse_federation_metadata') { parse_federation_metadata() } when ('parse_metadata') { parse_metadata() }
default { default {
pod2usage( pod2usage(
-message => "invalid action '$action', aborting\n", -message => "invalid action '$action', aborting\n",
...@@ -76,7 +76,7 @@ for ($action) { ...@@ -76,7 +76,7 @@ for ($action) {
} }
} }
sub add_test_account { sub add_account {
pod2usage( pod2usage(
-message => "missing account_profile option, aborting\n", -message => "missing account_profile option, aborting\n",
-verbose => 0 -verbose => 0
...@@ -106,7 +106,7 @@ sub add_test_account { ...@@ -106,7 +106,7 @@ sub add_test_account {
} }
sub list_test_accounts { sub list_accounts {
my %args; my %args;
if ($options{sp_entityid}) { if ($options{sp_entityid}) {
push @{ $args{query} }, sp_entityid => $options{sp_entityid}; push @{ $args{query} }, sp_entityid => $options{sp_entityid};
...@@ -148,7 +148,7 @@ sub list_test_accounts { ...@@ -148,7 +148,7 @@ sub list_test_accounts {
} }
sub parse_federation_metadata { sub parse_metadata {
my $federation_metadata; my $federation_metadata;
eval { eval {
...@@ -168,7 +168,7 @@ sub parse_federation_metadata { ...@@ -168,7 +168,7 @@ sub parse_federation_metadata {
print Data::Dumper->Dump($data); print Data::Dumper->Dump($data);
} }
sub add_service_provider { sub add_provider {
pod2usage( pod2usage(
-message => "missing sp_entityid option, aborting\n", -message => "missing sp_entityid option, aborting\n",
...@@ -212,7 +212,7 @@ sub add_service_provider { ...@@ -212,7 +212,7 @@ sub add_service_provider {
} }
sub list_service_providers { sub list_providers {
my %args; my %args;
my $providers = IdPAccountManager::Data::ServiceProvider::Manager->get_serviceproviders(db => $db, %args); my $providers = IdPAccountManager::Data::ServiceProvider::Manager->get_serviceproviders(db => $db, %args);
...@@ -227,7 +227,7 @@ sub list_service_providers { ...@@ -227,7 +227,7 @@ sub list_service_providers {
} }
sub list_authentication_tokens { sub list_tokens {
my %args; my %args;
if ($options{sp_entityid}) { if ($options{sp_entityid}) {
...@@ -262,7 +262,7 @@ sub list_authentication_tokens { ...@@ -262,7 +262,7 @@ sub list_authentication_tokens {
} }
sub get_authentication_token { sub get_token {
my %args; my %args;
if ($options{token}) { if ($options{token}) {
...@@ -285,7 +285,7 @@ sub get_authentication_token { ...@@ -285,7 +285,7 @@ sub get_authentication_token {
} }
sub add_authentication_token { sub add_token {
pod2usage( pod2usage(
-message => "missing email_address option, aborting\n", -message => "missing email_address option, aborting\n",
...@@ -335,102 +335,102 @@ account-manager-client.pl - Command line client to the Test IdP Account manager ...@@ -335,102 +335,102 @@ account-manager-client.pl - Command line client to the Test IdP Account manager
=head1 SYNOPSIS =head1 SYNOPSIS
B<account-manager-client.pl> B<add_test_account> B<account-manager-client.pl> B<add_account>
S<B<--account_profile> I<string>> S<B<--account_profile> I<string>>
S<B<--sp_entityid> I<string>> S<B<--sp_entityid> I<string>>
B<account-manager-client.pl> B<list_test_accounts> B<account-manager-client.pl> B<list_accounts>
S<[B<--account_profile> I<string>]> S<[B<--account_profile> I<string>]>
S<[B<--sp_entityid> I<string>]> S<[B<--sp_entityid> I<string>]>
[B<--filter_expired>] [B<--filter_expired>]
[B<--delete>] [B<--delete>]
B<account-manager-client.pl> B<parse_federation_metadata> B<account-manager-client.pl> B<parse_metadata>
S<[B<--sp_entityid> I<string>]> S<[B<--sp_entityid> I<string>]>
B<account-manager-client.pl> B<add_service_provider> B<account-manager-client.pl> B<add_provider>
S<B<--sp_entityid> I<string>> S<B<--sp_entityid> I<string>>
S<B<--contact> I<string>> S<B<--contact> I<string>>
S<[B<--displayname> I<string>]> S<[B<--displayname> I<string>]>
B<account-manager-client.pl> B<list_service_providers> B<account-manager-client.pl> B<list_providers>
B<account-manager-client.pl> B<list_authentication_tokens> B<account-manager-client.pl> B<list_tokens>
S<B<--sp_entityid> I<string>> S<B<--sp_entityid> I<string>>
S<[B<--token> I<string>]> S<[B<--token> I<string>]>
[B<--filter_expired>] [B<--filter_expired>]
[B<--delete>] [B<--delete>]
B<account-manager-client.pl> B<get_authentication_token> B<account-manager-client.pl> B<get_token>
S<B<--sp_entityid> I<string>> S<B<--sp_entityid> I<string>>
S<[B<--token> I<string>]> S<[B<--token> I<string>]>
B<account-manager-client.pl> B<add_authentication_token> B<account-manager-client.pl> B<add_token>
S<B<--sp_entityid> I<string>> S<B<--sp_entityid> I<string>>
S<B<--email_address> I<string>> S<B<--email_address> I<string>>
=head1 DESCRIPTION =head1 DESCRIPTION
The Test Account manager instanciates test accounts associated to a SAML The Test Account manager instanciates test accounts associated to a SAML
Identity Provider. This script provides a command-line interface for most Identity Provider. This script provides a command-line interface for most
functions. functions.
=head1 EXAMPLES =head1 EXAMPLES
$> account-manager-client.pl add_test_account \ $> account-manager-client.pl add_account \
--sp_entityid https://test.federation.renater.fr/test/ressource \ --sp_entityid https://test.federation.renater.fr/test/ressource \
--account_profile student1 --account_profile student1
Adds a new test account. Adds a new test account.
$> account-manager-client.pl list_test_accounts \ $> account-manager-client.pl list_accounts \
--sp_entityid https://test.federation.renater.fr/test/ressource \ --sp_entityid https://test.federation.renater.fr/test/ressource \
--account_profile student1 --account_profile student1
List all test accounts. Criterias can be added to filter test accounts. 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_accounts --filter_expired
List all expired test accounts. List all expired test accounts.
$> account-manager-client.pl list_test_accounts --filter_expired \ $> account-manager-client.pl list_accounts --filter_expired \
--delete --delete
Remove all expired test accounts from DB. Remove all expired test accounts from DB.
$> account-manager-client.pl parse_federation_metadata $> account-manager-client.pl parse_metadata
Parses the SAML metadata file, as defined by the Parses the SAML metadata file, as defined by the
C<federation_metadata_file_path> configuration parameter. C<federation_metadata_file_path> configuration parameter.
$> account-manager-client.pl list_authentication_tokens \ $> account-manager-client.pl list_tokens \
--sp_entityid https://test.federation.renater.fr/test/ressource \ --sp_entityid https://test.federation.renater.fr/test/ressource \
--token dhj67sjJ --token dhj67sjJ
List all authentication tokens. Criterias can be added to filter tokens. List all authentication tokens. Criterias can be added to filter tokens.
$> account-manager-client.pl list_authentication_tokens \ $> account-manager-client.pl list_tokens \
--filter_expired --filter_expired
List all expired authentication tokens. List all expired authentication tokens.
$> account-manager-client.pl list_authentication_tokens \ $> account-manager-client.pl list_tokens \
--filter_expired --delete --filter_expired --delete
Remove all expired authentication tokens from DB. Remove all expired authentication tokens from DB.
$> account-manager-client.pl get_authentication_token \ $> account-manager-client.pl get_token \
--token dhj67sjJ --token dhj67sjJ
Get informations on a token. Get informations on a token.
$> account-manager-client.pl add_authentication_token \ $> account-manager-client.pl add_token \
--email_address john@my.fqdn \ --email_address john@my.fqdn \
--sp_entityid https://test.federation.renater.fr/test/ressource --sp_entityid https://test.federation.renater.fr/test/ressource
Adds a new test account. Adds a new test account.
$> account-manager-client.pl add_service_provider \ $> account-manager-client.pl add_provider \
--sp_entityid https://test.federation.renater.fr/test/ressource \ --sp_entityid https://test.federation.renater.fr/test/ressource \
--displayname 'Test SP' --contacts email1@dom,email2@dom --displayname 'Test SP' --contacts email1@dom,email2@dom
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment