- Getting containers ready for the cloud

This commit is contained in:
Josako
2024-08-06 14:56:12 +02:00
parent 64cf8df3a9
commit ab8359365d
20 changed files with 494 additions and 110 deletions

View File

@@ -6,7 +6,7 @@ from flask import current_app, request, session
from sqlalchemy.exc import SQLAlchemyError
from datetime import datetime, timedelta
from common.extensions import socketio, kms_client, db
from common.extensions import socketio, db, simple_encryption
from common.models.user import Tenant
from common.models.interaction import Interaction
from common.utils.celery_utils import current_celery
@@ -156,7 +156,7 @@ def handle_feedback(data):
def validate_api_key(tenant_id, api_key):
tenant = Tenant.query.get_or_404(tenant_id)
decrypted_api_key = kms_client.decrypt_api_key(tenant.encrypted_chat_api_key)
decrypted_api_key = simple_encryption.decrypt_api_key(tenant.encrypted_chat_api_key)
return decrypted_api_key == api_key