Commit 2214522b authored by ale's avatar ale

Add a custom mod_sso test

Matches a specific production config that needed to be tested.
parent f3d09f8c
......@@ -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()
......
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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment