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

Type PostgreSQLStore

 object --+        
          |        
OpenIDStore --+    
              |    
       SQLStore --+
                  |
                 PostgreSQLStore


This is a PostgreSQL-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.
Method Summary
  blobEncode(self, blob)
  db_set_assoc(self, server_url, handle, secret, issued, lifetime, assoc_type)
Set an association.
Inherited from SQLStore: __init__, __getattr__, blobDecode, cleanupAssociations, cleanupNonces, createTables, getAssociation, removeAssociation, storeAssociation, txn_cleanupAssociations, txn_cleanupNonces, txn_createTables, txn_getAssociation, txn_removeAssociation, txn_storeAssociation, txn_useNonce, useNonce
Inherited from OpenIDStore: cleanup
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variable Summary
str add_nonce_sql = 'INSERT INTO %(nonces)s VALUES (%%s, %%s...
str clean_assoc_sql = 'DELETE FROM %(associations)s WHERE is...
str clean_nonce_sql = 'DELETE FROM %(nonces)s WHERE timestam...
str create_assoc_sql = '\n    CREATE TABLE %(associations)s\...
str create_nonce_sql = '\n    CREATE TABLE %(nonces)s (\n   ...
str create_settings_sql = '\n    CREATE TABLE %(settings)s\n...
str get_assoc_sql = 'SELECT handle, secret, issued, lifetime...
str get_assocs_sql = 'SELECT handle, secret, issued, lifetim...
str get_expired_sql = 'SELECT server_url FROM %(associations...
str new_assoc_sql = 'INSERT INTO %(associations)s VALUES (%%...
str remove_assoc_sql = 'DELETE FROM %(associations)s WHERE s...
str update_assoc_sql = 'UPDATE %(associations)s SET secret =...
Inherited from SQLStore: associations_table, nonces_table, settings_table

Method Details

db_set_assoc(self, server_url, handle, secret, issued, lifetime, assoc_type)

Set an association. This is implemented as a method because REPLACE INTO is not supported by PostgreSQL (and is not standard SQL).

Class Variable Details

add_nonce_sql

Type:
str
Value:
'INSERT INTO %(nonces)s VALUES (%%s, %%s, %%s);'                       

clean_assoc_sql

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

clean_nonce_sql

Type:
str
Value:
'DELETE FROM %(nonces)s WHERE timestamp < %%s;'                        

create_assoc_sql

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

create_nonce_sql

Type:
str
Value:
'''
    CREATE TABLE %(nonces)s (
        server_url VARCHAR(2047),
        timestamp INTEGER,
        salt CHAR(40),
        PRIMARY KEY (server_url, timestamp, salt)
    );
    '''                                                                

create_settings_sql

Type:
str
Value:
'''
    CREATE TABLE %(settings)s
    (
        setting VARCHAR(128) UNIQUE PRIMARY KEY,
        value BYTEA,
        CONSTRAINT value_length_constraint CHECK (LENGTH(value) <= 20)
    );
    '''                                                                

get_assoc_sql

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

get_assocs_sql

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

get_expired_sql

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

new_assoc_sql

Type:
str
Value:
'INSERT INTO %(associations)s VALUES (%%s, %%s, %%s, %%s, %%s, %%s);'  

remove_assoc_sql

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

update_assoc_sql

Type:
str
Value:
'UPDATE %(associations)s SET secret = %%s, issued = %%s, lifetime = %%\
s, assoc_type = %%s WHERE server_url = %%s AND handle = %%s;'          

Generated by Epydoc 2.1 on Fri Dec 14 16:10:53 2007 http://epydoc.sf.net