Package openid :: Package store :: Module dumbstore :: Class DumbStore
[frames] | no frames]

Class DumbStore

source code

           object --+    
                    |    
interface.OpenIDStore --+
                        |
                       DumbStore

This is a store for use in the worst case, when you have no way of saving state on the consumer site. Using this store makes the consumer vulnerable to replay attacks (though only within the lifespan of the tokens), as it's unable to use nonces. Avoid using this store if it is at all possible.

Most of the methods of this class are implementation details. Users of this class need to worry only about the __init__ method.

Instance Methods [hide private]
  __init__(self, secret_phrase)
Creates a new DumbStore instance.
NoneType storeAssociation(self, server_url, association)
This implementation does nothing.
None getAssociation(self, server_url, handle=None)
This implementation always returns None.
bool removeAssociation(self, server_url, handle)
This implementation always returns False.
NoneType storeNonce(self, nonce)
This implementation does nothing.
bool useNonce(self, nonce)
In a system truly limited to dumb mode, nonces must all be accepted.
str getAuthKey(self)
This method returns the auth key generated by the constructor.
bool isDumb(self)
This store is a dumb mode store, so this method is overridden to return True.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]

Inherited from interface.OpenIDStore: AUTH_KEY_LEN


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, secret_phrase)
(Constructor)

source code 

Creates a new DumbStore instance. For the security of the tokens generated by the library, this class attempts to at least have a secure implementation of getAuthKey.

When you create an instance of this class, pass in a secret phrase. The phrase is hashed with sha1 to make it the correct length and form for an auth key. That allows you to use a long string as the secret phrase, which means you can make it very difficult to guess.

Each DumbStore instance that is created for use by your consumer site needs to use the same secret_phrase.
Parameters:
  • secret_phrase (str) - The phrase used to create the auth key returned by getAuthKey
Overrides: object.__init__

storeAssociation(self, server_url, association)

source code 

This implementation does nothing.
Returns: NoneType
None
Overrides: interface.OpenIDStore.storeAssociation

getAssociation(self, server_url, handle=None)

source code 

This implementation always returns None.
Returns: None
None
Overrides: interface.OpenIDStore.getAssociation

removeAssociation(self, server_url, handle)

source code 

This implementation always returns False.
Returns: bool
False
Overrides: interface.OpenIDStore.removeAssociation

storeNonce(self, nonce)

source code 

This implementation does nothing.
Returns: NoneType
None
Overrides: interface.OpenIDStore.storeNonce

useNonce(self, nonce)

source code 

In a system truly limited to dumb mode, nonces must all be accepted. This therefore always returns True, which makes replay attacks feasible during the lifespan of the token.
Returns: bool
True
Overrides: interface.OpenIDStore.useNonce

getAuthKey(self)

source code 

This method returns the auth key generated by the constructor.
Returns: str
The auth key generated by the constructor.
Overrides: interface.OpenIDStore.getAuthKey

isDumb(self)

source code 

This store is a dumb mode store, so this method is overridden to return True.
Returns: bool
True
Overrides: interface.OpenIDStore.isDumb