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 @@ -89,6 +89,34 @@ paths:
userVerifiedRequired: true
appVerifiedRequired: false
disabledStages: []
/bk_plugin/openapi/:
x-bk-apigateway-method-any:
operationId: plugin_openapi
description: ''
tags: []
responses:
default:
description: ''
x-bk-apigateway-resource:
isPublic: true
allowApplyPermission: true
matchSubpath: true
backend:
type: HTTP
method: any
{% if settings.BK_PLUGIN_APIGW_BACKEND_SUB_PATH %}
path: /{env.api_sub_path}bk_plugin/openapi/
{% else %}
path: /bk_plugin/openapi/
{% endif %}
matchSubpath: true
timeout: 0
upstreams: {}
transformHeaders: {}
authConfig:
userVerifiedRequired: false
appVerifiedRequired: true
disabledStages: []
/callback/{token}/:
post:
operationId: callback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from bk_plugin_framework.envs import settings

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

urlpatterns = [
path(r"meta/", api.Meta.as_view()),
Expand All @@ -40,3 +41,12 @@
else:
sys.stdout.write("[!]plugin api urls module found\n")
urlpatterns.append(path(r"plugin_api/", include(PLUGIN_API_URLS_MODULE)))

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