Skip to content
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

filters: Add dependencies.proto #14750

Merged
merged 17 commits into from
Jan 22, 2021
1 change: 1 addition & 0 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ proto_library(
"//envoy/extensions/common/tap/v3:pkg",
"//envoy/extensions/compression/gzip/compressor/v3:pkg",
"//envoy/extensions/compression/gzip/decompressor/v3:pkg",
"//envoy/extensions/filters/common/dependency/v3:pkg",
"//envoy/extensions/filters/common/fault/v3:pkg",
"//envoy/extensions/filters/common/matcher/action/v3:pkg",
"//envoy/extensions/filters/http/adaptive_concurrency/v3:pkg",
Expand Down
3 changes: 2 additions & 1 deletion api/envoy/config/filter/http/jwt_authn/v2alpha/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ message FilterStateRule {

// A map of string keys to requirements. The string key is the string value
// in the FilterState with the name specified in the *name* field above.
map<string, JwtRequirement> requires = 3;
map<string, JwtRequirement>
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

requires = 3;
}

// This is the Envoy HTTP filter config for JWT authentication.
Expand Down
9 changes: 9 additions & 0 deletions api/envoy/extensions/filters/common/dependency/v3/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.

load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")

licenses(["notice"]) # Apache 2

api_proto_package(
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
44 changes: 44 additions & 0 deletions api/envoy/extensions/filters/common/dependency/v3/dependency.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
syntax = "proto3";

package envoy.extensions.filters.common.dependency.v3;

import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";

option java_package = "io.envoyproxy.envoy.extensions.filters.common.dependency.v3";
option java_outer_classname = "DependencyProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Filter dependency specification]

// Dependency specification and string identifier.
message Dependency {
enum DependencyType {
HEADER = 0;
FILTER_STATE_KEY = 1;
DYNAMIC_METADATA = 2;
}

// The kind of dependency.
DependencyType type = 1;

// String identifier for the dependency.
string name = 2;
Copy link
Member

Choose a reason for hiding this comment

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

Please comment all fields.

Copy link
Contributor

Choose a reason for hiding this comment

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

Although this is not exactly an API proto, please consider specifying default values if there are, and use PGV for required fields or other fields constraints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I think? Not sure if there are validation rules possible for fields other than the string.

}

// Dependency specification for a filter. For a filter chain to be valid, any
// dependency that is required must be provided by an earlier filter.
message FilterDependencies {
// A list of dependencies required on the decode path.
repeated Dependency decode_required = 1;

// A list of dependencies provided on the encode path.
repeated Dependency decode_provided = 2;

// A list of dependencies required on the decode path.
repeated Dependency encode_required = 3;

// A list of dependencies provided on the encode path.
repeated Dependency encode_provided = 4;
}
3 changes: 2 additions & 1 deletion api/envoy/extensions/filters/http/jwt_authn/v3/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ message FilterStateRule {

// A map of string keys to requirements. The string key is the string value
// in the FilterState with the name specified in the *name* field above.
map<string, JwtRequirement> requires = 3;
map<string, JwtRequirement>
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be reverted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

requires = 3;
}

// This is the Envoy HTTP filter config for JWT authentication.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/versioning/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ proto_library(
"//envoy/extensions/common/tap/v3:pkg",
"//envoy/extensions/compression/gzip/compressor/v3:pkg",
"//envoy/extensions/compression/gzip/decompressor/v3:pkg",
"//envoy/extensions/filters/common/dependency/v3:pkg",
"//envoy/extensions/filters/common/fault/v3:pkg",
"//envoy/extensions/filters/common/matcher/action/v3:pkg",
"//envoy/extensions/filters/http/adaptive_concurrency/v3:pkg",
Expand Down

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.

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.