Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
MoinMoin.auth.http.HTTPAuth Class Reference
Inheritance diagram for MoinMoin.auth.http.HTTPAuth:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.auth.http.HTTPAuth:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def decode_username
def transform_username
def request
def login
def logout
def login_hint

Public Attributes

 env_var
 user_name
 autocreate
 strip_maildomain
 strip_windomain
 titlecase
 remove_blanks
 coding

Static Public Attributes

string name = 'http'
list login_inputs = []
 logout_possible = False

Detailed Description

Definition at line 51 of file http.py.


Member Function Documentation

def MoinMoin.auth.GivenAuth.decode_username (   self,
  name 
) [inherited]
decode the name we got from the environment var to unicode 

Definition at line 303 of file __init__.py.

00303 
00304     def decode_username(self, name):
00305         """ decode the name we got from the environment var to unicode """
00306         if isinstance(name, str):
00307             if self.coding:
00308                 name = name.decode(self.coding)
00309             else:
00310                 # XXX we have no idea about REMOTE_USER encoding, please help if
00311                 # you know how to do that cleanly
00312                 name = wikiutil.decodeUnknownInput(name)
00313         return name

Here is the caller graph for this function:

def MoinMoin.auth.BaseAuth.login (   self,
  request,
  user_obj,
  kw 
) [inherited]
def MoinMoin.auth.BaseAuth.login_hint (   self,
  request 
) [inherited]

Reimplemented in MoinMoin.auth.openidrp.OpenIDAuth, and MoinMoin.auth.MoinAuth.

Definition at line 213 of file __init__.py.

00213 
00214     def login_hint(self, request):
00215         return None

def MoinMoin.auth.BaseAuth.logout (   self,
  request,
  user_obj,
  kw 
) [inherited]

Reimplemented in MoinMoin.auth.cas.CASAuth, MoinMoin.auth.smb_mount.SMBMount, and MoinMoin.auth.log.AuthLog.

Definition at line 208 of file __init__.py.

00208 
00209     def logout(self, request, user_obj, **kw):
00210         if self.name and user_obj and user_obj.auth_method == self.name:
00211             logging.debug("%s: logout - invalidating user %r" % (self.name, user_obj.name))
00212             user_obj.valid = False
        return user_obj, True
def MoinMoin.auth.GivenAuth.request (   self,
  request,
  user_obj,
  kw 
) [inherited]

Reimplemented from MoinMoin.auth.BaseAuth.

Definition at line 339 of file __init__.py.

00339 
00340     def request(self, request, user_obj, **kw):
00341         u = None
00342         _ = request.getText
00343         # always revalidate auth
00344         if user_obj and user_obj.auth_method == self.name:
00345             user_obj = None
00346         # something else authenticated before us
00347         if user_obj:
00348             logging.debug("already authenticated, doing nothing")
00349             return user_obj, True
00350 
00351         if self.user_name is not None:
00352             auth_username = self.user_name
00353         elif self.env_var is None:
00354             auth_username = request.remote_user
00355         else:
00356             auth_username = request.environ.get(self.env_var)
00357 
00358         logging.debug("auth_username = %r" % auth_username)
00359         if auth_username:
00360             auth_username = self.decode_username(auth_username)
00361             auth_username = self.transform_username(auth_username)
00362             logging.debug("auth_username (after decode/transform) = %r" % auth_username)
00363             u = user.User(request, auth_username=auth_username,
00364                           auth_method=self.name, auth_attribs=('name', 'password'))
00365 
00366         logging.debug("u: %r" % u)
00367         if u and self.autocreate:
00368             logging.debug("autocreating user")
00369             u.create_or_update()
00370         if u and u.valid:
00371             logging.debug("returning valid user %r" % u)
00372             return u, True # True to get other methods called, too
00373         else:
00374             logging.debug("returning %r" % user_obj)
00375             return user_obj, True
00376 

Here is the call graph for this function:

def MoinMoin.auth.GivenAuth.transform_username (   self,
  name 
) [inherited]
transform the name we got (unicode in, unicode out)

    Note: if you need something more special, you could create your own
  auth class, inherit from this class and overwrite this function.

Definition at line 314 of file __init__.py.

00314 
00315     def transform_username(self, name):
00316         """ transform the name we got (unicode in, unicode out)
00317 
00318             Note: if you need something more special, you could create your own
00319                   auth class, inherit from this class and overwrite this function.
00320         """
00321         assert isinstance(name, unicode)
00322         if self.strip_maildomain:
00323             # split off mail domain, e.g. "user@example.org" -> "user"
00324             name = name.split(u'@')[0]
00325 
00326         if self.strip_windomain:
00327             # split off window domain, e.g. "DOMAIN\user" -> "user"
00328             name = name.split(u'\\')[-1]
00329 
00330         if self.titlecase:
00331             # this "normalizes" the login name, e.g. meier, Meier, MEIER -> Meier
00332             name = name.title()
00333 
00334         if self.remove_blanks:
00335             # remove blanks e.g. "Joe Doe" -> "JoeDoe"
00336             name = u''.join(name.split())
00337 
00338         return name

Here is the caller graph for this function:


Member Data Documentation

Definition at line 295 of file __init__.py.

Definition at line 300 of file __init__.py.

Definition at line 293 of file __init__.py.

list MoinMoin.auth.BaseAuth.login_inputs = [] [static, inherited]
MoinMoin.auth.BaseAuth.logout_possible = False [static, inherited]
string MoinMoin.auth.http.HTTPAuth.name = 'http' [static]

Reimplemented from MoinMoin.auth.GivenAuth.

Definition at line 52 of file http.py.

Definition at line 299 of file __init__.py.

Definition at line 296 of file __init__.py.

Definition at line 297 of file __init__.py.

Definition at line 298 of file __init__.py.

Definition at line 294 of file __init__.py.


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