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