This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new c543f86f0 fix(apikeys): webhook's api keys work with /rest prefix
(#6334)
c543f86f0 is described below
commit c543f86f0b96ae8c02aada5116198d3931b5f5c2
Author: Lynwee <[email protected]>
AuthorDate: Wed Oct 25 22:13:20 2023 +0800
fix(apikeys): webhook's api keys work with /rest prefix (#6334)
---
backend/plugins/webhook/api/connection.go | 10 +++++-----
config-ui/src/routes/api-keys/api-keys.tsx | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/backend/plugins/webhook/api/connection.go
b/backend/plugins/webhook/api/connection.go
index 937a3fa6a..121377798 100644
--- a/backend/plugins/webhook/api/connection.go
+++ b/backend/plugins/webhook/api/connection.go
@@ -185,11 +185,11 @@ func GetConnection(input *plugin.ApiResourceInput)
(*plugin.ApiResourceOutput, e
func formatConnection(connection *models.WebhookConnection, withApiKeyInfo
bool) (*WebhookConnectionResponse, errors.Error) {
response := &WebhookConnectionResponse{WebhookConnection: *connection}
- response.PostIssuesEndpoint =
fmt.Sprintf(`/plugins/webhook/connections/%d/issues`, connection.ID)
- response.CloseIssuesEndpoint =
fmt.Sprintf(`/plugins/webhook/connections/%d/issue/:issueKey/close`,
connection.ID)
- response.PostPipelineTaskEndpoint =
fmt.Sprintf(`/plugins/webhook/connections/%d/cicd_tasks`, connection.ID)
- response.PostPipelineDeployTaskEndpoint =
fmt.Sprintf(`/plugins/webhook/connections/%d/deployments`, connection.ID)
- response.ClosePipelineEndpoint =
fmt.Sprintf(`/plugins/webhook/connections/%d/cicd_pipeline/:pipelineName/finish`,
connection.ID)
+ response.PostIssuesEndpoint =
fmt.Sprintf(`/rest/plugins/webhook/connections/%d/issues`, connection.ID)
+ response.CloseIssuesEndpoint =
fmt.Sprintf(`/rest/plugins/webhook/connections/%d/issue/:issueKey/close`,
connection.ID)
+ response.PostPipelineTaskEndpoint =
fmt.Sprintf(`/rest/plugins/webhook/connections/%d/cicd_tasks`, connection.ID)
+ response.PostPipelineDeployTaskEndpoint =
fmt.Sprintf(`/rest/plugins/webhook/connections/%d/deployments`, connection.ID)
+ response.ClosePipelineEndpoint =
fmt.Sprintf(`/rest/plugins/webhook/connections/%d/cicd_pipeline/:pipelineName/finish`,
connection.ID)
if withApiKeyInfo {
db := basicRes.GetDal()
apiKeyName := apiKeyHelper.GenApiKeyNameForPlugin(pluginName,
connection.ID)
diff --git a/config-ui/src/routes/api-keys/api-keys.tsx
b/config-ui/src/routes/api-keys/api-keys.tsx
index d57118d79..fca5187a4 100644
--- a/config-ui/src/routes/api-keys/api-keys.tsx
+++ b/config-ui/src/routes/api-keys/api-keys.tsx
@@ -192,7 +192,7 @@ export const ApiKeys = () => {
required
>
<S.InputContainer>
- <span>http://localhost:4000/api/rest</span>
+ <span>http://localhost:4000/api/rest/</span>
<InputGroup
placeholder=""
value={form.allowedPath}