Skip to content

fix: grpc-transcode plugin: fix map data population#8731

Merged
spacewander merged 10 commits into
apache:masterfrom
kingluo:grpc_transcode_fix_map_type
Jan 30, 2023
Merged

fix: grpc-transcode plugin: fix map data population#8731
spacewander merged 10 commits into
apache:masterfrom
kingluo:grpc_transcode_fix_map_type

Conversation

@kingluo

@kingluo kingluo commented Jan 28, 2023

Copy link
Copy Markdown
Contributor

Description

Fixes #8655

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

Comment thread t/grpc_server_example/go.mod Outdated
go 1.11

require (
github.com/golang/protobuf v1.5.0 // indirect

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run go mod tidy to remove indirect mark

Comment thread apisix/plugins/grpc-transcode/util.lua Outdated
if not sub then
sub = {}
end
sub[k]= tbl[k]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check err before accessing tbl

Comment thread apisix/plugins/grpc-transcode/util.lua Outdated
if not sub then
sub = {}
end
sub[k]= tbl[k]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sub[k]= tbl[k]
sub[k] = tbl[k]

Comment thread t/plugin/grpc-transcode-struct.t Outdated
@@ -0,0 +1,121 @@
#

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread t/plugin/grpc-transcode-struct.t Outdated
local content = t.read_file("t/grpc_server_example/echo.pb")
local data = {content = ngx.encode_base64(content)}
local code, body = t.test('/apisix/admin/protos/1',
ngx.HTTP_PUT,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ngx.HTTP_PUT,
ngx.HTTP_PUT,

@spacewander
spacewander merged commit 736c8f2 into apache:master Jan 30, 2023
hongbinhsu added a commit to fitphp/apix that referenced this pull request Jan 30, 2023
* upstream/master: (67 commits)
  fix: grpc-transcode plugin: fix map data population (apache#8731)
  change(jwt-auth): unify apisix/core/vault.lua and apisix/secret/vault.lua (apache#8660)
  feat: stream subsystem support consul_kv service discovery (apache#8633)
  fix(proxy-mirror): use with uri rewrite (apache#8718)
  ci: move helper script to the right dir (apache#8691)
  refactor(pubsub): simpify the get_cmd implementation (apache#8608)
  feat: stream subsystem support kubernetes service discovery (apache#8640)
  docs: fix deployment links (apache#8714)
  fix: remove backslash before slash when encoding (apache#8684)
  ci: kafka should register port in the zookeeper same as exposed (apache#8672)
  docs: fix plugin config naming (apache#8701)
  docs: fix code block (apache#8700)
  docs: rename kms to secret (apache#8697)
  docs: replace transparent logos with white background logos (apache#8689)
  fix: upgrade lua-resty-etcd to 1.10.3 (apache#8668)
  fix: upgrade casbin to 1.41.3 to improve performance (apache#8676)
  chore: make send_stream_request more clear (apache#8627)
  feat: stream subsystem support nacos service discovery (apache#8584)
  feat: stream subsystem support dns service discovery (apache#8593)
  refactor(admin): refactor resource routes (apache#8611)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: GRPC transcode can't work with protobuf.Struct

3 participants