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
6c015494
Commit
6c015494
authored
7 years ago
by
Guillaume ROUSSE
Browse files
Options
Downloads
Patches
Plain Diff
don't return undef explicitely, to please perlcritic
parent
eb77a56a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/IdPAccountManager/WebRequest.pm
+22
-22
22 additions, 22 deletions
lib/IdPAccountManager/WebRequest.pm
with
22 additions
and
22 deletions
lib/IdPAccountManager/WebRequest.pm
+
22
−
22
View file @
6c015494
...
...
@@ -98,7 +98,7 @@ sub execute {
$self
->
{
logger
}
->
error
(
"
Incorrect parameter format :
$parameter
"
);
return
undef
;
return
;
}
}
...
...
@@ -191,7 +191,7 @@ sub req_account_wizard {
if
(
$EVAL_ERROR
)
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
internal
";
$self
->
{
logger
}
->
error
("
Failed to load federation metadata:
$EVAL_ERROR
");
return
undef
;
return
;
}
$self
->
{
out
}
->
{
metadata
}
=
$metadata
->
parse
(
type
=>
'
sp
');
...
...
@@ -209,7 +209,7 @@ sub req_select_sp {
unless
(
$self
->
{
in
}
->
{
sp_entityid
})
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
missing_sp_entityid
";
$self
->
{
logger
}
->
error
("
Missing parameter sp_entityid
");
return
undef
;
return
;
}
# Create a persistent service provider object
...
...
@@ -232,7 +232,7 @@ sub req_select_sp {
if
(
$EVAL_ERROR
)
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
internal
";
$self
->
{
logger
}
->
error
("
Failed to load federation metadata:
$EVAL_ERROR
");
return
undef
;
return
;
}
my
$sps
=
$metadata
->
parse
(
id
=>
$self
->
{
in
}
->
{
sp_entityid
});
...
...
@@ -241,7 +241,7 @@ sub req_select_sp {
$self
->
{
logger
}
->
errorf
(
"
No such SP '%s' in metadata
",
$self
->
{
in
}
->
{
sp_entityid
}
);
return
undef
;
return
;
}
my
$sp
=
$sps
->
[
0
];
...
...
@@ -254,7 +254,7 @@ sub req_select_sp {
unless
(
$provider
->
save
())
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
internal
";
$self
->
{
logger
}
->
error
("
Failed to save service provider object
");
return
undef
;
return
;
}
}
...
...
@@ -279,13 +279,13 @@ sub req_generate_token {
unless
(
$self
->
{
in
}
->
{
sp_entityid
})
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
missing_sp_entityid
";
$self
->
{
logger
}
->
error
("
Missing parameter sp_entityid
");
return
undef
;
return
;
}
unless
(
$self
->
{
in
}
->
{
email_address
})
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
missing_email_address
";
$self
->
{
logger
}
->
error
("
Missing parameter email_address
");
return
undef
;
return
;
}
my
$provider
=
IdPAccountManager::
ServiceProvider
->
new
(
...
...
@@ -296,7 +296,7 @@ sub req_generate_token {
unless
(
$provider
->
load
(
speculative
=>
1
))
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
no_such_entity
";
$self
->
{
logger
}
->
errorf
("
No such SP '%s' in database
",
$self
->
{
in
}
->
{
sp_entityid
});
return
undef
;
return
;
}
if
(
$self
->
{
configuration
}
->
{
dev_sp_contact
})
{
...
...
@@ -315,7 +315,7 @@ sub req_generate_token {
$self
->
{
in
}
->
{
sp_entityid
},
$self
->
{
in
}
->
{
email_address
}
);
return
undef
;
return
;
}
my
$token
=
IdPAccountManager::
AuthenticationToken
->
new
(
...
...
@@ -326,7 +326,7 @@ sub req_generate_token {
unless
(
defined
$token
)
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
internal
";
$self
->
{
logger
}
->
error
("
Failed to create authentication token
");
return
undef
;
return
;
}
## First remove token if one exist for this email+SP
...
...
@@ -337,7 +337,7 @@ sub req_generate_token {
"
Failed to delete previous authentication token with ID %s
",
$token
->
id
()
);
return
undef
;
return
;
}
$token
=
IdPAccountManager::
AuthenticationToken
->
new
(
...
...
@@ -348,14 +348,14 @@ sub req_generate_token {
unless
(
defined
$token
)
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
internal
";
$self
->
{
logger
}
->
error
("
Failed to create authentication token
");
return
undef
;
return
;
}
}
unless
(
$token
->
save
())
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
internal
";
$self
->
{
logger
}
->
error
("
Failed to save authentication token
");
return
undef
;
return
;
}
$self
->
{
out
}
->
{
email_address
}
=
$self
->
{
in
}
->
{
email_address
};
...
...
@@ -369,7 +369,7 @@ sub req_generate_token {
open
(
my
$handle
,
'
|-
',
"
$sendmail
-f
$sender
$recipient
")
or
do
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
mail_notification_error
";
$self
->
{
logger
}
->
errorf
("
Unable to run sendmail executable: %s
",
$ERRNO
);
return
undef
;
return
;
};
my
$tt2
=
Template
->
new
({
...
...
@@ -395,7 +395,7 @@ sub req_generate_token {
unless
(
$tt2
->
process
(
$template
,
$data
,
$handle
))
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
mail_notification_error
";
$self
->
{
logger
}
->
errorf
("
Mail notification error: %s
",
$tt2
->
error
());
return
undef
;
return
;
}
close
$handle
;
...
...
@@ -419,13 +419,13 @@ sub req_validate_token {
unless
(
$self
->
{
in
}
->
{
sp_entityid
})
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
missing_sp_entityid
";
$self
->
{
logger
}
->
error
("
Missing parameter sp_entityid
");
return
undef
;
return
;
}
unless
(
$self
->
{
in
}
->
{
authentication_token
})
{
push
@
{
$self
->
{
out
}
->
{
errors
}
},
"
missing_authentication_token
";
$self
->
{
logger
}
->
error
("
Missing parameter authentication_token
");
return
undef
;
return
;
}
my
$token
=
IdPAccountManager::
AuthenticationToken
->
new
(
...
...
@@ -440,7 +440,7 @@ sub req_validate_token {
$self
->
{
in
}
->
{
authentication_token
},
$self
->
{
in
}
->
{
sp_entityid
}
);
return
undef
;
return
;
}
if
(
!
$token
->
sp_entityid
()
eq
$self
->
{
in
}
->
{
sp_entityid
})
{
...
...
@@ -450,7 +450,7 @@ sub req_validate_token {
$self
->
{
in
}
->
{
authentication_token
},
$self
->
{
in
}
->
{
sp_entityid
}
);
return
undef
;
return
;
}
## delete the token
...
...
@@ -484,7 +484,7 @@ sub req_validate_token {
"
Failed to create test accounts for SP with entityid %s
",
$self
->
{
in
}
->
{
sp_entityid
}
);
return
undef
;
return
;
}
## Update simpleSAMLphp configuration to enable test accounts
...
...
@@ -501,7 +501,7 @@ sub req_validate_token {
"
Failed to create simpleSAMLphp configuration file: %s
",
$EVAL_ERROR
);
return
undef
;
return
;
}
$self
->
{
logger
}
->
infof
(
...
...
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