Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 11 additions & 31 deletions api/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,47 +85,29 @@ In addition, the following conventions should be followed:

## Package organization

API definitions are layered hierarchically in packages from top-to-bottom in v2 as following:

- `envoy.service` contains gRPC definitions of supporting services;
- `envoy.config` contains definitions for service configuration, filter
configuration, and bootstrap;
- `envoy.api.v2` contains definitions for EDS, CDS, RDS, LDS, and top-level
resources such as `Cluster`;
- `envoy.api.v2.endpoint`, `envoy.api.v2.cluster`, `envoy.api.v2.route`,
`envoy.api.v2.listener`, `envoy.api.v2.ratelimit` define sub-messages of the top-level resources;
- `envoy.api.v2.core` and `envoy.api.v2.auth` hold core definitions consumed
throughout the API.

In Envoy API v3, API definitions are layered hierarchically in packages from top-to-bottom as following:
API definitions are layered hierarchically in packages from top-to-bottom as following:
- `envoy.extensions` contains all definitions for the extensions, the package should match the structure of the `source` directory.
- `envoy.service` contains gRPC definitions of supporting services and top-level messages for the services.
e.g. `envoy.service.route.v3` contains RDS, `envoy.service.listener.v3` contains LDS.
- `envoy.config` contains other definitions for service configuration, bootstrap and some legacy core types.
- `envoy.data` contains data format declaration for data types that Envoy produces.
- `envoy.type` contains common protobuf types such as percent, range and matchers.

Dependencies are enforced from top-to-bottom using visibility constraints in
the build system to prevent circular dependency formation. Package group
`//envoy/api/v2:friends` selects consumers of the core API package (services and configs)
and is the default visibility for the core API packages. The default visibility
for services and configs should be `//docs` (proto documentation tool).

Extensions should use the regular hierarchy. For example, configuration for network filters belongs
in a package under `envoy.config.filter.network`.
in a package under `envoy.extensions.filter.network`.

## Adding an extension configuration to the API

