Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,40 @@ paths:
disabledStages: []
descriptionEn: Plugin open API entry

/bk_plugin/private/:
x-bk-apigateway-method-any:
operationId: plugin_private
summary: 插件私有API
description: 插件私有 API 入口,支持子路径匹配
tags:
- private
responses:
default:
description: '插件私有API响应'
x-bk-apigateway-resource:
isPublic: true
allowApplyPermission: true
matchSubpath: true
backend:
type: HTTP
name: default
method: any
{% if settings.BK_PLUGIN_APIGW_BACKEND_SUB_PATH %}
path: /{env.api_sub_path}/bk_plugin/private/
{% else %}
path: /bk_plugin/private/
{% endif %}
matchSubpath: true
timeout: 0
upstreams: {}
transformHeaders: {}
authConfig:
userVerifiedRequired: true
appVerifiedRequired: true
resourcePermissionRequired: false
disabledStages: []
descriptionEn: Plugin private API entry

/plugin_api_dispatch:
post:
operationId: plugin_api_dispatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

PLUGIN_API_URLS_MODULE = "bk_plugin.apis.urls"
PLUGIN_OPENAPI_URLS_MODULE = "bk_plugin.openapi.urls"
PLUGIN_PRIVATE_URLS_MODULE = "bk_plugin.private.urls"

urlpatterns = [
# 协议层接口(与平台方对接)
Expand Down Expand Up @@ -52,3 +53,12 @@
else:
sys.stdout.write("[!]plugin openapi urls module found\n")
urlpatterns.append(path(r"openapi/", include(PLUGIN_OPENAPI_URLS_MODULE)))

# add plugin private
try:
importlib.import_module(PLUGIN_PRIVATE_URLS_MODULE)
except ModuleNotFoundError:
sys.stdout.write("[!]can not find plugin private urls module, skip it\n")
else:
sys.stdout.write("[!]plugin private urls module found\n")
urlpatterns.append(path(r"private/", include(PLUGIN_PRIVATE_URLS_MODULE)))
Loading