Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix(api): add missing INNER_API_KEY to InnerAPIConfig (#19166)
Yeuoly8ac3a223a844
diff --git a/api/configs/feature/__init__.py b/api/configs/feature/__init__.pyindex f498dccbbc0..4890b5f7469 100644--- a/api/configs/feature/__init__.py+++ b/api/configs/feature/__init__.py@@ -398,6 +398,11 @@ class InnerAPIConfig(BaseSettings):default=False,)+ INNER_API_KEY: Optional[str] = Field(+ description="API key for accessing the internal API",+ default=None,+ )+class LoggingConfig(BaseSettings):"""diff --git a/api/controllers/inner_api/wraps.py b/api/controllers/inner_api/wraps.pyindex 86d3ad3dc5e..f3a9312dd0f 100644--- a/api/controllers/inner_api/wraps.py+++ b/api/controllers/inner_api/wraps.py@@ -18,7 +18,7 @@ def enterprise_inner_api_only(view):# 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_FOR_PLUGIN:+ if not inner_api_key or inner_api_key != dify_config.INNER_API_KEY:abort(401)return view(*args, **kwargs)diff --git a/api/tests/unit_tests/configs/test_dify_config.py b/api/tests/unit_tests/configs/test_dify_config.pyindex efa9ea89794..88938a0ee8e 100644--- a/api/tests/unit_tests/configs/test_dify_config.py+++ b/api/tests/unit_tests/configs/test_dify_config.py@@ -100,3 +100,9 @@ def test_flask_configs(example_env_file):assert str(config["CODE_EXECUTION_ENDPOINT"]) == "http://sandbox:8194/"assert str(URL(str(config["CODE_EXECUTION_ENDPOINT"])) / "v1") == "http://sandbox:8194/v1"+++def test_inner_api_config_exist():+ config = DifyConfig()+ assert config.INNER_API is False+ assert config.INNER_API_KEY is None