Feat: Education (#24208)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Xiyuan Chen
2025-08-20 00:38:14 -07:00
committed by GitHub
parent ddf05ca059
commit cfefe4f738
6 changed files with 56 additions and 38 deletions

View File

@@ -10,6 +10,22 @@ from extensions.ext_database import db
from models.model import EndUser
def billing_inner_api_only(view):
@wraps(view)
def decorated(*args, **kwargs):
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 != dify_config.INNER_API_KEY:
abort(401)
return view(*args, **kwargs)
return decorated
def enterprise_inner_api_only(view):
@wraps(view)
def decorated(*args, **kwargs):