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

Class SQLiteStore

source code

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

This is an SQLite-based specialization of SQLStore.

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 [hide private]
  blobDecode(self, buf)
Convert a blob as returned by the SQL engine into a str object.
  blobEncode(self, s)
Convert a str object into the necessary object for storing in the database as a blob.

Inherited from SQLStore: __getattr__, __init__, createTables, getAssociation, getAuthKey, removeAssociation, storeAssociation, storeNonce, txn_createTables, txn_getAssociation, txn_getAuthKey, txn_removeAssociation, txn_storeAssociation, txn_storeNonce, txn_useNonce, useNonce

Inherited from interface.OpenIDStore: isDumb

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


Class Variables [hide private]
  create_nonce_sql = '\n CREATE TABLE %(nonces)s\n (\n nonce CHAR(8) UNIQ...
  create_assoc_sql = '\n CREATE TABLE %(associations)s\n (\n server_url V...
  create_settings_sql = '\n CREATE TABLE %(settings)s\n (\n setting VARCHAR(...
  create_auth_sql = 'INSERT INTO %(settings)s VALUES ("auth_key", ?);'
  get_auth_sql = 'SELECT value FROM %(settings)s WHERE setting = "aut...
  set_assoc_sql = 'INSERT OR REPLACE INTO %(associations)s VALUES (?, ...
  get_assocs_sql = 'SELECT handle, secret, issued, lifetime, assoc_type...
  get_assoc_sql = 'SELECT handle, secret, issued, lifetime, assoc_type...
  remove_assoc_sql = 'DELETE FROM %(associations)s WHERE server_url = ? A...
  add_nonce_sql = 'INSERT OR REPLACE INTO %(nonces)s VALUES (?, ?);'
  get_nonce_sql = 'SELECT * FROM %(nonces)s WHERE nonce = ?;'
  remove_nonce_sql = 'DELETE FROM %(nonces)s WHERE nonce = ?;'

Inherited from SQLStore: associations_table, nonces_table, settings_table

Inherited from interface.OpenIDStore: AUTH_KEY_LEN


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

blobDecode(self, buf)

source code 

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

str -> str
Overrides: SQLStore.blobDecode
(inherited documentation)

blobEncode(self, s)

source code 

Convert a str object into the necessary object for storing in the database as a blob.
Overrides: SQLStore.blobEncode
(inherited documentation)

Class Variable Details [hide private]

create_nonce_sql

Value:
'''
    CREATE TABLE %(nonces)s
    (
        nonce CHAR(8) UNIQUE PRIMARY KEY,
        expires INTEGER
    );
    '''                                                                
      

create_assoc_sql

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

create_settings_sql

Value:
'''
    CREATE TABLE %(settings)s
    (
        setting VARCHAR(128) UNIQUE PRIMARY KEY,
        value BLOB(20)
    );
    '''                                                                
      

create_auth_sql

Value:
'INSERT INTO %(settings)s VALUES ("auth_key", ?);'                     
      

get_auth_sql

Value:
'SELECT value FROM %(settings)s WHERE setting = "auth_key";'           
      

set_assoc_sql

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

get_assocs_sql

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

get_assoc_sql

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

remove_assoc_sql

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

add_nonce_sql

Value:
'INSERT OR REPLACE INTO %(nonces)s VALUES (?, ?);'                     
      

get_nonce_sql

Value:
'SELECT * FROM %(nonces)s WHERE nonce = ?;'                            
      

remove_nonce_sql

Value:
'DELETE FROM %(nonces)s WHERE nonce = ?;'