Test the remote_user and http_x_remote user backends
This commit is contained in:
parent
09bde14e50
commit
c2387403dd
@ -109,6 +109,34 @@ class TestBaseAuthRequests(BaseTest):
|
||||
"bcrypt",
|
||||
"tmp:$2y$05$oD7hbiQFQlvCM7zoalo/T.MssV3VNTRI3w5KDnj8NTUKJNWfVpvRq")
|
||||
|
||||
def test_remote_user(self):
|
||||
self.configuration.set("auth", "type", "remote_user")
|
||||
self.application = Application(self.configuration, self.logger)
|
||||
status, _, answer = self.request(
|
||||
"PROPFIND", "/",
|
||||
"""<?xml version="1.0" encoding="utf-8"?>
|
||||
<propfind xmlns="DAV:">
|
||||
<prop>
|
||||
<current-user-principal />
|
||||
</prop>
|
||||
</propfind>""", REMOTE_USER="test")
|
||||
assert status == 207
|
||||
assert ">/test/<" in answer
|
||||
|
||||
def test_http_x_remote_user(self):
|
||||
self.configuration.set("auth", "type", "http_x_remote_user")
|
||||
self.application = Application(self.configuration, self.logger)
|
||||
status, _, answer = self.request(
|
||||
"PROPFIND", "/",
|
||||
"""<?xml version="1.0" encoding="utf-8"?>
|
||||
<propfind xmlns="DAV:">
|
||||
<prop>
|
||||
<current-user-principal />
|
||||
</prop>
|
||||
</propfind>""", HTTP_X_REMOTE_USER="test")
|
||||
assert status == 207
|
||||
assert ">/test/<" in answer
|
||||
|
||||
def test_custom(self):
|
||||
"""Custom authentication."""
|
||||
self.configuration.set("auth", "type", "tests.custom.auth")
|
||||
|
Loading…
x
Reference in New Issue
Block a user