Skip to content

Commit

Permalink
fix: remove functionality relating to domain/V1
Browse files Browse the repository at this point in the history
  • Loading branch information
acke committed Oct 25, 2024
1 parent ea94a0a commit d08c22a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ dist: build
env:
- GO111MODULE=on
- CGO_ENABLED=0
- LS_PROTOCOL_VERSION=16
- LS_PROTOCOL_VERSION=17
14 changes: 2 additions & 12 deletions infrastructure/snyk_api/snyk_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (s *SnykApiClientImpl) SastSettings() (SastResponse, error) {
var response SastResponse
logger.Debug().Msg("API: Getting SastEnabled")

p := s.normalizeAPIPathForV1(c, "/cli-config/settings/sast")
p := "/cli-config/settings/sast"
u, err := url.Parse(p)
if err != nil {
return SastResponse{}, err
Expand All @@ -124,16 +124,6 @@ func (s *SnykApiClientImpl) addOrgToQuery(c *config.Config, u *url.URL) *url.URL
return u
}

func (s *SnykApiClientImpl) normalizeAPIPathForV1(c *config.Config, path string) string {
if !strings.HasPrefix(path, "/") {
path = "/" + path
}
if !strings.HasSuffix(c.SnykApi(), "/v1") {
path = "/v1" + path
}
return path
}

func (s *SnykApiClientImpl) FeatureFlagStatus(featureFlagType FeatureFlagType) (FFResponse, error) {
if s.c.Offline() {
return FFResponse{}, nil
Expand All @@ -144,7 +134,7 @@ func (s *SnykApiClientImpl) FeatureFlagStatus(featureFlagType FeatureFlagType) (

var response FFResponse
logger.Debug().Msgf("API: Getting %s", featureFlagType)
path := s.normalizeAPIPathForV1(c, fmt.Sprintf("/cli-config/feature-flags/%s", string(featureFlagType)))
path := fmt.Sprintf("/cli-config/feature-flags/%s", string(featureFlagType))
u, err := url.Parse(path)
if err != nil {
return FFResponse{}, err
Expand Down

0 comments on commit d08c22a

Please sign in to comment.