Package openid :: Package store :: Module sqlstore :: Class MySQLStore
[frames] | no frames]

Class MySQLStore

source code

           object --+        
                    |        
interface.OpenIDStore --+    
                        |    
                 SQLStore --+
                            |
                           MySQLStore

This is a MySQL-based specialization of SQLStore.

Uses InnoDB tables for transaction support.

To create an instance, see SQLStore.__init__. To create the tables it will use, see SQLStore.createTables.

All other methods are implementation details.

Instance Methods
 
blobDecode(self, blob)
Convert a blob as returned by the SQL engine into a str object.
source code

Inherited from SQLStore: __getattr__, __init__, blobEncode, cleanupAssociations, cleanupNonces, createTables, getAssociation, removeAssociation, storeAssociation, txn_cleanupAssociations, txn_cleanupNonces, txn_createTables, txn_getAssociation, txn_removeAssociation, txn_storeAssociation, txn_useNonce, useNonce

Inherited from interface.OpenIDStore: cleanup

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

Class Variables
  exceptions = None
  create_nonce_sql = '\n CREATE TABLE %(nonces)s (\n s...
  create_assoc_sql = '\n CREATE TABLE %(associations)s\n (...
  set_assoc_sql = 'REPLACE INTO %(associations)s VALUES (%%s, %%...
  get_assocs_sql = 'SELECT handle, secret, issued, lifetime, ass...
  get_expired_sql = 'SELECT server_url FROM %(associations)s WHE...
  get_assoc_sql = 'SELECT handle, secret, issued, lifetime, asso...
  remove_assoc_sql = 'DELETE FROM %(associations)s WHERE server_...
  clean_assoc_sql = 'DELETE FROM %(associations)s WHERE issued +...
  add_nonce_sql = 'INSERT INTO %(nonces)s VALUES (%%s, %%s, %%s);'
  clean_nonce_sql = 'DELETE FROM %(nonces)s WHERE timestamp < %%s;'

Inherited from SQLStore: associations_table, nonces_table

Properties

Inherited from object: __class__

Method Details

blobDecode(self, blob)

source code 

Convert a blob as returned by the SQL engine into a str object.

str -> str

Overrides: SQLStore.blobDecode
(inherited documentation)

Class Variable Details

create_nonce_sql

Value:
'''
    CREATE TABLE %(nonces)s (
        server_url BLOB NOT NULL,
        timestamp INTEGER NOT NULL,
        salt CHAR(40) NOT NULL,
        PRIMARY KEY (server_url(255), timestamp, salt)
    )
    ENGINE=InnoDB;
...

create_assoc_sql

Value:
'''
    CREATE TABLE %(associations)s
    (
        server_url BLOB NOT NULL,
        handle VARCHAR(255) NOT NULL,
        secret BLOB NOT NULL,
        issued INTEGER NOT NULL,
        lifetime INTEGER NOT NULL,
...

set_assoc_sql

Value:
'REPLACE INTO %(associations)s VALUES (%%s, %%s, %%s, %%s, %%s, %%s);'

get_assocs_sql

Value:
'SELECT handle, secret, issued, lifetime, assoc_type FROM %(associatio\
ns)s WHERE server_url = %%s;'

get_expired_sql

Value:
'SELECT server_url FROM %(associations)s WHERE issued + lifetime < %%s\
;'

get_assoc_sql

Value:
'SELECT handle, secret, issued, lifetime, assoc_type FROM %(associatio\
ns)s WHERE server_url = %%s AND handle = %%s;'

remove_assoc_sql

Value:
'DELETE FROM %(associations)s WHERE server_url = %%s AND handle = %%s;\
'

clean_assoc_sql

Value:
'DELETE FROM %(associations)s WHERE issued + lifetime < %%s;'