Package openid :: Package store :: Module filestore :: Class FileOpenIDStore
[frames | no frames]

Type FileOpenIDStore

 object --+    
          |    
OpenIDStore --+
              |
             FileOpenIDStore


This is a filesystem-based store for OpenID associations and nonces. This store should be safe for use in concurrent systems on both windows and unix (excluding NFS filesystems). There are a couple race conditions in the system, but those failure cases have been set up in such a way that the worst-case behavior is someone having to try to log in a second time.

Most of the methods of this class are implementation details. People wishing to just use this store need only pay attention to the __init__ method.

Methods of this object can raise OSError if unexpected filesystem conditions, such as bad permissions or missing directories, occur.
Method Summary
  __init__(self, directory)
Initializes a new FileOpenIDStore.
  clean(self)
Remove expired entries from the database.
  createAuthKey(self)
Generate a new random auth key and safely store it in the location specified by self.auth_key_name.
  getAssociation(self, server_url, handle)
Retrieve an association.
  getAssociationFilename(self, server_url, handle)
Create a unique filename for a given server url and handle.
  getAuthKey(self)
Retrieve the auth key from the file specified by self.auth_key_name, creating it if it does not exist.
  readAuthKey(self)
Read the auth key from the auth key file.
  removeAssociation(self, server_url, handle)
Remove an association if it exists.
  storeAssociation(self, server_url, association)
Store an association in the association directory.
  storeNonce(self, nonce)
Mark this nonce as present.
  useNonce(self, nonce)
Return whether this nonce is present.
Inherited from OpenIDStore: isDumb
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variable Summary
Inherited from OpenIDStore: AUTH_KEY_LEN

Method Details

__init__(self, directory)
(Constructor)

Initializes a new FileOpenIDStore. This initializes the nonce and association directories, which are subdirectories of the directory passed in.
Parameters:
directory - This is the directory to put the store directories in.
           (type=str)
Overrides:
__builtin__.object.__init__

clean(self)

Remove expired entries from the database. This is potentially expensive, so only run when it is acceptable to take time.

() -> NoneType

createAuthKey(self)

Generate a new random auth key and safely store it in the location specified by self.auth_key_name.

() -> str

getAssociation(self, server_url, handle=None)

Retrieve an association. If no handle is specified, return the association with the latest expiration.

(str, str or NoneType) -> Association or NoneType
Overrides:
openid.store.interface.OpenIDStore.getAssociation

getAssociationFilename(self, server_url, handle)

Create a unique filename for a given server url and handle. This implementation does not assume anything about the format of the handle. The filename that is returned will contain the domain name from the server URL for ease of human inspection of the data directory.

(str, str) -> str

getAuthKey(self)

Retrieve the auth key from the file specified by self.auth_key_name, creating it if it does not exist.

() -> str
Overrides:
openid.store.interface.OpenIDStore.getAuthKey

readAuthKey(self)

Read the auth key from the auth key file. Will return None if there is currently no key.

() -> str or NoneType

removeAssociation(self, server_url, handle)

Remove an association if it exists. Do nothing if it does not.

(str, str) -> bool
Overrides:
openid.store.interface.OpenIDStore.removeAssociation

storeAssociation(self, server_url, association)

Store an association in the association directory.

(str, Association) -> NoneType
Overrides:
openid.store.interface.OpenIDStore.storeAssociation

storeNonce(self, nonce)

Mark this nonce as present.

str -> NoneType
Overrides:
openid.store.interface.OpenIDStore.storeNonce

useNonce(self, nonce)

Return whether this nonce is present. As a side effect, mark it as no longer present.

str -> bool
Overrides:
openid.store.interface.OpenIDStore.useNonce

Generated by Epydoc 2.1 on Mon Jun 11 13:59:42 2007 http://epydoc.sf.net