Skip to content

Commit

Permalink
Config versioning v6 to v7 (#226)
Browse files Browse the repository at this point in the history
Due to breaking API change in #218

Signed-off-by: Teju Nareddy <[email protected]>
  • Loading branch information
nareddyt authored Jul 14, 2020
1 parent 360b5d9 commit 14aadff
Show file tree
Hide file tree
Showing 82 changed files with 257 additions and 257 deletions.
2 changes: 1 addition & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ If a breaking change is required, use following steps to increase config version
* Rename folder name from `api/envoy/v6/http` to `api/envoy/v7/http`.
* Replace package names from `api.envoy.v6.http` to `api.envoy.v7.http` for all proto files under folder `api/`.

Above steps can be achieved by running script `api/script/update_version.sh`.
Above steps can be achieved by running script `api/scripts/update_version.sh`.
2 changes: 1 addition & 1 deletion api/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v6
v7
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ api_cc_py_proto_library(
],
visibility = ["//visibility:public"],
deps = [
"//api/envoy/v6/http/common:base_proto",
"//api/envoy/v7/http/common:base_proto",
],
)

go_proto_library(
name = "config_go_proto",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/backend_auth",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/backend_auth",
proto = ":config_proto",
deps = [
"//api/envoy/v6/http/common:base_go_proto",
"//api/envoy/v7/http/common:base_go_proto",
"@com_envoyproxy_protoc_gen_validate//validate:go_default_library",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

syntax = "proto3";

package espv2.api.envoy.v6.http.backend_auth;
package espv2.api.envoy.v7.http.backend_auth;

import "api/envoy/v6/http/common/base.proto";
import "api/envoy/v7/http/common/base.proto";
import "validate/validate.proto";

message BackendAuthRule {
Expand All @@ -42,9 +42,9 @@ message FilterConfig {

// The Instance Metadata Server uri used to fetch id token from Instance
// Metadata Server.
espv2.api.envoy.v6.http.common.HttpUri imds_token = 2;
espv2.api.envoy.v7.http.common.HttpUri imds_token = 2;

// Information used to fetch id token from Google Cloud IAM.
espv2.api.envoy.v6.http.common.IamTokenInfo iam_token = 3;
espv2.api.envoy.v7.http.common.IamTokenInfo iam_token = 3;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ api_cc_py_proto_library(

go_proto_library(
name = "config_go_proto",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/backend_routing",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/backend_routing",
proto = ":config_proto",
deps = [
"@com_envoyproxy_protoc_gen_validate//validate:go_default_library",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

syntax = "proto3";

package espv2.api.envoy.v6.http.backend_routing;
package espv2.api.envoy.v7.http.backend_routing;

import "validate/validate.proto";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ api_cc_py_proto_library(

go_proto_library(
name = "base_go_proto",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/common",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/common",
proto = ":base_proto",
deps = [
"@com_envoyproxy_protoc_gen_validate//validate:go_default_library",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

syntax = "proto3";

package espv2.api.envoy.v6.http.common;
package espv2.api.envoy.v7.http.common;

import "google/protobuf/duration.proto";
import "validate/validate.proto";
Expand Down Expand Up @@ -99,10 +99,10 @@ message AccessToken {

message IamTokenInfo {
// The Google Cloud IAM server uri.
espv2.api.envoy.v6.http.common.HttpUri iam_uri = 1;
espv2.api.envoy.v7.http.common.HttpUri iam_uri = 1;

// Information used to get access token.
espv2.api.envoy.v6.http.common.AccessToken access_token = 2;
espv2.api.envoy.v7.http.common.AccessToken access_token = 2;

// The Service Account Email.
string service_account_email = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ api_cc_py_proto_library(
],
visibility = ["//visibility:public"],
deps = [
"//api/envoy/v6/http/common:base_proto",
"//api/envoy/v7/http/common:base_proto",
],
)

go_proto_library(
name = "config_go_proto",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/path_matcher",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/path_matcher",
proto = ":config_proto",
deps = [
"//api/envoy/v6/http/common:base_go_proto",
"//api/envoy/v7/http/common:base_go_proto",
"@com_envoyproxy_protoc_gen_validate//validate:go_default_library",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

syntax = "proto3";

package espv2.api.envoy.v6.http.path_matcher;
package espv2.api.envoy.v7.http.path_matcher;

import "api/envoy/v6/http/common/base.proto";
import "api/envoy/v7/http/common/base.proto";
import "validate/validate.proto";

message PathMatcherRule {
// The pattern used to match a HTTP request.
espv2.api.envoy.v6.http.common.Pattern pattern = 1;
espv2.api.envoy.v7.http.common.Pattern pattern = 1;

// Operation name (selector) used as a unique ID for the operation.
string operation = 2 [(validate.rules).string.min_bytes = 1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ api_cc_py_proto_library(
],
visibility = ["//visibility:public"],
deps = [
"//api/envoy/v6/http/common:base_proto",
"//api/envoy/v7/http/common:base_proto",
"//external:service_proto",
],
)

go_proto_library(
name = "config_go_proto",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/service_control",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/service_control",
proto = ":config_proto",
deps = [
"//api/envoy/v6/http/common:base_go_proto",
"//api/envoy/v7/http/common:base_go_proto",
"@com_envoyproxy_protoc_gen_validate//validate:go_default_library",
"@com_github_googleapis_googleapis//google/api:serviceconfig_go_proto",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

syntax = "proto3";

package espv2.api.envoy.v6.http.service_control;
package espv2.api.envoy.v7.http.service_control;

import "api/envoy/v6/http/service_control/requirement.proto";
import "api/envoy/v7/http/service_control/requirement.proto";
import "google/api/service.proto";
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
import "api/envoy/v6/http/common/base.proto";
import "api/envoy/v7/http/common/base.proto";

message ServiceControlCallingConfig {
// In case of failing to connect to service control service, the requests
Expand Down Expand Up @@ -112,21 +112,21 @@ message FilterConfig {

// The Instance Metadata Server uri used to fetch access token from Instance
// Metadata Server.
espv2.api.envoy.v6.http.common.HttpUri imds_token = 4;
espv2.api.envoy.v7.http.common.HttpUri imds_token = 4;

// The local path or inline content of the service account json file used to
// generate access token.
espv2.api.envoy.v6.http.common.DataSource service_account_secret = 5;
espv2.api.envoy.v7.http.common.DataSource service_account_secret = 5;

// Information used to fetch access token from Google Cloud IAM.
espv2.api.envoy.v6.http.common.IamTokenInfo iam_token = 6;
espv2.api.envoy.v7.http.common.IamTokenInfo iam_token = 6;
}

// The service control call configuration.
ServiceControlCallingConfig sc_calling_config = 7;

// The Http uri to call service control
espv2.api.envoy.v6.http.common.HttpUri service_control_uri = 8;
espv2.api.envoy.v7.http.common.HttpUri service_control_uri = 8;

// The prefix added to generated headers
string generated_header_prefix = 9 [(validate.rules).string = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

syntax = "proto3";

package espv2.api.envoy.v6.http.service_control;
package espv2.api.envoy.v7.http.service_control;

import "validate/validate.proto";

Expand Down
30 changes: 15 additions & 15 deletions api/scripts/go_proto_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ rm -rf vendor/github.com/census-instrumentation/opencensus-proto/gen-go

#TODO(bochun): probably we can programatically generate these.
# HTTP filter common
bazel build //api/envoy/v6/http/common:base_go_proto
mkdir -p src/go/proto/api/envoy/v6/http/common
cp -f bazel-bin/api/envoy/v6/http/common/base_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/common/* src/go/proto/api/envoy/v6/http/common
bazel build //api/envoy/v7/http/common:base_go_proto
mkdir -p src/go/proto/api/envoy/v7/http/common
cp -f bazel-bin/api/envoy/v7/http/common/base_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/common/* src/go/proto/api/envoy/v7/http/common
# HTTP filter service_control
bazel build //api/envoy/v6/http/service_control:config_go_proto
mkdir -p src/go/proto/api/envoy/v6/http/service_control
cp -f bazel-bin/api/envoy/v6/http/service_control/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/service_control/* src/go/proto/api/envoy/v6/http/service_control
bazel build //api/envoy/v7/http/service_control:config_go_proto
mkdir -p src/go/proto/api/envoy/v7/http/service_control
cp -f bazel-bin/api/envoy/v7/http/service_control/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/service_control/* src/go/proto/api/envoy/v7/http/service_control
# HTTP filter path_matcher
bazel build //api/envoy/v6/http/path_matcher:config_go_proto
mkdir -p src/go/proto/api/envoy/v6/http/path_matcher
cp -f bazel-bin/api/envoy/v6/http/path_matcher/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/path_matcher/* src/go/proto/api/envoy/v6/http/path_matcher
bazel build //api/envoy/v7/http/path_matcher:config_go_proto
mkdir -p src/go/proto/api/envoy/v7/http/path_matcher
cp -f bazel-bin/api/envoy/v7/http/path_matcher/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/path_matcher/* src/go/proto/api/envoy/v7/http/path_matcher
# HTTP filter backend_auth
bazel build //api/envoy/v6/http/backend_auth:config_go_proto
mkdir -p src/go/proto/api/envoy/v6/http/backend_auth
cp -f bazel-bin/api/envoy/v6/http/backend_auth/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/backend_auth/* src/go/proto/api/envoy/v6/http/backend_auth
bazel build //api/envoy/v7/http/backend_auth:config_go_proto
mkdir -p src/go/proto/api/envoy/v7/http/backend_auth
cp -f bazel-bin/api/envoy/v7/http/backend_auth/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/backend_auth/* src/go/proto/api/envoy/v7/http/backend_auth
# HTTP filter backend_routing
bazel build //api/envoy/v6/http/backend_routing:config_go_proto
mkdir -p src/go/proto/api/envoy/v6/http/backend_routing
cp -f bazel-bin/api/envoy/v6/http/backend_routing/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v6/http/backend_routing/* src/go/proto/api/envoy/v6/http/backend_routing
bazel build //api/envoy/v7/http/backend_routing:config_go_proto
mkdir -p src/go/proto/api/envoy/v7/http/backend_routing
cp -f bazel-bin/api/envoy/v7/http/backend_routing/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/backend_routing/* src/go/proto/api/envoy/v7/http/backend_routing
2 changes: 1 addition & 1 deletion examples/auth/envoy_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
{
"name": "com.google.espv2.filters.http.path_matcher",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.path_matcher.FilterConfig",
"rules": [
{
"operation": "1.examples_auth_endpoints_cloudesf_testing_cloud_goog.CreateShelf",
Expand Down
6 changes: 3 additions & 3 deletions examples/dynamic_routing/envoy_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
{
"name": "com.google.espv2.filters.http.path_matcher",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.path_matcher.FilterConfig",
"rules": [
{
"operation": "1.examples_dynamic_routing_wd6ufmzfya_uc_a_run_app.CreateShelf",
Expand Down Expand Up @@ -244,7 +244,7 @@
{
"name": "com.google.espv2.filters.http.backend_auth",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.backend_auth.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.backend_auth.FilterConfig",
"imdsToken": {
"cluster": "metadata-cluster",
"timeout": "30s",
Expand All @@ -261,7 +261,7 @@
{
"name": "com.google.espv2.filters.http.backend_routing",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.backend_routing.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.backend_routing.FilterConfig",
"rules": [
{
"operation": "1.examples_dynamic_routing_wd6ufmzfya_uc_a_run_app.CreateShelf",
Expand Down
6 changes: 3 additions & 3 deletions examples/grpc_dynamic_routing/envoy_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
{
"name": "com.google.espv2.filters.http.path_matcher",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.path_matcher.FilterConfig",
"rules": [
{
"operation": "test.grpc.Test.Cork",
Expand Down Expand Up @@ -466,7 +466,7 @@
{
"name": "com.google.espv2.filters.http.service_control",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.service_control.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.service_control.FilterConfig",
"generatedHeaderPrefix": "X-Endpoint-",
"imdsToken": {
"cluster": "metadata-cluster",
Expand Down Expand Up @@ -1072,7 +1072,7 @@
{
"name": "com.google.espv2.filters.http.backend_auth",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.backend_auth.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.backend_auth.FilterConfig",
"imdsToken": {
"cluster": "metadata-cluster",
"timeout": "30s",
Expand Down
4 changes: 2 additions & 2 deletions examples/service_control/envoy_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
{
"name": "com.google.espv2.filters.http.path_matcher",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.path_matcher.FilterConfig",
"rules": [
{
"operation": "1.examples_service_control_endpoints_cloudesf_testing_cloud_goog.CreateShelf",
Expand Down Expand Up @@ -164,7 +164,7 @@
{
"name": "com.google.espv2.filters.http.service_control",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.service_control.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.service_control.FilterConfig",
"generatedHeaderPrefix": "X-Endpoint-",
"imdsToken": {
"cluster": "metadata-cluster",
Expand Down
6 changes: 3 additions & 3 deletions examples/testdata/path_matcher/envoy_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
{
"name": "com.google.espv2.filters.http.path_matcher",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.path_matcher.FilterConfig",
"rules": [
{
"operation": "1.examples_path_matcher_endpoints_cloudesf_testing_cloud_goog.GetShelf",
Expand All @@ -174,7 +174,7 @@
{
"name": "com.google.espv2.filters.http.backend_auth",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.backend_auth.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.backend_auth.FilterConfig",
"imdsToken": {
"cluster": "metadata-cluster",
"timeout": "30s",
Expand All @@ -191,7 +191,7 @@
{
"name": "com.google.espv2.filters.http.backend_routing",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v6.http.backend_routing.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.backend_routing.FilterConfig",
"rules": [
{
"operation": "1.examples_path_matcher_endpoints_cloudesf_testing_cloud_goog.GetShelf",
Expand Down
4 changes: 2 additions & 2 deletions src/envoy/http/backend_auth/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ envoy_cc_library(
repository = "@envoy",
deps = [
":config_parser_lib",
"//api/envoy/v6/http/backend_auth:config_proto_cc_proto",
"//api/envoy/v7/http/backend_auth:config_proto_cc_proto",
"//src/envoy/utils:filter_state_utils_lib",
"@envoy//source/extensions/filters/http/common:pass_through_filter_lib",
],
Expand All @@ -48,7 +48,7 @@ envoy_cc_library(
],
repository = "@envoy",
deps = [
"//api/envoy/v6/http/backend_auth:config_proto_cc_proto",
"//api/envoy/v7/http/backend_auth:config_proto_cc_proto",
"//src/envoy/token:token_subscriber_factory_lib",
"@envoy//source/common/common:assert_lib",
],
Expand Down
2 changes: 1 addition & 1 deletion src/envoy/http/backend_auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This filter is designed to strongly integrate with the following filters:

## Configuration

View the [backend auth configuration proto](../../../../api/envoy/v6/http/backend_auth/config.proto)
View the [backend auth configuration proto](../../../../api/envoy/v7/http/backend_auth/config.proto)
for inline documentation.

## Statistics
Expand Down
2 changes: 1 addition & 1 deletion src/envoy/http/backend_auth/config_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "absl/container/flat_hash_map.h"
#include "absl/strings/str_cat.h"
#include "api/envoy/v6/http/backend_auth/config.pb.h"
#include "api/envoy/v7/http/backend_auth/config.pb.h"
#include "envoy/thread_local/thread_local.h"
#include "src/envoy/token/token_subscriber_factory.h"

Expand Down
Loading

0 comments on commit 14aadff

Please sign in to comment.