Back to index

plone3  3.1.7
Classes | Functions | Variables
plone.protect.authenticator Namespace Reference

Classes

class  AuthenticatorView

Functions

def _getUserName
def _verify
def check
def AuthenticateForm

Variables

list __all__ = [ "AuthenticatorView", "AuthenticateForm", "check" ]

Function Documentation

Definition at line 15 of file authenticator.py.

00015 
00016 def _getUserName():
00017     user=getSecurityManager().getUser()
00018     if user is None:
00019         return "Anonymous User"
00020     return user.getUserName()
00021 

Here is the call graph for this function:

Here is the caller graph for this function:

def plone.protect.authenticator._verify (   request) [private]

Definition at line 22 of file authenticator.py.

00022 
00023 def _verify(request):
00024     auth=request.get("_authenticator")
00025     if auth is None:
00026         return False
00027 
00028     manager=getUtility(IKeyManager)
00029     ring=manager[u"_system"]
00030     user=_getUserName()
00031 
00032     for key in ring:
00033         if key is None:
00034             continue
00035         correct=hmac.new(key, user, sha).hexdigest()
00036         if correct==auth:
00037             return True
00038 
00039     return False
00040 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 63 of file authenticator.py.

00063 
00064 def AuthenticateForm(callable):
00065     return protect(check)(callable)
00066 
00067 deprecated("AuthenticateForm", "Please use the plone.protect.protect decorator")
00068 

Here is the call graph for this function:

Definition at line 57 of file authenticator.py.

00057 
00058 def check(request):
00059     if isinstance(request, HTTPRequest):
00060         if not _verify(request):
00061             raise Forbidden('Form authenticator is invalid.')
00062 

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

list plone.protect.authenticator.__all__ = [ "AuthenticatorView", "AuthenticateForm", "check" ]

Definition at line 69 of file authenticator.py.