Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
plone.openid.tests.testAuthentication.TestOpenIdAuthentication Class Reference
Inheritance diagram for plone.openid.tests.testAuthentication.TestOpenIdAuthentication:
Inheritance graph
[legend]
Collaboration diagram for plone.openid.tests.testAuthentication.TestOpenIdAuthentication:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def buildServerResponse
def testEmptyAuthentication
def testEmptyStringIdentityAuthentication
def testUnknownOpenIdSource
def testServerAuthentication
def testIncompleteServerAuthentication
def afterSetUp

Static Public Attributes

 layer = PloneOpenId
string identity = "http://plone.myopenid.com"
dictionary server_response

Detailed Description

Definition at line 5 of file testAuthentication.py.


Member Function Documentation

Reimplemented from plone.session.tests.sessioncase.PloneSessionTestCase.

Definition at line 29 of file oitestcase.py.

00029 
00030     def afterSetUp(self):
00031         PloneSessionTestCase.afterSetUp(self)
00032         self.app.folder = self.folder
00033 
00034         if self.folder.pas.hasObject("openid"):
00035             self.app.folder.pas._delObject("openid")
00036 
00037         self.app.folder.pas._setObject("openid", OpenIdPlugin("openid"))

Here is the call graph for this function:

Definition at line 7 of file testAuthentication.py.

00007 
00008     def buildServerResponse(self):
00009         credentials={}
00010         for field in [ "nonce", "openid.assoc_handle", "openid.return_to",
00011                         "openid.signed", "openid.sig",
00012                         "openid.invalidate_handle", "openid.mode"]:
00013             credentials[field]=field
00014         credentials["openid.identity"]=self.identity
00015         credentials["openid.source"]="server"
00016         
00017         # this isn't part of the server response, but is added to the
00018         # credentials by PAS
00019         credentials["extractor"] = "openid"
00020 
00021         return credentials
00022 

Here is the caller graph for this function:

Test if we do not invent an identity out of thin air.

Definition at line 23 of file testAuthentication.py.

00023 
00024     def testEmptyAuthentication(self):
00025         """Test if we do not invent an identity out of thin air.
00026         """
00027         creds=self.folder.pas.openid.authenticateCredentials({})
00028         self.assertEqual(creds, None)

Test coverage for bug #7176, where an 
   "" (i.e. an empty string) identity passed to 
   authenticationCredentials should return fail authentication

Definition at line 29 of file testAuthentication.py.

00029 
00030     def testEmptyStringIdentityAuthentication(self):
00031         """Test coverage for bug #7176, where an 
00032            "" (i.e. an empty string) identity passed to 
00033            authenticationCredentials should return fail authentication
00034         """
00035         credentials=self.buildServerResponse()
00036         credentials["openid.identity"]=""
00037         creds=self.folder.pas.openid.authenticateCredentials(credentials)
00038         self.assertEqual(creds, None)

Here is the call graph for this function:

Test authentication of OpenID server responses.

Definition at line 54 of file testAuthentication.py.

00054 
00055     def testIncompleteServerAuthentication(self):
00056         """Test authentication of OpenID server responses.
00057         """
00058         credentials=self.buildServerResponse()
00059         del credentials["openid.sig"]
00060         creds=self.folder.pas.openid.authenticateCredentials(credentials)
00061         self.assertEqual(creds, None)
00062 

Here is the call graph for this function:

Test authentication of OpenID server responses.

Definition at line 46 of file testAuthentication.py.

00046 
00047     def testServerAuthentication(self):
00048         """Test authentication of OpenID server responses.
00049         """
00050         credentials=self.buildServerResponse()
00051         creds=self.folder.pas.openid.authenticateCredentials(credentials)
00052         self.assertEqual(creds, (self.identity, self.identity))
00053 

Here is the call graph for this function:

Test if an incorrect source does not produce unexpected exceptions.

Definition at line 39 of file testAuthentication.py.

00039 
00040     def testUnknownOpenIdSource(self):
00041         """Test if an incorrect source does not produce unexpected exceptions.
00042         """
00043         creds=self.folder.pas.openid.authenticateCredentials({"openid.source" : "x"})
00044         self.assertEqual(creds, None)
00045 


Member Data Documentation

string plone.openid.tests.oitestcase.OpenIdTestCase.identity = "http://plone.myopenid.com" [static, inherited]

Definition at line 17 of file oitestcase.py.

plone.openid.tests.oitestcase.OpenIdTestCase.layer = PloneOpenId [static, inherited]

Reimplemented from plone.session.tests.sessioncase.PloneSessionTestCase.

Definition at line 15 of file oitestcase.py.

Initial value:
{
            "openid.mode"              : "id_res",
            "nonce"                    : "nonce",
            "openid.identity"          : "http://plone.myopenid.com",
            "openid.assoc_handle"      : "assoc_handle",
            "openid.return_to"         : "return_to",
            "openid.signed"            : "signed",
            "openid.sig"               : "sig",
            "openid.invalidate_handle" : "invalidate_handle",
            }

Definition at line 18 of file oitestcase.py.


The documentation for this class was generated from the following file: