Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (49 sloc) 1.63 KB
// TODO: this was copied form the transformation filter.
// TODO: instead of manually copying, we want to do it via script, similar to the java-control-plane
// TODO: to solo-kit/api/envoy
syntax = "proto3";
package transformation.plugins.gloo.solo.io;
option go_package = "github.com/solo-io/gloo/projects/gloo/pkg/api/v1/plugins/transformation";
import "gogoproto/gogo.proto";
// TODO: can we get rid of this?
option (gogoproto.equal_all) = true;
message RouteTransformations {
Transformation request_transformation = 1;
Transformation response_transformation = 2;
}
// [#proto-status: experimental]
message Transformation {
// Template is in the transformed request language domain
// currently both are JSON
oneof transformation_type {
TransformationTemplate transformation_template = 1;
HeaderBodyTransform header_body_transform = 2;
}
}
message Extraction {
string header = 1;
// what information to extract. if extraction fails the result is
// an empty value.
string regex = 2;
uint32 subgroup = 3;
}
message TransformationTemplate {
bool advanced_templates = 1;
// Extractors are in the origin request language domain
map<string, Extraction> extractors = 2;
map<string, InjaTemplate> headers = 3;
oneof body_transformation {
InjaTemplate body = 4;
Passthrough passthrough = 5;
MergeExtractorsToBody merge_extractors_to_body = 6;
}
}
/*
custom functions:
header_value(name) -> from the original headers
extracted_value(name, index) -> from the extracted values
*/
message InjaTemplate { string text = 1; }
message Passthrough {}
message MergeExtractorsToBody {}
message HeaderBodyTransform {}