Skip to content

Commit 1826489

Browse files
Merge pull request #93 from NETWAYS/dependabot/go_modules/golang.org/x/oauth2-0.36.0
Bump golang.org/x/oauth2 from 0.35.0 to 0.36.0
2 parents a5247ca + 070c3d2 commit 1826489

8 files changed

Lines changed: 18 additions & 17 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v6
2121
with:
22-
go-version: 1.24
22+
go-version: 1.25
2323

2424
- name: Vet
2525
run: go vet ./...

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- name: golangci-lint
1818
uses: golangci/golangci-lint-action@v9
1919
with:
20-
version: v2.1.6
20+
version: v2.11.2

api/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (c *Client) NewRequest(method, url string, body io.Reader) (req *http.Reque
4444
}
4545

4646
func (c *Client) Do(req *http.Request) (res *http.Response, err error) {
47-
res, err = c.HTTPClient.Do(req)
47+
res, err = c.HTTPClient.Do(req) //nolint: gosec
4848
if err != nil {
4949
err = fmt.Errorf("HTTP request failed: %w", err)
5050
}

api/response.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io"
77
"net/http"
88
"net/url"
9+
"strings"
910
)
1011

1112
type ResponseBody struct {
@@ -58,19 +59,19 @@ func (c *Client) GetJSONResponse(req *http.Request) (data *ResponseBody, err err
5859
err = json.Unmarshal(body, data)
5960

6061
if res.StatusCode != http.StatusOK {
61-
errInfo := ""
62+
var errInfo strings.Builder
6263

6364
if data.Error != nil {
6465
for _, e := range data.Error.Errors {
65-
errInfo += fmt.Sprintf(" - %s: %s", e.Title, e.Detail)
66+
fmt.Fprintf(&errInfo, " - %s: %s", e.Title, e.Detail)
6667
}
6768
}
6869

6970
for _, e := range data.Errors {
70-
errInfo += fmt.Sprintf(" - %s: %s", e.Title, e.Detail)
71+
fmt.Fprintf(&errInfo, " - %s: %s", e.Title, e.Detail)
7172
}
7273

73-
err = fmt.Errorf("HTTP request returned non-ok status %s%s", res.Status, errInfo)
74+
err = fmt.Errorf("HTTP request returned non-ok status %s%s", res.Status, errInfo.String())
7475

7576
return
7677
}

api/trace.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type LoggingRoundTripper struct {
88
Base http.RoundTripper
99
}
1010

11-
// Prepare custom client that using a logging transport.
11+
// NewLoggingHTTPClient prepares a custom client that using a logging transport.
1212
func NewLoggingHTTPClient() *http.Client {
1313
client := *http.DefaultClient
1414
client.Transport = LoggingRoundTripper{http.DefaultTransport}

check.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (c *Config) Run() (rc int, output string, err error) {
112112
var sb strings.Builder
113113

114114
for index, list := range byLocation {
115-
sb.WriteString(fmt.Sprintf("\n## %s\n\n", index))
115+
fmt.Fprintf(&sb, "\n## %s\n\n", index)
116116

117117
for _, threat := range list {
118118
var stateText string
@@ -127,15 +127,15 @@ func (c *Config) Run() (rc int, output string, err error) {
127127
stateText = "WARNING"
128128
}
129129

130-
sb.WriteString(fmt.Sprintf("[%s] [%s] %s: (%s) %s (%s)\n",
130+
fmt.Fprintf(&sb, "[%s] [%s] %s: (%s) %s (%s)\n",
131131
// nolint: gosmopolitan
132132
threat.ThreatInfo.CreatedAt.Local().Format("2006-01-02 15:04 MST"),
133133
stateText,
134134
threat.AgentRealtimeInfo.AgentComputerName,
135135
threat.ThreatInfo.Classification,
136136
threat.ThreatInfo.ThreatName,
137137
threat.ThreatInfo.MitigationStatusDescription,
138-
))
138+
)
139139
}
140140
}
141141

@@ -150,8 +150,8 @@ func (c *Config) Run() (rc int, output string, err error) {
150150

151151
// Add perfdata.
152152
sb.WriteString("|")
153-
sb.WriteString(fmt.Sprintf(" threats=%d", total))
154-
sb.WriteString(fmt.Sprintf(" threats_not_mitigated=%d", notMitigated))
153+
fmt.Fprintf(&sb, " threats=%d", total)
154+
fmt.Fprintf(&sb, " threats_not_mitigated=%d", notMitigated)
155155
output = sb.String()
156156

157157
// determine final state.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module github.com/NETWAYS/check_sentinelone
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
66
github.com/NETWAYS/go-check v0.6.4
77
github.com/jarcoal/httpmock v1.4.1
88
github.com/spf13/pflag v1.0.10
9-
golang.org/x/oauth2 v0.35.0
9+
golang.org/x/oauth2 v0.36.0
1010
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ github.com/maxatome/go-testdeep v1.14.0 h1:rRlLv1+kI8eOI3OaBXZwb3O7xY3exRzdW5QyX
88
github.com/maxatome/go-testdeep v1.14.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM=
99
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
1010
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
11-
golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ=
12-
golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
11+
golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
12+
golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q=

0 commit comments

Comments
 (0)