Skip to content

Commit

Permalink
chore: disable gosec(G115)
Browse files Browse the repository at this point in the history
Ignoring this rule as this doesn't break anything but causes lint errors.

Upstream ref: securego/gosec#1185
  • Loading branch information
Duologic committed Oct 16, 2024
1 parent 16b2d8e commit 643e08b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func stackServiceAccountTokenCreate(ctx context.Context, d *schema.ResourceData,

req := gcom.PostInstanceServiceAccountTokensRequest{
Name: d.Get("name").(string),
SecondsToLive: common.Ref(d.Get("seconds_to_live").(int32)),
SecondsToLive: common.Ref(int32(d.Get("seconds_to_live").(int))), //nolint:gosec
}

resp, _, err := cloudClient.InstancesAPI.PostInstanceServiceAccountTokens(ctx, stackSlug, strconv.FormatInt(serviceAccountID, 10)).
Expand Down
4 changes: 2 additions & 2 deletions internal/resources/machinelearning/resource_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ func makeMLJob(d *schema.ResourceData, meta interface{}) (mlapi.Job, error) {
DatasourceUID: d.Get("datasource_uid").(string),
DatasourceType: d.Get("datasource_type").(string),
QueryParams: d.Get("query_params").(map[string]interface{}),
Interval: d.Get("interval").(uint),
Interval: uint(d.Get("interval").(int)), //nolint:gosec
Algorithm: "grafana_prophet_1_0_1",
HyperParams: d.Get("hyper_params").(map[string]interface{}),
CustomLabels: d.Get("custom_labels").(map[string]interface{}),
TrainingWindow: d.Get("training_window").(uint),
TrainingWindow: uint(d.Get("training_window").(int)), //nolint:gosec
TrainingFrequency: uint(24 * time.Hour / time.Second),
Holidays: common.ListToStringSlice(d.Get("holidays").([]interface{})),
}, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func makeMLOutlier(d *schema.ResourceData, meta interface{}) (mlapi.OutlierDetec
DatasourceUID: d.Get("datasource_uid").(string),
DatasourceType: d.Get("datasource_type").(string),
QueryParams: d.Get("query_params").(map[string]interface{}),
Interval: d.Get("interval").(uint),
Interval: uint(d.Get("interval").(int)), //nolint:gosec
Algorithm: algorithm,
}, nil
}
4 changes: 2 additions & 2 deletions internal/resources/syntheticmonitoring/resource_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ func makeCheckSettings(settings map[string]interface{}) (sm.CheckSettings, error
IpVersion: sm.IpVersion(sm.IpVersion_value[d["ip_version"].(string)]),
SourceIpAddress: d["source_ip_address"].(string),
Server: d["server"].(string),
Port: d["port"].(int32),
Port: int32(d["port"].(int)), //nolint:gosec
RecordType: sm.DnsRecordType(sm.DnsRecordType_value[d["record_type"].(string)]),
Protocol: sm.DnsProtocol(sm.DnsProtocol_value[d["protocol"].(string)]),
ValidRCodes: common.SetToStringSlice(d["valid_r_codes"].(*schema.Set)),
Expand Down Expand Up @@ -1485,7 +1485,7 @@ func makeCheckSettings(settings map[string]interface{}) (sm.CheckSettings, error
}
if h["valid_status_codes"].(*schema.Set).Len() > 0 {
for _, v := range h["valid_status_codes"].(*schema.Set).List() {
cs.Http.ValidStatusCodes = append(cs.Http.ValidStatusCodes, v.(int32))
cs.Http.ValidStatusCodes = append(cs.Http.ValidStatusCodes, int32(v.(int))) //nolint:gosec
}
}
headerMatch := func(hms *schema.Set) []sm.HeaderMatch {
Expand Down

0 comments on commit 643e08b

Please sign in to comment.