Package madrona :: Package openid :: Module openid_store :: Class DjangoOpenIDStore
[hide private]

Class DjangoOpenIDStore

source code

                        object --+    
                                 |    
openid.store.interface.OpenIDStore --+
                                     |
                                    DjangoOpenIDStore

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
NoneType
storeAssociation(self, server_url, association)
This method puts a Association object into storage, retrievable by server URL and handle.
source code
Association or NoneType
getAssociation(self, server_url, handle=None)
This method returns an Association object from storage that matches the server URL and, if specified, handle.
source code
bool or int
removeAssociation(self, server_url, handle)
This method removes the matching association if it's found, and returns whether the association was removed or not.
source code
bool
useNonce(self, server_url, timestamp, salt)
Called when using a nonce.
source code
int
cleanupNonces(self, _now=None)
Remove expired nonces from the store.
source code
int
cleanupAssociations(self)
Remove expired associations from the store.
source code
 
getAuthKey(self) source code
 
isDumb(self) source code

Inherited from openid.store.interface.OpenIDStore: cleanup

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

storeAssociation(self, server_url, association)

source code 

This method puts a Association object into storage, retrievable by server URL and handle.

Parameters:
  • server_url - The URL of the identity server that this association is with. Because of the way the server portion of the library uses this interface, don't assume there are any limitations on the character set of the input string. In particular, expect to see unescaped non-url-safe characters in the server_url field.
  • association - The Association to store.
Returns: NoneType
None
Overrides: openid.store.interface.OpenIDStore.storeAssociation
(inherited documentation)

getAssociation(self, server_url, handle=None)

source code 

This method returns an Association object from storage that matches the server URL and, if specified, handle. It returns None if no such association is found or if the matching association is expired.

If no handle is specified, the store may return any association which matches the server URL. If multiple associations are valid, the recommended return value for this method is the one most recently issued.

This method is allowed (and encouraged) to garbage collect expired associations when found. This method must not return expired associations.

Parameters:
  • server_url - The URL of the identity server to get the association for. Because of the way the server portion of the library uses this interface, don't assume there are any limitations on the character set of the input string. In particular, expect to see unescaped non-url-safe characters in the server_url field.
  • handle - This optional parameter is the handle of the specific association to get. If no specific handle is provided, any valid association matching the server URL is returned.
Returns: Association or NoneType
The Association for the given identity server.
Overrides: openid.store.interface.OpenIDStore.getAssociation
(inherited documentation)

removeAssociation(self, server_url, handle)

source code 

This method removes the matching association if it's found, and returns whether the association was removed or not.

Parameters:
  • server_url - The URL of the identity server the association to remove belongs to. Because of the way the server portion of the library uses this interface, don't assume there are any limitations on the character set of the input string. In particular, expect to see unescaped non-url-safe characters in the server_url field.
  • handle - This is the handle of the association to remove. If there isn't an association found that matches both the given URL and handle, then there was no matching handle found.
Returns: bool or int
Returns whether or not the given association existed.
Overrides: openid.store.interface.OpenIDStore.removeAssociation
(inherited documentation)

useNonce(self, server_url, timestamp, salt)

source code 

Called when using a nonce.

This method should return True if the nonce has not been used before, and store it for a while to make sure nobody tries to use the same value again. If the nonce has already been used or the timestamp is not current, return False.

You may use openid.store.nonce.SKEW for your timestamp window.

Parameters:
  • server_url - The URL of the server from which the nonce originated.
  • timestamp - The time that the nonce was created (to the nearest second), in seconds since January 1 1970 UTC.
  • salt - A random string that makes two nonces from the same server issued during the same second unique.
Returns: bool
Whether or not the nonce was valid.
Overrides: openid.store.interface.OpenIDStore.useNonce
(inherited documentation)

cleanupNonces(self, _now=None)

source code 

Remove expired nonces from the store.

Discards any nonce from storage that is old enough that its timestamp would not pass useNonce.

This method is not called in the normal operation of the library. It provides a way for store admins to keep their storage from filling up with expired data.

Returns: int
the number of nonces expired.
Overrides: openid.store.interface.OpenIDStore.cleanupNonces
(inherited documentation)

cleanupAssociations(self)

source code 

Remove expired associations from the store.

This method is not called in the normal operation of the library. It provides a way for store admins to keep their storage from filling up with expired data.

Returns: int
the number of associations expired.
Overrides: openid.store.interface.OpenIDStore.cleanupAssociations
(inherited documentation)