Skip to content

Commit e46c213

Browse files
DCjanusdnwe
authored andcommitted
ci(gosec): suppress G117 and G704 false positives
Signed-off-by: DCjanus <[email protected]>
1 parent 7f0e26c commit e46c213

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

alter_user_scram_credentials_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type AlterUserScramCredentialsUpsert struct {
2828

2929
// This field is never transmitted over the wire
3030
// @see: https://tools.ietf.org/html/rfc5802
31-
Password []byte
31+
Password []byte // #nosec G117 -- SCRAM API requires this exported field name; value is not marshaled or logged.
3232
}
3333

3434
func (r *AlterUserScramCredentialsRequest) encode(pe packetEncoder) error {

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ type Config struct {
9595
// SASL/PLAIN or SASL/SCRAM authentication
9696
User string
9797
// Password for SASL/PLAIN authentication
98-
Password string
98+
Password string // #nosec G117 -- public SASL config schema; callers set this credential explicitly.
9999
// authz id used for SASL/SCRAM authentication
100100
SCRAMAuthzID string
101101
// SCRAMClientGeneratorFunc is a generator of a user provided implementation of a SCRAM

gssapi_kerberos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type GSSAPIConfig struct {
3737
KerberosConfigPath string
3838
ServiceName string
3939
Username string
40-
Password string
40+
Password string // #nosec G117 -- required by GSSAPI auth config and intentionally user-provided.
4141
Realm string
4242
DisablePAFXFAST bool
4343
BuildSpn BuildSpnFunc

internal/toxiproxy/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (c *Client) Proxy(name string) (*Proxy, error) {
5555
if err != nil {
5656
return nil, fmt.Errorf("failed to make proxy request: %w", err)
5757
}
58-
resp, err := c.httpClient.Do(req)
58+
resp, err := c.httpClient.Do(req) // #nosec G704 -- toxiproxy endpoint is controlled test infrastructure.
5959
if err != nil {
6060
return nil, fmt.Errorf("failed to http get proxy: %w", err)
6161
}
@@ -80,7 +80,7 @@ func (c *Client) ResetState() error {
8080
if err != nil {
8181
return fmt.Errorf("failed to make reset request: %w", err)
8282
}
83-
resp, err := c.httpClient.Do(req)
83+
resp, err := c.httpClient.Do(req) // #nosec G704 -- toxiproxy endpoint is controlled test infrastructure.
8484
if err != nil {
8585
return fmt.Errorf("failed to http post reset: %w", err)
8686
}

internal/toxiproxy/proxy.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (p *Proxy) AddToxic(
4444
return nil, fmt.Errorf("failed to make post toxic request: %w", err)
4545
}
4646
req.Header.Set("Content-Type", "application/json")
47-
resp, err := c.httpClient.Do(req)
47+
resp, err := c.httpClient.Do(req) // #nosec G704 -- toxiproxy endpoint is controlled test infrastructure.
4848
if err != nil {
4949
return nil, fmt.Errorf("failed to http post toxic: %w", err)
5050
}
@@ -83,7 +83,7 @@ func (p *Proxy) Save() (*Proxy, error) {
8383
return nil, fmt.Errorf("failed to make post proxy request: %w", err)
8484
}
8585
req.Header.Set("Content-Type", "application/json")
86-
resp, err := c.httpClient.Do(req)
86+
resp, err := c.httpClient.Do(req) // #nosec G704 -- toxiproxy endpoint is controlled test infrastructure.
8787
if err != nil {
8888
return nil, fmt.Errorf("failed to http post proxy: %w", err)
8989
}
@@ -98,7 +98,7 @@ func (p *Proxy) Save() (*Proxy, error) {
9898
return nil, fmt.Errorf("failed to make post proxy request: %w", err)
9999
}
100100
req.Header.Set("Content-Type", "application/json")
101-
resp, err = c.httpClient.Do(req)
101+
resp, err = c.httpClient.Do(req) // #nosec G704 -- toxiproxy endpoint is controlled test infrastructure.
102102
if err != nil {
103103
return nil, fmt.Errorf("failed to http post proxy: %w", err)
104104
}

0 commit comments

Comments
 (0)