-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 1.5.1 bugfix into master (#669)
* Fix: code:3 - proto: (line 1:102): invalid value for string null (#665) * WIP reproduce: code:3 - proto: (line 1:102): invalid value for string type: null #664 * pipefail smh * Replace github.com/golang/protobuf with google.golang.org/protobuf * just eo pipefail * fix shakedown trap * got failing test * move around * Add v1toV2MarshallerAdapter to fix backwards compatability issue * Update Changelog * Dont need to suffix here * Use node 16 * Oops forgot print body * RM this for now until come up with a better solution * Fix changelog
- Loading branch information
Mark Phelps
authored
Jan 27, 2022
1 parent
a252b64
commit f6a532f
Showing
21 changed files
with
150 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
golang 1.17.6 | ||
nodejs 16.13.2 | ||
nodejs 16.13.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package flipt | ||
|
||
import ( | ||
"io" | ||
|
||
grpc_gateway_v1 "github.com/grpc-ecosystem/grpc-gateway/runtime" | ||
grpc_gateway_v2 "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" | ||
) | ||
|
||
var _ grpc_gateway_v2.Marshaler = &V1toV2MarshallerAdapter{} | ||
|
||
// V1toV2MarshallerAdapter is a V1 to V2 marshaller adapter to be able to use the v1 marshaller | ||
// from grpc-gateway v2. | ||
// | ||
// This is required to fix a backwards compatibility issue with the v2 marshaller where `null` map values | ||
// cause an error because they are not allowed by the proto spec, but they were handled by the v1 marshaller. | ||
// | ||
// See: https://github.com/markphelps/flipt/issues/664 | ||
// | ||
// TODO: remove this custom marshaller for Flipt API v2 as we want to use the default v2 marshaller directly. | ||
type V1toV2MarshallerAdapter struct { | ||
*grpc_gateway_v1.JSONPb | ||
} | ||
|
||
func NewV1toV2MarshallerAdapter() *V1toV2MarshallerAdapter { | ||
return &V1toV2MarshallerAdapter{&grpc_gateway_v1.JSONPb{OrigName: false, EmitDefaults: true}} | ||
} | ||
|
||
func (m *V1toV2MarshallerAdapter) ContentType(_ interface{}) string { | ||
return m.JSONPb.ContentType() | ||
} | ||
|
||
func (m *V1toV2MarshallerAdapter) Marshal(v interface{}) ([]byte, error) { | ||
return m.JSONPb.Marshal(v) | ||
} | ||
|
||
func (m *V1toV2MarshallerAdapter) NewDecoder(r io.Reader) grpc_gateway_v2.Decoder { | ||
return m.JSONPb.NewDecoder(r) | ||
} | ||
|
||
func (m *V1toV2MarshallerAdapter) NewEncoder(w io.Writer) grpc_gateway_v2.Encoder { | ||
return m.JSONPb.NewEncoder(w) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.