Commit 78825940 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer

Rename database parameters

parent 05c931b9
......@@ -59,18 +59,18 @@ def register_login(login, password):
"""
expiration_time=datetime.datetime.now()+datetime.timedelta(days=1)
try:
conn = psycopg2.connect(dbname= application.config['AUTHDBNAME'],
port = application.config['AUTHDBPORT'],
host = application.config['AUTHDBHOST'],
user= application.config['AUTHDBUSER'],
password = application.config['AUTHDBPASSWORD'])
conn = psycopg2.connect(dbname= application.config['RESIFAUTH_PGDATABASE'],
port = application.config['RESIFAUTH_PGPORT'],
host = application.config['RESIFAUTH_PGHOST'],
user= application.config['RESIFAUTH_PGUSER'],
password = application.config['RESIFAUTH_PGPASSWORD'])
cur = conn.cursor()
logging.debug("Connected to users database")
except Exception as e:
logging.error("Unable to connect to database %s as %s@%s:%s"%(application.config['AUTHDBNAME'],
application.config['AUTHDBUSER'],
application.config['AUTHDBHOST'],
application.config['AUTHDBPORT']))
logging.error("Unable to connect to database %s as %s@%s:%s", application.config['RESIFAUTH_PGDATABASE'],
application.config['RESIFAUTH_PGUSER'],
application.config['RESIFAUTH_PGHOST'],
application.config['RESIFAUTH_PGPORT'])
raise e
cur.execute("""
......@@ -93,18 +93,18 @@ def register_privileges(login, fdsn_refs):
- For each fdsn reference, insert the privilege in the access table
"""
try:
conn = psycopg2.connect(dbname= application.config['PRIVILEGEDBNAME'],
port = application.config['PRIVILEGEDBPORT'],
host = application.config['PRIVILEGEDBHOST'],
user= application.config['PRIVILEGEDBUSER'],
password = application.config['PRIVILEGEDBPASSWORD'])
conn = psycopg2.connect(dbname= application.config['RESIFINV_PGDATABASE'],
port = application.config['RESIFINV_PGPORT'],
host = application.config['RESIFINV_PGHOST'],
user= application.config['RESIFINV_PGUSER'],
password = application.config['RESIFINV_PGPASSWORD'])
cur = conn.cursor()
logging.debug("Connected to privileges database")
except Exception as e:
logging.error("Unable to connect to database %s as %s@%s:%s"%(application.config['PRIVILEGEDBNAME'],
application.config['PRIVILEGEDBUSER'],
application.config['PRIVILEGEDBHOST'],
application.config['PRIVILEGEDBPORT']))
logging.error("Unable to connect to database %s as %s@%s:%s", application.config['RESIFINV_PGDATABASE'],
application.config['RESIFINV_PGUSER'],
application.config['RESIFINV_PGHOST'],
application.config['RESIFINV_PGPORT'])
raise e
# Get the network id
......@@ -143,11 +143,11 @@ def cleanup():
logging.info("Cleaning up expired temporary accounts")
rows_deleted = 0
try:
conn = psycopg2.connect(dbname= application.config['AUTHDBNAME'],
port = application.config['AUTHDBPORT'],
host = application.config['AUTHDBHOST'],
user= application.config['AUTHDBUSER'],
password = application.config['AUTHDBPASSWORD'])
conn = psycopg2.connect(dbname= application.config['RESIFAUTH_PGDATABASE'],
port = application.config['RESIFAUTH_PGPORT'],
host = application.config['RESIFAUTH_PGHOST'],
user= application.config['RESIFAUTH_PGUSER'],
password = application.config['RESIFAUTH_PGPASSWORD'])
cur = conn.cursor()
logging.debug("Connected to users database")
cur.execute("delete from credentials where expires_at < now();")
......@@ -160,11 +160,11 @@ def cleanup():
raise e
try:
conn = psycopg2.connect(dbname= application.config['PRIVILEGEDBNAME'],
port = application.config['PRIVILEGEDBPORT'],
host = application.config['PRIVILEGEDBHOST'],
user= application.config['PRIVILEGEDBUSER'],
password = application.config['PRIVILEGEDBPASSWORD'])
conn = psycopg2.connect(dbname= application.config['RESIFINV_PGDATABASE'],
port = application.config['RESIFINV_PGPORT'],
host = application.config['RESIFINV_PGHOST'],
user= application.config['RESIFINV_PGUSER'],
password = application.config['RESIFINV_PGPASSWORD'])
cur = conn.cursor()
logging.debug("Connected to privlieges database")
logging.debug("Deleting from privileges database")
......@@ -184,7 +184,7 @@ def auth():
data = request.get_data()
logging.debug("Data: %s", data)
try:
verify_token_signature(data, application.config['GNUPGHOMEDIR'])
verify_token_signature(data, application.config['GNUPG_HOMEDIR'])
tokendict = parse_input_data(data)
logging.info("Token signature OK: %s"%str(tokendict))
except ValueError as e:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment