Merge branch 'main' into feat/plugin

This commit is contained in:
Yeuoly
2024-07-15 16:03:11 +08:00
589 changed files with 10640 additions and 3672 deletions

View File

@ -3,7 +3,7 @@ from functools import wraps
from hashlib import sha1
from hmac import new as hmac_new
from flask import abort, current_app, request
from flask import abort, request
from configs import dify_config
from extensions.ext_database import db
@ -13,12 +13,12 @@ from models.model import EndUser
def enterprise_inner_api_only(view):
@wraps(view)
def decorated(*args, **kwargs):
if not current_app.config['INNER_API']:
if not dify_config.INNER_API:
abort(404)
# get header 'X-Inner-Api-Key'
inner_api_key = request.headers.get('X-Inner-Api-Key')
if not inner_api_key or inner_api_key != current_app.config['INNER_API_KEY']:
if not inner_api_key or inner_api_key != dify_config.INNER_API_KEY:
abort(404)
return view(*args, **kwargs)
@ -29,7 +29,7 @@ def enterprise_inner_api_only(view):
def enterprise_inner_api_user_auth(view):
@wraps(view)
def decorated(*args, **kwargs):
if not current_app.config['INNER_API']:
if not dify_config.INNER_API:
return view(*args, **kwargs)
# get header 'X-Inner-Api-Key'