mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-02-12 13:01:51 +00:00
fix auth, update rq dashboard
This commit is contained in:
parent
b3f3670e6f
commit
d9b4af0c96
3 changed files with 15 additions and 12 deletions
|
@ -12,10 +12,10 @@ from redis import Redis
|
|||
from rq_scheduler import Scheduler
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
|
||||
from flask import Flask, render_template, request, redirect, session, abort
|
||||
from proxstar.db import *
|
||||
from proxstar.vnc import *
|
||||
from proxstar.auth import get_auth
|
||||
from proxstar.util import gen_password
|
||||
from proxstar.starrs import *
|
||||
from proxstar.ldapdb import *
|
||||
|
@ -42,16 +42,7 @@ with open('proxmox_ssh_key', 'w') as key:
|
|||
|
||||
ssh_tunnels = []
|
||||
|
||||
# Keep on retrying until we have auth defined since SSO sucks
|
||||
while True:
|
||||
try:
|
||||
auth
|
||||
break
|
||||
except:
|
||||
auth = OIDCAuthentication(
|
||||
app,
|
||||
issuer=app.config['OIDC_ISSUER'],
|
||||
client_registration_info=app.config['OIDC_CLIENT_CONFIG'])
|
||||
auth = get_auth(app)
|
||||
|
||||
redis_conn = Redis(app.config['REDIS_HOST'], app.config['REDIS_PORT'])
|
||||
q = Queue(connection=redis_conn)
|
||||
|
|
12
proxstar/auth.py
Normal file
12
proxstar/auth.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
|
||||
from tenacity import retry
|
||||
|
||||
|
||||
@retry
|
||||
def get_auth(app):
|
||||
auth = OIDCAuthentication(
|
||||
app,
|
||||
issuer=app.config['OIDC_ISSUER'],
|
||||
client_registration_info=app.config['OIDC_CLIENT_CONFIG'])
|
||||
auth
|
||||
return auth
|
|
@ -11,7 +11,7 @@ raven==6.9.0
|
|||
redis==2.10.6
|
||||
requests==2.20.1
|
||||
rq==0.12.0
|
||||
rq-dashboard==0.3.12
|
||||
rq-dashboard==0.4.0
|
||||
rq-scheduler==0.8.3
|
||||
sqlalchemy==1.2.12
|
||||
sshtunnel==0.1.4
|
||||
|
|
Loading…
Reference in a new issue