springpython.security.providers.encoding
index
/home/gturnquist/spring-python-1.1.x/src/springpython/security/providers/encoding.py

Copyright 2006-2008 SpringSource (http://springsource.com), All Rights Reserved
 
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
 
    http://www.apache.org/licenses/LICENSE-2.0
 
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

 
Modules
       
logging

 
Classes
       
__builtin__.object
PasswordEncoder
BasePasswordEncoder
AbstractOneWayPasswordEncoder
Md5PasswordEncoder
ShaPasswordEncoder
PlaintextPasswordEncoder
LdapShaPasswordEncoder

 
class AbstractOneWayPasswordEncoder(BasePasswordEncoder)
    This is an abstract one-way hashing encoder. It is abstract because the
subclasses have to plugin their strategy.
 
 
Method resolution order:
AbstractOneWayPasswordEncoder
BasePasswordEncoder
PasswordEncoder
__builtin__.object

Methods defined here:
__init__(self)
encodePassword(self, rawPass, salt)
Encodes the specified raw password with an implementation specific algorithm.
isPasswordValid(self, encPass, rawPass, salt)
Validates a specified "raw" password against an encoded password.

Methods inherited from BasePasswordEncoder:
mergePasswordAndSalt(self, password, salt, strict)
Used by subclasses to generate a merged password and salt String.
The generated password will be in the form of 'password{salt}'.
A None can be passed to either parameter, and will be handled correctly. If the salt is None or empty,
the resulting generated password will simply be the passed password. The __str__ method of the salt will be used to represent the salt.

Data descriptors inherited from PasswordEncoder:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class BasePasswordEncoder(PasswordEncoder)
    Convenience base for all password encoders.
 
 
Method resolution order:
BasePasswordEncoder
PasswordEncoder
__builtin__.object

Methods defined here:
__init__(self)
mergePasswordAndSalt(self, password, salt, strict)
Used by subclasses to generate a merged password and salt String.
The generated password will be in the form of 'password{salt}'.
A None can be passed to either parameter, and will be handled correctly. If the salt is None or empty,
the resulting generated password will simply be the passed password. The __str__ method of the salt will be used to represent the salt.

Methods inherited from PasswordEncoder:
encodePassword(self, rawPass, salt)
Encodes the specified raw password with an implementation specific algorithm.
isPasswordValid(self, encPass, rawPass, salt)
Validates a specified "raw" password against an encoded password.

Data descriptors inherited from PasswordEncoder:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class LdapShaPasswordEncoder(PasswordEncoder)
    
Method resolution order:
LdapShaPasswordEncoder
PasswordEncoder
__builtin__.object

Methods defined here:
__init__(self)
encodePassword(self, rawPass, salt)
Encodes the specified raw password with an implementation specific algorithm.
isPasswordValid(self, encPass, rawPass, salt)
Validates a raw password against an encrypted one. It checks the prefix, to tell if its encrypted
or stored in the clear.

Data descriptors inherited from PasswordEncoder:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Md5PasswordEncoder(AbstractOneWayPasswordEncoder)
    MD5 implementation of PasswordEncoder.
 
If a None password is presented, it will be treated as an empty String ("") password.
 
As MD5 is a one-way hash, the salt can contain any characters.
 
 
Method resolution order:
Md5PasswordEncoder
AbstractOneWayPasswordEncoder
BasePasswordEncoder
PasswordEncoder
__builtin__.object

Methods defined here:
__init__(self)

Methods inherited from AbstractOneWayPasswordEncoder:
encodePassword(self, rawPass, salt)
Encodes the specified raw password with an implementation specific algorithm.
isPasswordValid(self, encPass, rawPass, salt)
Validates a specified "raw" password against an encoded password.

Methods inherited from BasePasswordEncoder:
mergePasswordAndSalt(self, password, salt, strict)
Used by subclasses to generate a merged password and salt String.
The generated password will be in the form of 'password{salt}'.
A None can be passed to either parameter, and will be handled correctly. If the salt is None or empty,
the resulting generated password will simply be the passed password. The __str__ method of the salt will be used to represent the salt.

Data descriptors inherited from PasswordEncoder:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class PasswordEncoder(__builtin__.object)
    Interface for performing authentication operations on a password.
 
  Methods defined here:
encodePassword(self, rawPass, salt)
Encodes the specified raw password with an implementation specific algorithm.
isPasswordValid(self, encPass, rawPass, salt)
Validates a specified "raw" password against an encoded password.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class PlaintextPasswordEncoder(BasePasswordEncoder)
    Plaintext implementation of PasswordEncoder.
 
As callers may wish to extract the password and salts separately from the encoded password,
the salt must not contain reserved characters (specifically '{' and '}').
 
 
Method resolution order:
PlaintextPasswordEncoder
BasePasswordEncoder
PasswordEncoder
__builtin__.object

Methods defined here:
__init__(self)
encodePassword(self, rawPass, salt)
Encodes the specified raw password with an implementation specific algorithm.
isPasswordValid(self, encPass, rawPass, salt)
Validates a specified "raw" password against an encoded password.

Methods inherited from BasePasswordEncoder:
mergePasswordAndSalt(self, password, salt, strict)
Used by subclasses to generate a merged password and salt String.
The generated password will be in the form of 'password{salt}'.
A None can be passed to either parameter, and will be handled correctly. If the salt is None or empty,
the resulting generated password will simply be the passed password. The __str__ method of the salt will be used to represent the salt.

Data descriptors inherited from PasswordEncoder:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class ShaPasswordEncoder(AbstractOneWayPasswordEncoder)
    SHA implementation of PasswordEncoder.
 
If a None password is presented, it will be treated as an empty String ("") password.
 
As SHA is a one-way hash, the salt can contain any characters.
 
 
Method resolution order:
ShaPasswordEncoder
AbstractOneWayPasswordEncoder
BasePasswordEncoder
PasswordEncoder
__builtin__.object

Methods defined here:
__init__(self)

Methods inherited from AbstractOneWayPasswordEncoder:
encodePassword(self, rawPass, salt)
Encodes the specified raw password with an implementation specific algorithm.
isPasswordValid(self, encPass, rawPass, salt)
Validates a specified "raw" password against an encoded password.

Methods inherited from BasePasswordEncoder:
mergePasswordAndSalt(self, password, salt, strict)
Used by subclasses to generate a merged password and salt String.
The generated password will be in the form of 'password{salt}'.
A None can be passed to either parameter, and will be handled correctly. If the salt is None or empty,
the resulting generated password will simply be the passed password. The __str__ method of the salt will be used to represent the salt.

Data descriptors inherited from PasswordEncoder:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)