Skip to content

Commit f2fc733

Browse files
Merge pull request #24 from kubescape/rego-v2
point BE APIs to use regolibrary v2
2 parents 61d65ac + 2a97c38 commit f2fc733

File tree

2 files changed

+32
-14
lines changed

2 files changed

+32
-14
lines changed

pkg/client/v1/kscloudapi.go

+21-5
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ func (api *KSCloudAPI) GetAttackTracks() ([]AttackTrack, error) {
117117
func (api *KSCloudAPI) getAttackTracksURL() string {
118118
return api.buildAPIURL(
119119
v1.ApiServerAttackTracksPath,
120-
api.paramsWithGUID()...,
120+
append(
121+
api.paramsWithGUID(),
122+
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersion,
123+
)...,
121124
)
122125
}
123126

@@ -148,6 +151,7 @@ func (api *KSCloudAPI) getFrameworkURL(frameworkName string) string {
148151
append(
149152
api.paramsWithGUID(),
150153
v1.QueryParamFrameworkName, frameworkName,
154+
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersion,
151155
)...,
152156
)
153157
}
@@ -171,7 +175,10 @@ func (api *KSCloudAPI) GetFrameworks() ([]Framework, error) {
171175
func (api *KSCloudAPI) getListFrameworkURL() string {
172176
return api.buildAPIURL(
173177
v1.ApiServerFrameworksPath,
174-
api.paramsWithGUID()...,
178+
append(
179+
api.paramsWithGUID(),
180+
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersion,
181+
)...,
175182
)
176183
}
177184

@@ -233,7 +240,10 @@ func (api *KSCloudAPI) GetExceptions(clusterName string) ([]PostureExceptionPoli
233240
func (api *KSCloudAPI) getExceptionsURL(clusterName string) string {
234241
return api.buildAPIURL(
235242
v1.ApiServerExceptionsPath,
236-
api.paramsWithGUID()...,
243+
append(
244+
api.paramsWithGUID(),
245+
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersion,
246+
)...,
237247
)
238248
// queryParamClusterName, clusterName, // TODO - fix customer name support in Armo BE
239249
}
@@ -277,7 +287,10 @@ func (api *KSCloudAPI) getAccountConfig(clusterName string) string {
277287

278288
return api.buildAPIURL(
279289
v1.ApiServerCustomerConfigPath,
280-
params...,
290+
append(
291+
params,
292+
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersion,
293+
)...,
281294
)
282295
}
283296

@@ -293,7 +306,10 @@ func (api *KSCloudAPI) getAccountConfigDefault(clusterName string) string {
293306

294307
return api.buildAPIURL(
295308
v1.ApiServerCustomerConfigPath,
296-
params...,
309+
append(
310+
params,
311+
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersion,
312+
)...,
297313
)
298314
}
299315

pkg/server/v1/consts.go

+11-9
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ const (
2222
KubescapeFallbackCustomerGUID = "11111111-1111-1111-1111-111111111111"
2323

2424
// URL query parameters
25-
QueryParamCustomerGUID = "customerGUID"
26-
QueryParamScope = "scope"
27-
QueryParamFrameworkName = "frameworkName"
28-
QueryParamPolicyName = "policyName"
29-
QueryParamClusterName = "clusterName"
30-
QueryParamContextName = "contextName"
31-
QueryParamReport = "reportGUID"
32-
QueryParamJobID = "jobID"
33-
QueryParamRegistryName = "registryName"
25+
QueryParamCustomerGUID = "customerGUID"
26+
QueryParamScope = "scope"
27+
QueryParamFrameworkName = "frameworkName"
28+
QueryParamPolicyName = "policyName"
29+
QueryParamClusterName = "clusterName"
30+
QueryParamContextName = "contextName"
31+
QueryParamReport = "reportGUID"
32+
QueryParamJobID = "jobID"
33+
QueryParamRegistryName = "registryName"
34+
QueryParamGitRegoStoreVersion = "gitRegoStoreVersion"
35+
RegolibraryVersion = "v2"
3436

3537
AccessKeyHeader = "X-API-KEY"
3638
)

0 commit comments

Comments
 (0)