Skip to content

Commit

Permalink
Update api version v7 -> v8 (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
TAOXUY authored Aug 18, 2020
1 parent 605ad36 commit 0edf8d7
Show file tree
Hide file tree
Showing 79 changed files with 252 additions and 252 deletions.
8 changes: 4 additions & 4 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ This folder stores filter config proto files for ESPv2 http filters.
## Config versioning:

ESPv2 config is versioned. The current version is stored in `api/VERSION` file.
The folder names under `api/` contain version, e.g. `api/envoy/v7/http/backend_auth`.
The proto package names contain version too, e.g. `espv2.api.envoy.v7.http.common.Pattern`.
The folder names under `api/` contain version, e.g. `api/envoy/v8/http/backend_auth`.
The proto package names contain version too, e.g. `espv2.api.envoy.v8.http.common.Pattern`.

## Versioning Rules:
When making changes to the config proto files, make sure:
Expand All @@ -15,7 +15,7 @@ When making changes to the config proto files, make sure:
## Steps to increase config version
If a breaking change is required, use following steps to increase config version.
* Increase `api/VERSION` to a newer version, e.g. from `v6` to `v7`.
* 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/`.
* Rename folder name from `api/envoy/v6/http` to `api/envoy/v8/http`.
* Replace package names from `api.envoy.v6.http` to `api.envoy.v8.http` for all proto files under folder `api/`.

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 @@
v7
v8
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/v7/http/common:base_proto",
"//api/envoy/v8/http/common:base_proto",
],
)

go_proto_library(
name = "config_go_proto",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/backend_auth",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/http/backend_auth",
proto = ":config_proto",
deps = [
"//api/envoy/v7/http/common:base_go_proto",
"//api/envoy/v8/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.v7.http.backend_auth;
package espv2.api.envoy.v8.http.backend_auth;

import "api/envoy/v7/http/common/base.proto";
import "api/envoy/v8/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.v7.http.common.HttpUri imds_token = 2;
espv2.api.envoy.v8.http.common.HttpUri imds_token = 2;

// Information used to fetch id token from Google Cloud IAM.
espv2.api.envoy.v7.http.common.IamTokenInfo iam_token = 3;
espv2.api.envoy.v8.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/v7/http/backend_routing",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/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.v7.http.backend_routing;
package espv2.api.envoy.v8.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/v7/http/common",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/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.v7.http.common;
package espv2.api.envoy.v8.http.common;

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

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

// Information used to get access token.
espv2.api.envoy.v7.http.common.AccessToken access_token = 2;
espv2.api.envoy.v8.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/v7/http/common:base_proto",
"//api/envoy/v8/http/common:base_proto",
],
)

go_proto_library(
name = "config_go_proto",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v7/http/path_matcher",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/http/path_matcher",
proto = ":config_proto",
deps = [
"//api/envoy/v7/http/common:base_go_proto",
"//api/envoy/v8/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.v7.http.path_matcher;
package espv2.api.envoy.v8.http.path_matcher;

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

message PathMatcherRule {
// The pattern used to match a HTTP request.
espv2.api.envoy.v7.http.common.Pattern pattern = 1;
espv2.api.envoy.v8.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/v7/http/common:base_proto",
"//api/envoy/v8/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/v7/http/service_control",
importpath = "github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/http/service_control",
proto = ":config_proto",
deps = [
"//api/envoy/v7/http/common:base_go_proto",
"//api/envoy/v8/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.v7.http.service_control;
package espv2.api.envoy.v8.http.service_control;

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

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

// Uri used to fetch access token from Instance Metadata Server or the local
// token agent server.
espv2.api.envoy.v7.http.common.HttpUri imds_token = 4;
espv2.api.envoy.v8.http.common.HttpUri imds_token = 4;

// Information used to fetch access token from Google Cloud IAM.
espv2.api.envoy.v7.http.common.IamTokenInfo iam_token = 6;
espv2.api.envoy.v8.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.v7.http.common.HttpUri service_control_uri = 8;
espv2.api.envoy.v8.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.v7.http.service_control;
package espv2.api.envoy.v8.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/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
bazel build //api/envoy/v8/http/common:base_go_proto
mkdir -p src/go/proto/api/envoy/v8/http/common
cp -f bazel-bin/api/envoy/v8/http/common/base_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/http/common/* src/go/proto/api/envoy/v8/http/common
# HTTP filter 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
bazel build //api/envoy/v8/http/service_control:config_go_proto
mkdir -p src/go/proto/api/envoy/v8/http/service_control
cp -f bazel-bin/api/envoy/v8/http/service_control/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/http/service_control/* src/go/proto/api/envoy/v8/http/service_control
# HTTP filter 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
bazel build //api/envoy/v8/http/path_matcher:config_go_proto
mkdir -p src/go/proto/api/envoy/v8/http/path_matcher
cp -f bazel-bin/api/envoy/v8/http/path_matcher/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/http/path_matcher/* src/go/proto/api/envoy/v8/http/path_matcher
# HTTP filter 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
bazel build //api/envoy/v8/http/backend_auth:config_go_proto
mkdir -p src/go/proto/api/envoy/v8/http/backend_auth
cp -f bazel-bin/api/envoy/v8/http/backend_auth/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/http/backend_auth/* src/go/proto/api/envoy/v8/http/backend_auth
# HTTP filter 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
bazel build //api/envoy/v8/http/backend_routing:config_go_proto
mkdir -p src/go/proto/api/envoy/v8/http/backend_routing
cp -f bazel-bin/api/envoy/v8/http/backend_routing/config_go_proto_/github.com/GoogleCloudPlatform/esp-v2/src/go/proto/api/envoy/v8/http/backend_routing/* src/go/proto/api/envoy/v8/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.v7.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.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.v7.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.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.v7.http.backend_auth.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.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.v7.http.backend_routing.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.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.v7.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.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.v7.http.service_control.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.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.v7.http.backend_auth.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.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.v7.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.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.v7.http.service_control.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.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.v7.http.path_matcher.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.http.path_matcher.FilterConfig",
"rules": [
{
"operation": "1.examples_path_matcher_endpoints_cloudesf_testing_cloud_goog.CORS_**",
Expand Down Expand Up @@ -224,7 +224,7 @@
{
"name": "com.google.espv2.filters.http.backend_auth",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.backend_auth.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.http.backend_auth.FilterConfig",
"imdsToken": {
"cluster": "metadata-cluster",
"timeout": "30s",
Expand All @@ -245,7 +245,7 @@
{
"name": "com.google.espv2.filters.http.backend_routing",
"typedConfig": {
"@type": "type.googleapis.com/espv2.api.envoy.v7.http.backend_routing.FilterConfig",
"@type": "type.googleapis.com/espv2.api.envoy.v8.http.backend_routing.FilterConfig",
"rules": [
{
"operation": "1.examples_path_matcher_endpoints_cloudesf_testing_cloud_goog.CORS_libraries_library_id_shelves_shelf_id",
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/v7/http/backend_auth:config_proto_cc_proto",
"//api/envoy/v8/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/v7/http/backend_auth:config_proto_cc_proto",
"//api/envoy/v8/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/v7/http/backend_auth/config.proto)
View the [backend auth configuration proto](../../../../api/envoy/v8/http/backend_auth/config.proto)
for inline documentation.

## Statistics
Expand Down
Loading

3 comments on commit 0edf8d7

@nareddyt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @brandon1980, I assume that was posted by mistake?

@brandon1980
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@brandon1980
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.