-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add support to fuzz proto data in uber filter fuzzer #10796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
88756b3
8118f84
6267c68
2c93844
36c643d
07f9a9f
9c469dc
248db5f
c8de25c
28a0581
0836ca5
7e553ad
3c31248
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,32 @@ void addBookstoreProtoDescriptor(Protobuf::Message* message) { | |
| } | ||
| } // namespace | ||
|
|
||
| void UberFilterFuzzer::guideAnyProtoType(test::fuzz::HttpData* mutable_data, uint choice) { | ||
| // These types are request/response from the test Bookstore service | ||
| // for the gRPC Transcoding filter. | ||
| static const std::vector<std::string> expected_types = { | ||
| "type.googleapis.com/bookstore.ListShelvesResponse", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For later, I wonder if these types can be picked up via reflection.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I didn't think of that. I did some initial research and it seems feasible. Lets do that in another PR later, if we end up needing to fuzz test with proto data for any other filters. |
||
| "type.googleapis.com/bookstore.CreateShelfRequest", | ||
| "type.googleapis.com/bookstore.GetShelfRequest", | ||
| "type.googleapis.com/bookstore.DeleteShelfRequest", | ||
| "type.googleapis.com/bookstore.ListBooksRequest", | ||
| "type.googleapis.com/bookstore.CreateBookRequest", | ||
| "type.googleapis.com/bookstore.GetBookRequest", | ||
| "type.googleapis.com/bookstore.UpdateBookRequest", | ||
| "type.googleapis.com/bookstore.DeleteBookRequest", | ||
| "type.googleapis.com/bookstore.GetAuthorRequest", | ||
| "type.googleapis.com/bookstore.EchoBodyRequest", | ||
| "type.googleapis.com/bookstore.EchoStructReqResp", | ||
| "type.googleapis.com/bookstore.Shelf", | ||
| "type.googleapis.com/bookstore.Book", | ||
| "type.googleapis.com/google.protobuf.Empty", | ||
| "type.googleapis.com/google.api.HttpBody", | ||
| }; | ||
| ProtobufWkt::Any* mutable_any = mutable_data->mutable_proto_body()->mutable_message(); | ||
| const std::string& type_url = expected_types[choice % expected_types.size()]; | ||
| mutable_any->set_type_url(type_url); | ||
| } | ||
|
|
||
| void UberFilterFuzzer::cleanFuzzedConfig(absl::string_view filter_name, | ||
| Protobuf::Message* message) { | ||
| // Map filter name to clean-up function. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.