Skip to content

Commit a46e9b3

Browse files
committed
Additional linter fixes
1 parent a11c5bd commit a46e9b3

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

internal/bridge/client.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,9 @@ type ClusterRoleApiResource struct {
155155
ClusterId string `json:"cluster_id"`
156156
Flavor string `json:"flavor"`
157157
Name string `json:"name"`
158-
//nolint:gosec // G117: JSON serialization field for API response, not a hardcoded credential.
159-
Password string `json:"password"`
160-
Team string `json:"team_id"`
161-
URI string `json:"uri"`
158+
Password string `json:"password"`
159+
Team string `json:"team_id"`
160+
URI string `json:"uri"`
162161
}
163162

164163
// ClusterRoleList holds a slice of ClusterRoleApiResource
@@ -279,8 +278,7 @@ func (c *Client) doWithBackoff(
279278

280279
if err == nil {
281280
request.Header = headers.Clone()
282-
283-
//nolint:bodyclose,gosec // bodyclose: response returned to caller; G704: URL is from trusted Bridge API configuration.
281+
//nolint:bodyclose // response returned to caller.
284282
response, err = c.Do(request)
285283
}
286284

internal/bridge/client_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@ func TestGetClusterRole(t *testing.T) {
12291229
}
12301230

12311231
t.Run("WeSendCorrectData", func(t *testing.T) {
1232+
//nolint:gosec // G117: Password is part of the API resource struct, not a credential in test context.
12321233
responsePayloadJson, err := json.Marshal(clusterRoleApiResource)
12331234
assert.NilError(t, err)
12341235

@@ -1251,6 +1252,7 @@ func TestGetClusterRole(t *testing.T) {
12511252
})
12521253

12531254
t.Run("OkResponse", func(t *testing.T) {
1255+
//nolint:gosec // G117: Password is part of the API resource struct, not a credential in test context.
12541256
responsePayloadJson, err := json.Marshal(clusterRoleApiResource)
12551257
assert.NilError(t, err)
12561258

@@ -1269,6 +1271,7 @@ func TestGetClusterRole(t *testing.T) {
12691271
})
12701272

12711273
t.Run("ErrorResponse", func(t *testing.T) {
1274+
//nolint:gosec // G117: Password is part of the API resource struct, not a credential in test context.
12721275
responsePayloadJson, err := json.Marshal(clusterRoleApiResource)
12731276
assert.NilError(t, err)
12741277

internal/bridge/crunchybridgecluster/mock_bridge_api.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
)
1818

1919
type TestBridgeClient struct {
20-
//nolint:gosec // G117: Test mock struct field, not a hardcoded credential.
2120
ApiKey string `json:"apiKey,omitempty"`
2221
TeamId string `json:"teamId,omitempty"`
2322
Clusters []*bridge.ClusterApiResource `json:"clusters,omitempty"`

internal/bridge/installation.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ var self = new(struct {
3939
type AuthObject struct {
4040
ID string `json:"id"`
4141
ExpiresAt time.Time `json:"expires_at"`
42-
//nolint:gosec // G117: JSON serialization field for API response, not a hardcoded credential.
43-
Secret string `json:"secret"`
42+
Secret string `json:"secret"`
4443
}
4544

4645
type Installation struct {

pkg/apis/postgres-operator.crunchydata.com/v1beta1/crunchy_bridgecluster_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ type CrunchyBridgeClusterSpec struct {
7777

7878
// The name of the secret containing the API key and team id
7979
// +kubebuilder:validation:Required
80-
//nolint:gosec // G117: Field holds secret name reference, not actual secret data.
8180
Secret string `json:"secret"`
8281

8382
// The amount of storage available to the cluster in gigabytes.

0 commit comments

Comments
 (0)