maj apikaz

This commit is contained in:
HPL
2024-09-05 11:17:21 +02:00
parent 0399869067
commit f881a3ccfa
3 changed files with 67 additions and 19 deletions

View File

@ -74,6 +74,7 @@ swagger = Swagger(app, template={
#TODO: au lieu d'avoir les IP en dur, prendre le fichier allow_ip'
trusted_ips = [
"176.180.83.10",
"82.64.20.246",
"31.39.14.228",
"51.75.112.172",
@ -96,7 +97,7 @@ trusted_ips = [
#le secret pour générer les tokens
#app.config['JWT_SECRET_KEY'] = os.environ.get('JWT_SECRET_KEY')
app.config['JWT_SECRET_KEY'] = os.environ.get('JWT_SECRET_KEY', 'your_jwt_secret_key')
app.config['JWT_ACCESS_TOKEN_EXPIRES'] = timedelta(days=7)
#pour le mail
app.config['MAIL_SERVER']= os.environ.get('apikaz_MAIL_SERVER')
@ -119,6 +120,7 @@ def limit_remote_addr():
#authent mdp/pass basique
def check_auth(username, password):
return username == os.environ.get('apikaz_doc_user') and password == os.environ.get('apikaz_doc_password')
#return True
def authenticate():
return Response('tssssss.\n', 401, {'WWW-Authenticate': 'Basic realm="Login Required"'})