Extensions must currently be added as v2 APIs following the [package
Extensions must currently be added as v3 APIs following the [package
organization](#package-organization) above.
To add an extension config to the API, the steps below should be followed:

1. If this is still WiP and subject to breaking changes, use `vNalpha` instead of `vN` in steps
below. Refer to the [Cache filter config](envoy/config/filter/http/cache/v2alpha/cache.proto)
as an example of `v2alpha`, and the
[Buffer filter config](envoy/config/filter/http/buffer/v2/buffer.proto) as an example of `v2`.
1. Place the v2 extension configuration `.proto` in `api/envoy/config`, e.g.
`api/envoy/config/filter/http/foobar/v2/foobar.proto` together with an initial BUILD file:
below. Refer to the [Cache filter config](envoy/extensions/filter/http/cache/v3alpha/cache.proto)
as an example of `v3alpha`, and the
[Buffer filter config](envoy/extensions/filter/http/buffer/v3/buffer.proto) as an example of `v3`.
1. Place the v3 extension configuration `.proto` in `api/envoy/config`, e.g.
`api/envoy/extensions/filter/http/foobar/v3/foobar.proto` together with an initial BUILD file:
```bazel
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")

Expand All @@ -135,14 +117,12 @@ To add an extension config to the API, the steps below should be followed:
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
```
1. Add to the v2 extension config proto `import "udpa/annotations/migrate.proto";`
1. Add to the v2 extension config proto a file level `option (udpa.annotations.file_migrate).move_to_package = "envoy.extensions.filters.http.foobar.v3";`.
This places the filter in the correct [v3 package hierarchy](#package-organization).
1. Add to the v3 extension config proto `import "udpa/annotations/migrate.proto";`
1. If this is still WiP and subject to breaking changes, import
`udpa/annotations/status.proto` and set `option (udpa.annotations.file_status).work_in_progress = true;`.
1. Add a reference to the v2 extension config in (1) in [api/versioning/BUILD](versioning/BUILD).
1. Add a reference to the v3 extension config in (1) in [api/versioning/BUILD](versioning/BUILD) under `active_protos`.
1. Run `./tools/proto_format/proto_format.sh fix`. This should regenerate the `BUILD` file,
reformat `foobar.proto` as needed and also generate the v3 extension config,
reformat `foobar.proto` as needed and also generate the v4alpha extension config (if needed),
together with shadow API protos.
1. `git add api/ generated_api_shadow/` to add any new files to your Git index.

Expand Down
4 changes: 2 additions & 2 deletions api/bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ GOOGLEAPIS_SHA = "a45019af4d3290f02eaeb1ce10990166978c807cb33a9692141a076ba46d14
PROMETHEUS_GIT_SHA = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c" # Nov 17, 2017
PROMETHEUS_SHA = "783bdaf8ee0464b35ec0c8704871e1e72afa0005c3f3587f65d9d6694bf3911b"

UDPA_GIT_SHA = "bae28a880fdbbb687d78823435febdba5fee651a" # Mar 24, 2020
UDPA_SHA256 = "ce73a39be04e6ecdf8150580b9989bd6e16765887a96f3810b9105f18902fc6a"
UDPA_GIT_SHA = "e8cd3a4bb307e2c810cffff99f93e96e6d7fee85" # Mar 27, 2020
UDPA_SHA256 = "1fd7857cb61daee7726fca8f4d55e4923774a8d00a53007a4093830dc0482685"

ZIPKINAPI_RELEASE = "0.2.2" # Aug 23, 2019
ZIPKINAPI_SHA256 = "688c4fe170821dd589f36ec45aaadc03a618a40283bc1f97da8fa11686fc816b"
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v2alpha/certs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.admin.v2alpha";
option java_outer_classname = "CertsProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Certificates]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v2alpha/clusters.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.admin.v2alpha";
option java_outer_classname = "ClustersProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Clusters]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v2alpha/config_dump.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.admin.v2alpha";
option java_outer_classname = "ConfigDumpProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: ConfigDump]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v2alpha/listeners.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.admin.v2alpha";
option java_outer_classname = "ListenersProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Listeners]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v2alpha/memory.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.admin.v2alpha";
option java_outer_classname = "MemoryProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Memory]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v2alpha/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.admin.v2alpha";
option java_outer_classname = "MetricsProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Metrics]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v2alpha/mutex_stats.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.admin.v2alpha";
option java_outer_classname = "MutexStatsProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: MutexStats]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v2alpha/server_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.admin.v2alpha";
option java_outer_classname = "ServerInfoProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Server State]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v2alpha/tap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.admin.v2alpha";
option java_outer_classname = "TapProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Tap]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v3/certs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "udpa/annotations/versioning.proto";
option java_package = "io.envoyproxy.envoy.admin.v3";
option java_outer_classname = "CertsProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Certificates]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v3/clusters.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "udpa/annotations/versioning.proto";
option java_package = "io.envoyproxy.envoy.admin.v3";
option java_outer_classname = "ClustersProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Clusters]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v3/config_dump.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import "udpa/annotations/versioning.proto";
option java_package = "io.envoyproxy.envoy.admin.v3";
option java_outer_classname = "ConfigDumpProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: ConfigDump]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v3/listeners.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "udpa/annotations/versioning.proto";
option java_package = "io.envoyproxy.envoy.admin.v3";
option java_outer_classname = "ListenersProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Listeners]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v3/memory.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "udpa/annotations/versioning.proto";
option java_package = "io.envoyproxy.envoy.admin.v3";
option java_outer_classname = "MemoryProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Memory]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v3/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "udpa/annotations/versioning.proto";
option java_package = "io.envoyproxy.envoy.admin.v3";
option java_outer_classname = "MetricsProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Metrics]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v3/mutex_stats.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "udpa/annotations/versioning.proto";
option java_package = "io.envoyproxy.envoy.admin.v3";
option java_outer_classname = "MutexStatsProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: MutexStats]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v3/server_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "udpa/annotations/versioning.proto";
option java_package = "io.envoyproxy.envoy.admin.v3";
option java_outer_classname = "ServerInfoProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Server State]

Expand Down
2 changes: 1 addition & 1 deletion api/envoy/admin/v3/tap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.admin.v3";
option java_outer_classname = "TapProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Tap]

Expand Down
17 changes: 17 additions & 0 deletions api/envoy/admin/v4alpha/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# DO NOT EDIT. This file is generated by tools/proto_sync.py.

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

licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/admin/v3:pkg",
"//envoy/annotations:pkg",
"//envoy/config/bootstrap/v4alpha:pkg",
"//envoy/config/core/v4alpha:pkg",
"//envoy/config/tap/v3:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
72 changes: 72 additions & 0 deletions api/envoy/admin/v4alpha/certs.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
syntax = "proto3";

package envoy.admin.v4alpha;

import "google/protobuf/timestamp.proto";

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

option java_package = "io.envoyproxy.envoy.admin.v4alpha";
option java_outer_classname = "CertsProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;

// [#protodoc-title: Certificates]

// Proto representation of certificate details. Admin endpoint uses this wrapper for `/certs` to
// display certificate information. See :ref:`/certs <operations_admin_interface_certs>` for more
// information.
message Certificates {
option (udpa.annotations.versioning).previous_message_type = "envoy.admin.v3.Certificates";

// List of certificates known to an Envoy.
repeated Certificate certificates = 1;
}

message Certificate {
option (udpa.annotations.versioning).previous_message_type = "envoy.admin.v3.Certificate";

// Details of CA certificate.
repeated CertificateDetails ca_cert = 1;

// Details of Certificate Chain
repeated CertificateDetails cert_chain = 2;
}

// [#next-free-field: 7]
message CertificateDetails {
option (udpa.annotations.versioning).previous_message_type = "envoy.admin.v3.CertificateDetails";

// Path of the certificate.
string path = 1;

// Certificate Serial Number.
string serial_number = 2;

// List of Subject Alternate names.
repeated SubjectAlternateName subject_alt_names = 3;

// Minimum of days until expiration of certificate and it's chain.
uint64 days_until_expiration = 4;

// Indicates the time from which the certificate is valid.
google.protobuf.Timestamp valid_from = 5;

// Indicates the time at which the certificate expires.
google.protobuf.Timestamp expiration_time = 6;
}

message SubjectAlternateName {
option (udpa.annotations.versioning).previous_message_type =
"envoy.admin.v3.SubjectAlternateName";

// Subject Alternate Name.
oneof name {
string dns = 1;

string uri = 2;

string ip_address = 3;
}
}
Loading