Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai
sso
Commits
2214522b
Commit
2214522b
authored
Sep 06, 2019
by
ale
Browse files
Add a custom mod_sso test
Matches a specific production config that needed to be tested.
parent
f3d09f8c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/mod_sso/test/htdocs/protected/index.html
0 → 100644
View file @
2214522b
hello
src/mod_sso/test/httpd_integration_test.py
View file @
2214522b
...
...
@@ -261,12 +261,12 @@ class HttpdIntegrationTestBase(unittest.TestCase):
name
,
check
[
"url"
],
location
,
check
[
"location"
]))
def
_login_workflow
(
self
,
host_header
,
url
,
sso_service
=
None
,
sso_login_url
=
None
):
if
not
sso_login_url
:
sso_login_url
=
"/sso_login"
if
not
sso_service
:
sso_service
=
host_header
+
os
.
path
.
dirname
(
url
)
if
not
sso_service
.
endswith
(
'/'
):
sso_service
+=
'/'
if
not
sso_login_url
:
sso_login_url
=
'/%s/sso_login'
%
sso_service
.
split
(
'/'
,
1
)[
1
]
cookies
=
Cookie
.
SimpleCookie
()
...
...
@@ -418,6 +418,14 @@ class WebmailIntegrationTestWithNonces(HttpdIntegrationTestBase):
def
test_login_workflow
(
self
):
self
.
_login_workflow
(
"service.example.com"
,
"/index.html"
)
class
SubdirIntegrationTest
(
HttpdIntegrationTestBase
):
CONFIG
=
'test-httpd-subdir.conf'
def
test_subdir
(
self
):
self
.
_login_workflow
(
"service.example.com"
,
"/protected/index.html"
)
if
__name__
==
"__main__"
:
unittest
.
main
()
...
...
src/mod_sso/test/test-httpd-subdir.conf
0 → 100644
View file @
2214522b
LoadModule
mpm_worker_module
/
usr
/
lib
/
apache2
/
modules
/
mod_mpm_worker
.
so
LoadModule
auth_basic_module
${
MODULEDIR
}/
mod_auth_basic
.
so
LoadModule
authn_core_module
${
MODULEDIR
}/
mod_authn_core
.
so
LoadModule
authz_core_module
${
MODULEDIR
}/
mod_authz_core
.
so
LoadModule
authz_user_module
${
MODULEDIR
}/
mod_authz_user
.
so
LoadModule
unique_id_module
${
MODULEDIR
}/
mod_unique_id
.
so
LoadModule
sso_module
${
TESTROOT
}/../.
libs
/
mod_sso
.
so
LoadModule
cgi_module
/
usr
/
lib
/
apache2
/
modules
/
mod_cgi
.
so
Listen
127
.
0
.
0
.
1
:${
APACHE_PORT
}
ServerName
test
PidFile
${
TESTROOT
}/
test
-
httpd
.
pid
Mutex
file
:${
TESTROOT
}
default
ErrorLog
${
APACHE_LOG
}
LogLevel
debug
SSOLoginServer
login
.
example
.
com
SSODomain
example
.
com
SSOPublicKeyFile
${
TESTROOT
}/
public
.
key
SSOSessionKeyFile
${
TESTROOT
}/
session
.
key
DocumentRoot
${
TESTROOT
}/
htdocs
<
Directory
"${TESTROOT}/htdocs"
>
require
all
granted
</
Directory
>
<
Location
"/protected"
>
AuthType
SSO
AuthName
test
SSOService
service
.
example
.
com
/
protected
/
require
valid
-
user
</
Location
>
Write
Preview
Supports
Markdown
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