Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lemonldap-ng
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maxime Besson
lemonldap-ng
Commits
5718f4bd
Commit
5718f4bd
authored
Dec 26, 2016
by
Xavier Guimard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify that Redirect and POST don't call SOAP [SAML] (#595)
parent
b4a60fdb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
48 deletions
+28
-48
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t
...-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t
+3
-24
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t
+11
-0
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t
...portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t
+3
-24
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t
+11
-0
No files found.
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t
View file @
5718f4bd
...
...
@@ -204,30 +204,9 @@ no warnings 'redefine';
sub
LWP
::UserAgent::request {
my
(
$self
,
$req
)
=
@_
;
ok
(
$req
->
uri
=~
m#http://auth.sp.com(.*)#
,
'
Request from IdP to SP
'
);
my
$url
=
$
1
;
my
$res
;
my
$s
=
$req
->
content
;
ok
(
$res
=
$sp
->
_post
(
$url
,
IO::
String
->
new
(
$s
),
length
=>
length
(
$s
),
type
=>
'
application/xml
',
),
'
Execute request
'
);
ok
(
(
$res
->
[
0
]
==
200
or
$res
->
[
0
]
==
400
),
'
Response is 200 or 400
'
)
or
explain
(
$res
->
[
0
],
"
200 or 400
"
);
ok
(
getHeader
(
$res
,
'
Content-Type
'
)
=~
m#^application/xml#
,
'
Content is XML
'
)
or
explain
(
$res
->
[
1
],
'
Content-Type => application/xml
'
);
my
$httpResp
=
HTTP::
Response
->
new
(
$res
->
[
0
],
'
OK
'
);
while
(
my
$name
=
shift
@
{
$res
->
[
1
]
}
)
{
$httpResp
->
header
(
$name
,
shift
(
@
{
$res
->
[
1
]
}
)
);
}
$httpResp
->
content
(
join
(
'',
@
{
$res
->
[
2
]
}
)
);
count
(
4
);
fail
('
POST should not launch SOAP requests
');
my
$httpResp
=
HTTP::
Response
->
new
(
500
);
count
(
1
);
return
$httpResp
;
}
...
...
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t
View file @
5718f4bd
...
...
@@ -266,6 +266,17 @@ count($maintests);
clean_sessions
();
done_testing
(
count
()
);
# Redefine LWP methods for tests
no
warnings
'
redefine
';
sub
LWP
::UserAgent::request {
my
(
$self
,
$req
)
=
@_
;
fail
('
POST should not launch SOAP requests
');
my
$httpResp
=
HTTP::
Response
->
new
(
500
);
count
(
1
);
return
$httpResp
;
}
sub
switch
{
my
$type
=
shift
;
@
Lemonldap::NG::Handler::Main::Reload::
_onReload
=
@
{
...
...
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t
View file @
5718f4bd
...
...
@@ -148,30 +148,9 @@ no warnings 'redefine';
sub
LWP
::UserAgent::request {
my
(
$self
,
$req
)
=
@_
;
ok
(
$req
->
uri
=~
m#http://auth.sp.com(.*)#
,
'
Request from SP to IdP
'
);
my
$url
=
$
1
;
my
$res
;
my
$s
=
$req
->
content
;
ok
(
$res
=
$sp
->
_post
(
$url
,
IO::
String
->
new
(
$s
),
length
=>
length
(
$s
),
type
=>
'
application/xml
',
),
'
Execute request
'
);
ok
(
(
$res
->
[
0
]
==
200
or
$res
->
[
0
]
==
400
),
'
Response is 200 or 400
'
)
or
explain
(
$res
->
[
0
],
"
200 or 400
"
);
ok
(
getHeader
(
$res
,
'
Content-Type
'
)
=~
m#^application/xml#
,
'
Content is XML
'
)
or
explain
(
$res
->
[
1
],
'
Content-Type => application/xml
'
);
my
$httpResp
=
HTTP::
Response
->
new
(
$res
->
[
0
],
'
OK
'
);
while
(
my
$name
=
shift
@
{
$res
->
[
1
]
}
)
{
$httpResp
->
header
(
$name
,
shift
(
@
{
$res
->
[
1
]
}
)
);
}
$httpResp
->
content
(
join
(
'',
@
{
$res
->
[
2
]
}
)
);
count
(
4
);
fail
('
Redirect should not launch SOAP requests
');
my
$httpResp
=
HTTP::
Response
->
new
(
500
);
count
(
1
);
return
$httpResp
;
}
...
...
lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t
View file @
5718f4bd
...
...
@@ -205,6 +205,17 @@ count($maintests);
clean_sessions
();
done_testing
(
count
()
);
# Redefine LWP methods for tests
no
warnings
'
redefine
';
sub
LWP
::UserAgent::request {
my
(
$self
,
$req
)
=
@_
;
fail
('
Redirect should not launch SOAP requests
');
my
$httpResp
=
HTTP::
Response
->
new
(
500
);
count
(
1
);
return
$httpResp
;
}
sub
switch
{
my
$type
=
shift
;
@
Lemonldap::NG::Handler::Main::Reload::
_onReload
=
@
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment