This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch release-v0.19
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v0.19 by this push:
new 7ca2dc061 feat(bamboo): add rest proxy api (#6302) (#6326)
7ca2dc061 is described below
commit 7ca2dc061e4f60ed21683b887e375cc3e7b1d44e
Author: Leric Zhang <[email protected]>
AuthorDate: Wed Oct 25 02:35:02 2023 -0500
feat(bamboo): add rest proxy api (#6302) (#6326)
---
backend/plugins/bamboo/api/remote.go | 9 +++++++++
backend/plugins/bamboo/impl/impl.go | 3 +++
2 files changed, 12 insertions(+)
diff --git a/backend/plugins/bamboo/api/remote.go
b/backend/plugins/bamboo/api/remote.go
index b31dd40ce..37b2b9ee9 100644
--- a/backend/plugins/bamboo/api/remote.go
+++ b/backend/plugins/bamboo/api/remote.go
@@ -85,6 +85,15 @@ func SearchRemoteScopes(input *plugin.ApiResourceInput)
(*plugin.ApiResourceOutp
})
}
+func Proxy(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput,
errors.Error) {
+ connection := &models.BambooConnection{}
+ err := connectionHelper.First(connection, input.Params)
+ if err != nil {
+ return nil, err
+ }
+ return remoteHelper.ProxyApiGet(connection, input.Params["path"],
input.Query)
+}
+
func initialQuery(queryData *api.RemoteQueryData) url.Values {
query := url.Values{}
query.Set("showEmpty", fmt.Sprintf("%v", true))
diff --git a/backend/plugins/bamboo/impl/impl.go
b/backend/plugins/bamboo/impl/impl.go
index e60335ac2..ce77a392f 100644
--- a/backend/plugins/bamboo/impl/impl.go
+++ b/backend/plugins/bamboo/impl/impl.go
@@ -235,6 +235,9 @@ func (p Bamboo) ApiResources()
map[string]map[string]plugin.ApiResourceHandler {
"PATCH": api.UpdateScope,
"DELETE": api.DeleteScope,
},
+ "connections/:connectionId/proxy/rest/*path": {
+ "GET": api.Proxy,
+ },
}
}