From 4579272db468412e18da8c8a6290c1cb4b911cd7 Mon Sep 17 00:00:00 2001 From: redhat-renovate-bot Date: Mon, 6 Jan 2025 08:22:44 +0800 Subject: [PATCH 1/2] Update go updates Signed-off-by: redhat-renovate-bot --- go.mod | 8 +++++--- go.sum | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index f7ee9d7..2d227af 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module go.flow.arcalot.io/pluginsdk -go 1.22.0 +go 1.23.0 + +toolchain go1.23.4 require ( github.com/fxamacker/cbor/v2 v2.7.0 @@ -11,6 +13,6 @@ require ( require ( github.com/x448/float16 v0.8.4 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect ) diff --git a/go.sum b/go.sum index 9531668..f2222e4 100644 --- a/go.sum +++ b/go.sum @@ -6,10 +6,10 @@ go.arcalot.io/assert v1.8.0 h1:hGcHMPncQXwQvjj7MbyOu2gg8VIBB00crUJZpeQOjxs= go.arcalot.io/assert v1.8.0/go.mod h1:nNmWPoNUHFyrPkNrD2aASm5yPuAfiWdB/4X7Lw3ykHk= go.arcalot.io/log/v2 v2.2.0 h1:a4wVAqQ/6zFyEG6I9Dnd7eFA52KKGaBK3hj9PgZ/e0c= go.arcalot.io/log/v2 v2.2.0/go.mod h1:h/Hlyz6wH+mjRUKdL3W2fG2oMrAm2qgPxb0rNJJDUuY= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From 7824855a4baabe106eaf8a87f856a5884df01170 Mon Sep 17 00:00:00 2001 From: Jared O'Connell Date: Tue, 7 Jan 2025 14:29:15 -0500 Subject: [PATCH 2/2] Fix linting errors --- atp/protocol_test.go | 2 -- schema/any_test.go | 1 - schema/bool.go | 2 ++ schema/int.go | 3 +++ schema/map_test.go | 2 -- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/atp/protocol_test.go b/atp/protocol_test.go index e5a24d6..fa124d2 100644 --- a/atp/protocol_test.go +++ b/atp/protocol_test.go @@ -257,7 +257,6 @@ func testExecuteWithChannels(closeChannel bool, t *testing.T) { wg.Wait() } -//nolint:funlen func TestProtocol_Client_ATP_v1(t *testing.T) { // Client ReadSchema and Execute atp v1 happy path. // This is not a fragile test because the ATP v1 is not changing. It is the legacy supported version. @@ -741,7 +740,6 @@ func TestProtocol_Error_Server_WorkStart(t *testing.T) { time.Sleep(time.Millisecond * 2) } -//nolint:funlen func TestProtocol_Error_Client_WorkStart(t *testing.T) { // Induce error on client's (and server incidentally) // start work message by closing the client's cbor diff --git a/schema/any_test.go b/schema/any_test.go index 500d659..92e390b 100644 --- a/schema/any_test.go +++ b/schema/any_test.go @@ -216,7 +216,6 @@ func TestAnyValidateCompatibilityLists(t *testing.T) { })) } -//nolint:funlen func TestAnyValidateCompatibilityMaps(t *testing.T) { // Test custom maps with schemas and data s1 := schema.NewAnySchema() diff --git a/schema/bool.go b/schema/bool.go index cb5ede6..8ba3f60 100644 --- a/schema/bool.go +++ b/schema/bool.go @@ -43,10 +43,12 @@ func (b BoolSchema) Unserialize(data any) (any, error) { case int: return intConverter(int64(v)) case uint: + //nolint:gosec // Not a security problem. It's only checking for 0 or 1 values. return intConverter(int64(v)) case int64: return intConverter(v) case uint64: + //nolint:gosec // Not a security problem. It's only checking for 0 or 1 values. return intConverter(int64(v)) case int32: return intConverter(int64(v)) diff --git a/schema/int.go b/schema/int.go index 23974ab..e1530c1 100644 --- a/schema/int.go +++ b/schema/int.go @@ -170,6 +170,9 @@ func intInputMapper(data any, u *UnitsDefinition) (int64, error) { case int: return int64(v), nil case uint: + if v > math.MaxInt64 { + return 0, fmt.Errorf("number is too large for an int64: %d", v) + } return int64(v), nil case int32: return int64(v), nil diff --git a/schema/map_test.go b/schema/map_test.go index 18e64f2..9165fd5 100644 --- a/schema/map_test.go +++ b/schema/map_test.go @@ -202,7 +202,6 @@ func TestMapSchemaTypesValidation(t *testing.T) { }() } -//nolint:funlen func TestMapSchemaCompatibilityValidation(t *testing.T) { s1 := schema.NewMapSchema( schema.NewStringSchema(nil, nil, nil), @@ -273,7 +272,6 @@ func TestMapSchemaCompatibilityValidation(t *testing.T) { assert.Error(t, s1.ValidateCompatibility(schema.NewIntEnumSchema(map[int64]*schema.DisplayValue{}, nil))) } -//nolint:funlen func TestMapCompatibilityValidation(t *testing.T) { s1 := schema.NewMapSchema( schema.NewStringSchema(nil, nil, nil),