[CalendarServer-changes] [3845] CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/ Twisted/twisted.web2.test.test_httpauth.patch
source_changes at macosforge.org
source_changes at macosforge.org
Thu Mar 12 10:39:25 PDT 2009
Revision: 3845
http://trac.macosforge.org/projects/calendarserver/changeset/3845
Author: exarkun at twistedmatrix.com
Date: 2009-03-12 10:39:25 -0700 (Thu, 12 Mar 2009)
Log Message:
-----------
Resolve conflicts
Modified Paths:
--------------
CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/Twisted/twisted.web2.test.test_httpauth.patch
Modified: CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/Twisted/twisted.web2.test.test_httpauth.patch
===================================================================
--- CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/Twisted/twisted.web2.test.test_httpauth.patch 2009-03-12 17:35:12 UTC (rev 3844)
+++ CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/Twisted/twisted.web2.test.test_httpauth.patch 2009-03-12 17:39:25 UTC (rev 3845)
@@ -1,13 +1,16 @@
Index: twisted/web2/test/test_httpauth.py
===================================================================
---- twisted/web2/test/test_httpauth.py (revision 19773)
+--- twisted/web2/test/test_httpauth.py (revision 26342)
+++ twisted/web2/test/test_httpauth.py (working copy)
-@@ -1,3 +1,4 @@
+@@ -3,6 +3,7 @@
+
+ from twisted.python.hashlib import md5
+ from twisted.internet import address
+from twisted.internet.defer import inlineCallbacks
- import md5
- from twisted.internet import address
from twisted.trial import unittest
-@@ -41,22 +42,25 @@
+ from twisted.cred import error
+ from twisted.web2 import http, responsecode
+@@ -44,22 +45,25 @@
self.username = 'dreid'
self.password = 'S3CuR1Ty'
@@ -35,7 +38,7 @@
def testIncorrectPadding(self):
response = base64.encodestring('%s:%s' % (
self.username,
-@@ -64,7 +68,7 @@
+@@ -67,7 +71,7 @@
response = response.strip('=')
@@ -44,7 +47,7 @@
self.failUnless(creds.checkPassword(self.password))
def testInvalidCredentials(self):
-@@ -135,6 +139,7 @@
+@@ -138,6 +142,7 @@
)
return expected
@@ -52,7 +55,7 @@
def test_getChallenge(self):
"""
Test that all the required fields exist in the challenge,
-@@ -142,42 +147,44 @@
+@@ -145,42 +150,44 @@
DigestCredentialFactory
"""
@@ -102,7 +105,7 @@
self.failUnless(creds.checkPassword('password'))
clientResponse = authRequest2 % (
-@@ -185,24 +192,25 @@
+@@ -188,24 +195,25 @@
self.getDigestResponse(challenge, "00000002"),
challenge['opaque'])
@@ -132,7 +135,7 @@
self.failIf(creds.checkPassword('password'))
def test_noUsername(self):
-@@ -247,20 +255,21 @@
+@@ -250,20 +258,21 @@
_trivial_GET)
self.assertEquals(str(e), "Invalid response, no opaque given.")
@@ -155,16 +158,16 @@
+ creds = (yield self.credentialFactory.decode(clientResponse, _trivial_GET))
self.failUnless(creds.checkHash(
- md5.md5('username:test realm:password').hexdigest()))
-@@ -268,6 +277,7 @@
+ md5('username:test realm:password').hexdigest()))
+@@ -271,6 +280,7 @@
self.failIf(creds.checkHash(
- md5.md5('username:test realm:bogus').hexdigest()))
+ md5('username:test realm:bogus').hexdigest()))
+ @inlineCallbacks
def test_invalidOpaque(self):
"""
Test that login fails when the opaque does not contain all the required
-@@ -276,7 +286,7 @@
+@@ -279,7 +289,7 @@
credentialFactory = FakeDigestCredentialFactory('md5', 'test realm')
@@ -173,7 +176,7 @@
self.assertRaises(
error.LoginFailed,
-@@ -302,6 +312,7 @@
+@@ -305,6 +315,7 @@
challenge['nonce'],
clientAddress.host)
@@ -181,7 +184,7 @@
def test_incompatibleNonce(self):
"""
Test that login fails when the given nonce from the response, does not
-@@ -310,7 +321,7 @@
+@@ -313,7 +324,7 @@
credentialFactory = FakeDigestCredentialFactory('md5', 'test realm')
@@ -190,7 +193,7 @@
badNonceOpaque = credentialFactory.generateOpaque(
'1234567890',
-@@ -330,6 +341,7 @@
+@@ -333,6 +344,7 @@
'',
clientAddress.host)
@@ -198,7 +201,7 @@
def test_incompatibleClientIp(self):
"""
Test that the login fails when the request comes from a client ip
-@@ -338,7 +350,7 @@
+@@ -341,7 +353,7 @@
credentialFactory = FakeDigestCredentialFactory('md5', 'test realm')
@@ -207,7 +210,7 @@
badNonceOpaque = credentialFactory.generateOpaque(
challenge['nonce'],
-@@ -351,6 +363,7 @@
+@@ -354,6 +366,7 @@
challenge['nonce'],
clientAddress.host)
@@ -215,7 +218,7 @@
def test_oldNonce(self):
"""
Test that the login fails when the given opaque is older than
-@@ -359,7 +372,7 @@
+@@ -362,7 +375,7 @@
credentialFactory = FakeDigestCredentialFactory('md5', 'test realm')
@@ -224,7 +227,7 @@
key = '%s,%s,%s' % (challenge['nonce'],
clientAddress.host,
-@@ -376,6 +389,7 @@
+@@ -379,6 +392,7 @@
challenge['nonce'],
clientAddress.host)
@@ -232,7 +235,7 @@
def test_mismatchedOpaqueChecksum(self):
"""
Test that login fails when the opaque checksum fails verification
-@@ -383,7 +397,7 @@
+@@ -386,7 +400,7 @@
credentialFactory = FakeDigestCredentialFactory('md5', 'test realm')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090312/7b9db0b1/attachment-0001.html>
More information about the calendarserver-changes
mailing list