From 097763e8189a3a60b4c1a009277ba765f07539b4 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse <guillaume.rousse@renater.fr> Date: Fri, 24 Nov 2017 17:00:54 +0100 Subject: [PATCH] drop useless checks no failure scenario identified so far.. --- bin/account-manager.pl.in | 10 ---------- lib/IdPAccountManager/WebRequest.pm | 11 ----------- 2 files changed, 21 deletions(-) diff --git a/bin/account-manager.pl.in b/bin/account-manager.pl.in index 802827e..1364137 100755 --- a/bin/account-manager.pl.in +++ b/bin/account-manager.pl.in @@ -93,9 +93,6 @@ sub add_account { scope => $configuration->{idp}->{scope}, ); - die "Failed to create test account\n" - unless $test_account; - my $entity = $options{sp_entityid}; my $validity_period = $configuration->{$entity}->{account_validity_period} || @@ -210,8 +207,6 @@ sub add_provider { contacts => $options{contacts}, displayname => $options{displayname} ); - die "failed to create service provider\n" - unless $provider; } $provider->save() or die "failed to save service provider"; @@ -316,9 +311,6 @@ sub add_token { sp_entityid => $options{sp_entityid} ); - die "failed to create authentication token\n" - unless $token; - ## First remove token if on exist for this email+SP if ($token->load(speculative => 1)) { $token->delete() or die "failed to delete authentication token\n"; @@ -328,8 +320,6 @@ sub add_token { email_address => $options{email_address}, sp_entityid => $options{sp_entityid} ); - die "failed to create authentication token\n" - unless $token; } $token->save() or die "failed to save authentication token\n"; diff --git a/lib/IdPAccountManager/WebRequest.pm b/lib/IdPAccountManager/WebRequest.pm index 0de49e5..3470138 100644 --- a/lib/IdPAccountManager/WebRequest.pm +++ b/lib/IdPAccountManager/WebRequest.pm @@ -323,11 +323,6 @@ sub req_generate_token { email_address => $self->{in}->{email_address}, sp_entityid => $self->{in}->{sp_entityid} ); - unless (defined $token) { - push @{ $self->{out}->{errors} }, "internal"; - $self->{logger}->error("Failed to create authentication token"); - return; - } ## First remove token if one exist for this email+SP if ($token->load(speculative => 1)) { @@ -345,11 +340,6 @@ sub req_generate_token { email_address => $self->{in}->{email_address}, sp_entityid => $self->{in}->{sp_entityid} ); - unless (defined $token) { - push @{ $self->{out}->{errors} }, "internal"; - $self->{logger}->error("Failed to create authentication token"); - return; - } } unless ($token->save()) { @@ -479,7 +469,6 @@ sub req_validate_token { sp_entityid => $entity, scope => $self->{configuration}->{idp}->{scope}, ); - next unless $account; next unless $account->save(accounts_validity_period => $validity_period); push @accounts, $account; } -- GitLab