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

more consistency in log messages

parent 08dc4956
Branches
Tags
No related merge requests found
...@@ -303,7 +303,7 @@ sub req_select_email { ...@@ -303,7 +303,7 @@ sub req_select_email {
my $entities = $metadata->parse(id => $entityid); my $entities = $metadata->parse(id => $entityid);
my $entity = $entities->[0]; my $entity = $entities->[0];
$self->abort( $self->abort(
log => sprintf("No such SP '%s' in metadata", $entityid), log => "No such SP $entityid in metadata",
user => "no_such_entity" user => "no_such_entity"
) if !$entity; ) if !$entity;
...@@ -314,7 +314,7 @@ sub req_select_email { ...@@ -314,7 +314,7 @@ sub req_select_email {
# save in DB # save in DB
$self->abort( $self->abort(
log => "Failed to save service provider object", log => "Failed to save service provider",
user => "internal" user => "internal"
) if !$sp->save(); ) if !$sp->save();
} }
...@@ -378,11 +378,7 @@ sub req_complete_challenge { ...@@ -378,11 +378,7 @@ sub req_complete_challenge {
## Check that email is a known contact for this SP ## Check that email is a known contact for this SP
$self->abort( $self->abort(
log => sprintf( log => "Requested a token for SP $entityid with unautorized address $email",
"Requested a token for %s for an unautorized address '%s'",
$entityid,
$email
),
user => "internal", user => "internal",
) if !$provider->is_contact($email); ) if !$provider->is_contact($email);
...@@ -395,7 +391,7 @@ sub req_complete_challenge { ...@@ -395,7 +391,7 @@ sub req_complete_challenge {
if ($old_token->load(speculative => 1)) { if ($old_token->load(speculative => 1)) {
$self->abort( $self->abort(
log => sprintf("Failed to delete previous authentication token with ID %s", $old_token->id()), log => "Failed to delete old authentication token",
user => "internal" user => "internal"
) if !$old_token->delete(); ) if !$old_token->delete();
} }
...@@ -414,7 +410,7 @@ sub req_complete_challenge { ...@@ -414,7 +410,7 @@ sub req_complete_challenge {
); );
$self->abort( $self->abort(
log => "Failed to save service authentication token", log => "Failed to save creation authentication token",
user => "internal" user => "internal"
) if !$token->save(); ) if !$token->save();
...@@ -560,10 +556,7 @@ sub req_create_accounts { ...@@ -560,10 +556,7 @@ sub req_create_accounts {
} }
$self->abort( $self->abort(
log => sprintf( log => "Failed to create test accounts for SP $entityid",
"Failed to create test accounts for SP with entityid %s",
$entityid
),
user => "accounts_creation_failure" user => "accounts_creation_failure"
) if !@accounts; ) if !@accounts;
...@@ -578,11 +571,8 @@ sub req_create_accounts { ...@@ -578,11 +571,8 @@ sub req_create_accounts {
); );
}; };
$self->abort( $self->abort(
log => sprintf( log => "Failed to create simpleSAMLphp configuration file: $EVAL_ERROR",
"Failed to create simpleSAMLphp configuration file: %s", user => "accounts_creation_failure"
$EVAL_ERROR
),
user => "accounts_creation_failed"
) if $EVAL_ERROR; ) if $EVAL_ERROR;
$self->{logger}->infof( $self->{logger}->infof(
...@@ -692,8 +682,8 @@ sub get_parameter { ...@@ -692,8 +682,8 @@ sub get_parameter {
if ($patterns{$name}) { if ($patterns{$name}) {
$self->abort( $self->abort(
log => "Incorrect parameter format: entityid", log => "Incorrect parameter format: $name",
user => "format_entityid" user => "format_$name"
) if $value !~ $patterns{$name}; ) if $value !~ $patterns{$name};
} }
...@@ -726,20 +716,12 @@ sub check_token { ...@@ -726,20 +716,12 @@ sub check_token {
); );
$self->abort( $self->abort(
log => sprintf( log => "No such authentication token $secret",
"Failed to validate authentication token %s for entityid %s",
$secret,
$args{entityid}
),
user => "wrong_token" user => "wrong_token"
) if !$token->load(speculative => 1); ) if !$token->load(speculative => 1);
$self->abort( $self->abort(
log => sprintf( log => "Authentication token $secret cannot be used for SP $args{entityid}",
"Authentication token %s cannot be used for SP with entityid %s",
$secret,
$args{entityid}
),
user => "wrong_token_for_sp" user => "wrong_token_for_sp"
) if $token->sp_entityid() ne $args{entityid}; ) if $token->sp_entityid() ne $args{entityid};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment