Skip to content

Commit

Permalink
add gitRegoStoreVersion query param
Browse files Browse the repository at this point in the history
  • Loading branch information
YiscahLevySilas1 committed Mar 25, 2024
1 parent 61d65ac commit 9f7b2a0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
26 changes: 21 additions & 5 deletions pkg/client/v1/kscloudapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ func (api *KSCloudAPI) GetAttackTracks() ([]AttackTrack, error) {
func (api *KSCloudAPI) getAttackTracksURL() string {
return api.buildAPIURL(
v1.ApiServerAttackTracksPath,
api.paramsWithGUID()...,
append(
api.paramsWithGUID(),
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersionV2,
)...,
)
}

Expand Down Expand Up @@ -148,6 +151,7 @@ func (api *KSCloudAPI) getFrameworkURL(frameworkName string) string {
append(
api.paramsWithGUID(),
v1.QueryParamFrameworkName, frameworkName,
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersionV2,
)...,
)
}
Expand All @@ -171,7 +175,10 @@ func (api *KSCloudAPI) GetFrameworks() ([]Framework, error) {
func (api *KSCloudAPI) getListFrameworkURL() string {
return api.buildAPIURL(
v1.ApiServerFrameworksPath,
api.paramsWithGUID()...,
append(
api.paramsWithGUID(),
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersionV2,
)...,
)
}

Expand Down Expand Up @@ -233,7 +240,10 @@ func (api *KSCloudAPI) GetExceptions(clusterName string) ([]PostureExceptionPoli
func (api *KSCloudAPI) getExceptionsURL(clusterName string) string {
return api.buildAPIURL(
v1.ApiServerExceptionsPath,
api.paramsWithGUID()...,
append(
api.paramsWithGUID(),
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersionV2,
)...,
)
// queryParamClusterName, clusterName, // TODO - fix customer name support in Armo BE
}
Expand Down Expand Up @@ -277,7 +287,10 @@ func (api *KSCloudAPI) getAccountConfig(clusterName string) string {

return api.buildAPIURL(
v1.ApiServerCustomerConfigPath,
params...,
append(
params,
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersionV2,
)...,
)
}

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

return api.buildAPIURL(
v1.ApiServerCustomerConfigPath,
params...,
append(
params,
v1.QueryParamGitRegoStoreVersion, v1.RegolibraryVersionV2,
)...,
)
}

Expand Down
20 changes: 11 additions & 9 deletions pkg/server/v1/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ const (
KubescapeFallbackCustomerGUID = "11111111-1111-1111-1111-111111111111"

// URL query parameters
QueryParamCustomerGUID = "customerGUID"
QueryParamScope = "scope"
QueryParamFrameworkName = "frameworkName"
QueryParamPolicyName = "policyName"
QueryParamClusterName = "clusterName"
QueryParamContextName = "contextName"
QueryParamReport = "reportGUID"
QueryParamJobID = "jobID"
QueryParamRegistryName = "registryName"
QueryParamCustomerGUID = "customerGUID"
QueryParamScope = "scope"
QueryParamFrameworkName = "frameworkName"
QueryParamPolicyName = "policyName"
QueryParamClusterName = "clusterName"
QueryParamContextName = "contextName"
QueryParamReport = "reportGUID"
QueryParamJobID = "jobID"
QueryParamRegistryName = "registryName"
QueryParamGitRegoStoreVersion = "gitRegoStoreVersion"
RegolibraryVersionV2 = "v2"

AccessKeyHeader = "X-API-KEY"
)

0 comments on commit 9f7b2a0

Please sign in to comment.