Skip to content

Commit 17c4f71

Browse files
committed
fix linter findings
1 parent 458afbe commit 17c4f71

10 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/rlp-gateway/app/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type LogAccessAuthorization struct {
2222
type LogAdminAuthorization struct {
2323
Addr string `env:"LOG_ADMIN_ADDR, required, report"`
2424
ClientID string `env:"LOG_ADMIN_CLIENT_ID, required"`
25-
ClientSecret string `env:"LOG_ADMIN_CLIENT_SECRET, required"`
25+
ClientSecret string `env:"LOG_ADMIN_CLIENT_SECRET, required"` //nolint:gosec
2626
CAPath string `env:"LOG_ADMIN_CA_PATH, required, report"`
2727
}
2828

src/rlp-gateway/app/gateway_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ func (tc *testClient) open(url string) (*http.Response, error) {
469469
}
470470
req.Header.Set("Authorization", "my-token")
471471

472-
resp, err := tc.client.Do(req)
472+
resp, err := tc.client.Do(req) //nolint:gosec
473473
if err != nil {
474474
panic(err)
475475
}

src/rlp-gateway/internal/auth/capi_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (c *CAPIClient) AvailableSourceIDs(token string) []string {
129129
}(resp)
130130

131131
if resp.StatusCode != http.StatusOK {
132-
log.Printf("CAPI request failed (/v3/apps): %d", resp.StatusCode)
132+
log.Printf("CAPI request failed (/v3/apps): %d", resp.StatusCode) //nolint:gosec
133133
return nil
134134
}
135135

@@ -169,7 +169,7 @@ func (c *CAPIClient) AvailableSourceIDs(token string) []string {
169169
}(resp)
170170

171171
if resp.StatusCode != http.StatusOK {
172-
log.Printf("CAPI request failed (/v3/service_instances): %d", resp.StatusCode)
172+
log.Printf("CAPI request failed (/v3/service_instances): %d", resp.StatusCode) //nolint:gosec
173173
return nil
174174
}
175175

src/testservers/router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func StartRouter(conf app.Config) (cleanup func(), rp RouterPorts) {
4141
Expect(routerPath).ToNot(BeEmpty())
4242

4343
By("starting router")
44-
routerCommand := exec.Command(routerPath)
44+
routerCommand := exec.Command(routerPath) //nolint:gosec
4545
routerCommand.Env = envstruct.ToEnv(&conf)
4646

4747
routerSession, err := gexec.Start(

src/testservers/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func waitForPortBinding(prefix string, buf *gbytes.Buffer) int {
4040
if len(result) == 2 {
4141
port, err := strconv.Atoi(string(result[1]))
4242
if err != nil {
43-
log.Panicf("unable to parse port number, port: %#v", result[1])
43+
log.Panicf("unable to parse port number, port: %#v", result[1]) //nolint:gosec
4444
}
4545
return port
4646
}

src/testservers/traffic_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func StartTrafficController(conf tcConf.Config) (cleanup func(), tp TrafficContr
5757
Expect(tcPath).ToNot(BeEmpty())
5858

5959
By("starting trafficcontroller")
60-
tcCommand := exec.Command(tcPath)
60+
tcCommand := exec.Command(tcPath) //nolint:gosec
6161
tcCommand.Env = envstruct.ToEnv(&conf)
6262
tcSession, err := gexec.Start(
6363
tcCommand,

src/trafficcontroller/internal/auth/log_access_authorizer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func NewLogAccessAuthorizer(c *http.Client, disableAccessControl bool, apiHost s
3535
}
3636

3737
req.Header.Set("Authorization", authToken)
38-
res, err := c.Do(req)
38+
res, err := c.Do(req) //nolint:gosec
3939
if err != nil {
4040
log.Printf("Could not get app information: [%s]", err)
4141
return http.StatusInternalServerError, err
@@ -44,7 +44,7 @@ func NewLogAccessAuthorizer(c *http.Client, disableAccessControl bool, apiHost s
4444

4545
err = nil
4646
if res.StatusCode != 200 {
47-
log.Printf("Non 200 response from CC API: %d for %q", res.StatusCode, target)
47+
log.Printf("Non 200 response from CC API: %d for %q", res.StatusCode, target) //nolint:gosec
4848
err = errors.New(http.StatusText(res.StatusCode))
4949
}
5050

src/trafficcontroller/internal/auth/uaa_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (c *uaaClient) GetAuthData(token string) (*AuthData, error) {
3838
req.SetBasicAuth(c.id, c.secret)
3939
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
4040

41-
response, err := c.httpClient.Do(req)
41+
response, err := c.httpClient.Do(req) //nolint:gosec
4242
if err != nil {
4343
return nil, err
4444
}

src/trafficcontroller/internal/proxy/admin_access_middleware.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (m *AdminAccessMiddleware) Wrap(h http.Handler) http.Handler {
2323
if !authorized {
2424
w.Header().Set("WWW-Authenticate", "Basic")
2525
w.WriteHeader(http.StatusUnauthorized)
26-
fmt.Fprintf(w, "You are not authorized. %s", err.Error())
26+
fmt.Fprintf(w, "You are not authorized. %s", err.Error()) //nolint:gosec
2727
return
2828
}
2929

src/trafficcontroller/internal/proxy/websocket_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (s *WebSocketServer) ServeWS(
9292
eventBody,
9393
)
9494

95-
log.Printf("Doppler Proxy: Slow Consumer from %s using %s", r.RemoteAddr, r.URL)
95+
log.Printf("Doppler Proxy: Slow Consumer from %s using %s", r.RemoteAddr, r.URL) //nolint:gosec
9696
return
9797
}
9898
}

0 commit comments

Comments
 (0)