Fix issue with Sign/VerifyRequestHeader proto.Clone

proto.Clone couldn't makes copy for custom fields.
We should reset and restore MetaHeader before/after Sign/Verify.
Add test coverage to check that all works like expected.
This commit is contained in:
Evgeniy Kulikov 2019-11-19 19:03:42 +03:00
parent 24e5497b1d
commit 5c344bfceb
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2
5 changed files with 185 additions and 45 deletions

View file

@ -12,6 +12,7 @@ message TestRequest {
int32 IntField = 1;
string StringField = 2;
bytes BytesField = 3;
bytes CustomField = 4 [(gogoproto.customtype) = "testCustomField"];
RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
RequestVerificationHeader Header = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}