Skip to content
Snippets Groups Projects
Commit c9f96da1 authored by ale's avatar ale
Browse files

make the mod_sso .htaccess test use its own SSOService

parent 8b6827ec
No related branches found
No related tags found
No related merge requests found
AuthType SSO
SSOService service.example.com/
SSOService service.example.com/protected-htaccess/
Require user testuser
......@@ -96,8 +96,8 @@ class HttpdIntegrationTest(unittest.TestCase):
def tearDown(self):
_stop_httpd(self.httpd)
def _ticket(self, user="testuser", group="group1"):
t = sso.Ticket(user, "service.example.com/", "example.com", set([group]))
def _ticket(self, user="testuser", group="group1", service="service.example.com/"):
t = sso.Ticket(user, service, "example.com", set([group]))
signedt = self.signer.sign(t)
print 'ticket:', signedt
return signedt
......@@ -172,15 +172,15 @@ class HttpdIntegrationTest(unittest.TestCase):
("protected-htaccess -> redirect",
{"url": "/protected-htaccess/index.html",
"status": 302,
"location": "https://login.example.com/?s=service.example.com%2F&d=https%3A%2F%2Fservice.example.com%2Fprotected-htaccess%2Findex.html"}),
"location": "https://login.example.com/?s=service.example.com%2Fprotected-htaccess%2F&d=https%3A%2F%2Fservice.example.com%2Fprotected-htaccess%2Findex.html"}),
("protected-htaccess with cookie -> ok",
{"url": "/protected-htaccess/index.html",
"cookie": mkcookie(self._ticket()),
"cookie": mkcookie(self._ticket(service="service.example.com/protected-htaccess/")),
"status": 200,
"body": "ok"}),
("protected-htaccess with cookie wrong user -> fail",
{"url": "/protected-htaccess/index.html",
"cookie": mkcookie(self._ticket(user="wronguser")),
"cookie": mkcookie(self._ticket(user="wronguser", service="service.example.com/protected-htaccess/")),
"status": 401 }),
]
for name, check in checks:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment