Skip to content

Commit f1d4d12

Browse files
gtopperGal Topper
andauthored
IG-21969: Upgrade gRPC version (#650)
* IG-21969: Upgrade gRPC version This fixes the following security vulnerabilities: * CVE-2023-1428 * CVE-2023-32731 * CVE-2023-32732 * lint * Fixes and improvements --------- Co-authored-by: Gal Topper <galt@iguazio.com>
1 parent 16d201e commit f1d4d12

19 files changed

+2844
-3993
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test: test-go test-py
4343

4444
.PHONY: test-go
4545
test-go:
46-
GO111MODULE=on go test -v $(testflags) -timeout 20m ./...
46+
GO111MODULE=on go test -v -timeout 20m ./...
4747

4848
.PHONY: test-py
4949
test-py:
@@ -66,7 +66,7 @@ grpc: grpc-go grpc-py
6666

6767
.PHONY: grpc-go
6868
grpc-go:
69-
protoc frames.proto --go_out=plugins=grpc:pb
69+
protoc frames.proto --go_out=pb --go-grpc_out=pb --go-grpc_opt=require_unimplemented_servers=false
7070

7171
.PHONY: grpc-py
7272
grpc-py:
@@ -129,7 +129,7 @@ frames:
129129
--env GOOS=$(GOOS) \
130130
--env GOARCH=$(GOARCH) \
131131
--env FRAMES_TAG=$(FRAMES_TAG) \
132-
golang:1.14 \
132+
golang:1.19 \
133133
make frames-bin
134134

135135
PHONY: gofmt

backends/backends.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ func ValidateRequest(backend string, request interface{}, allowedFields map[stri
107107
for i := 0; i < reftype.NumField(); i++ {
108108
field := reftype.Field(i)
109109
fieldName := field.Name
110-
fieldValue := reflect.ValueOf(request).Elem().FieldByName(fieldName).Interface()
110+
reflectedField := reflect.ValueOf(request).Elem().FieldByName(fieldName)
111+
if !reflectedField.CanInterface() {
112+
continue
113+
}
114+
fieldValue := reflectedField.Interface()
111115
zeroValue := reflect.Zero(field.Type).Interface()
112116
if !globalRequestFieldsByRequestType[reftype][fieldName] && !allowedFields[fieldName] && !reflect.DeepEqual(fieldValue, zeroValue) {
113117
return errors.Errorf("%s cannot be used as an argument to a %s to %s backend", fieldName, reftype.Name(), backend)

clients/py/requirements.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
googleapis-common-protos>=1.5.3
2-
# grpcio 1.34.0 must not be used as it segfaults (1.34.1 ok).
3-
# grpcio 1.49 breaks binary compatibility, because it upgrades protobuf from 3.x to 4.x.
4-
grpcio-tools>=1.30,!=1.34.0,<1.49
5-
grpcio>=1.30,!=1.34.0,<1.49
2+
grpcio-tools~=1.49
3+
grpcio~=1.49
64
pandas>=0.23.4
75
requests>=2.19.1

clients/py/tests/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def compare_dfs(df1, df2, backend):
176176
col2 = df2[name].sort_index()
177177
assert len(col1) == len(col2), \
178178
'{}: column {} size mismatch'.format(backend, name)
179-
if col1.dtype == np.float:
179+
if col1.dtype == float:
180180
ok = np.allclose(col1.values, col2.values)
181181
else:
182182
ok = col1.equals(col2)

clients/py/tests/test_pbutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_encode_df():
2828

2929
df = pd.read_csv('{}/weather.csv'.format(here))
3030
df['STATION_CAT'] = df['STATION'].astype('category')
31-
df['WDF2_F'] = df['WDF2'].astype(np.float)
31+
df['WDF2_F'] = df['WDF2'].astype(float)
3232
msg = pbutils.df2msg(df, labels)
3333

3434
names = [col.name for col in msg.columns]

clients/py/v3io_frames/frames_pb2.py

Lines changed: 80 additions & 2001 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)