mirror of https://github.com/grpc/grpc-node.git
grpc-js-xds: Switch from udpa to xds submodule
This commit is contained in:
parent
5a49a93065
commit
692ee3c03f
|
@ -10,12 +10,12 @@
|
|||
[submodule "packages/grpc-js-xds/deps/envoy-api"]
|
||||
path = packages/grpc-js-xds/deps/envoy-api
|
||||
url = https://github.com/envoyproxy/data-plane-api.git
|
||||
[submodule "packages/grpc-js-xds/deps/udpa"]
|
||||
path = packages/grpc-js-xds/deps/udpa
|
||||
url = https://github.com/cncf/udpa.git
|
||||
[submodule "packages/grpc-js-xds/deps/googleapis"]
|
||||
path = packages/grpc-js-xds/deps/googleapis
|
||||
url = https://github.com/googleapis/googleapis.git
|
||||
[submodule "packages/grpc-js-xds/deps/protoc-gen-validate"]
|
||||
path = packages/grpc-js-xds/deps/protoc-gen-validate
|
||||
url = https://github.com/envoyproxy/protoc-gen-validate.git
|
||||
[submodule "packages/grpc-js-xds/deps/xds"]
|
||||
path = packages/grpc-js-xds/deps/xds
|
||||
url = https://github.com/cncf/xds.git
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit cc1b757b3eddccaaaf0743cbb107742bb7e3ee4f
|
|
@ -0,0 +1 @@
|
|||
Subproject commit cb28da3451f158a947dfc45090fe92b07b243bc1
|
|
@ -12,7 +12,7 @@
|
|||
"prepare": "npm run compile",
|
||||
"pretest": "npm run compile",
|
||||
"posttest": "npm run check",
|
||||
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs deps/envoy-api/ deps/udpa/ deps/googleapis/ deps/protoc-gen-validate/ -O src/generated/ --grpcLib @grpc/grpc-js envoy/service/discovery/v2/ads.proto envoy/service/load_stats/v2/lrs.proto envoy/service/discovery/v3/ads.proto envoy/service/load_stats/v3/lrs.proto envoy/config/listener/v3/listener.proto envoy/config/route/v3/route.proto envoy/config/cluster/v3/cluster.proto envoy/config/endpoint/v3/endpoint.proto envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto udpa/type/v1/typed_struct.proto envoy/extensions/filters/http/fault/v3/fault.proto",
|
||||
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs deps/envoy-api/ deps/xds/ deps/googleapis/ deps/protoc-gen-validate/ -O src/generated/ --grpcLib @grpc/grpc-js envoy/service/discovery/v2/ads.proto envoy/service/load_stats/v2/lrs.proto envoy/service/discovery/v3/ads.proto envoy/service/load_stats/v3/lrs.proto envoy/config/listener/v3/listener.proto envoy/config/route/v3/route.proto envoy/config/cluster/v3/cluster.proto envoy/config/endpoint/v3/endpoint.proto envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto udpa/type/v1/typed_struct.proto xds/type/v3/typed_struct.proto envoy/extensions/filters/http/fault/v3/fault.proto",
|
||||
"generate-interop-types": "proto-loader-gen-types --keep-case --longs String --enums String --defaults --oneofs --json --includeComments --includeDirs proto/ -O interop/generated --grpcLib @grpc/grpc-js grpc/testing/test.proto"
|
||||
},
|
||||
"repository": {
|
||||
|
|
|
@ -189,6 +189,15 @@ export interface ProtoGrpcType {
|
|||
UInt64Rules: MessageTypeDefinition
|
||||
}
|
||||
xds: {
|
||||
annotations: {
|
||||
v3: {
|
||||
FieldStatusAnnotation: MessageTypeDefinition
|
||||
FileStatusAnnotation: MessageTypeDefinition
|
||||
MessageStatusAnnotation: MessageTypeDefinition
|
||||
PackageVersionStatus: EnumTypeDefinition
|
||||
StatusAnnotation: MessageTypeDefinition
|
||||
}
|
||||
}
|
||||
core: {
|
||||
v3: {
|
||||
Authority: MessageTypeDefinition
|
||||
|
|
|
@ -210,6 +210,15 @@ export interface ProtoGrpcType {
|
|||
UInt64Rules: MessageTypeDefinition
|
||||
}
|
||||
xds: {
|
||||
annotations: {
|
||||
v3: {
|
||||
FieldStatusAnnotation: MessageTypeDefinition
|
||||
FileStatusAnnotation: MessageTypeDefinition
|
||||
MessageStatusAnnotation: MessageTypeDefinition
|
||||
PackageVersionStatus: EnumTypeDefinition
|
||||
StatusAnnotation: MessageTypeDefinition
|
||||
}
|
||||
}
|
||||
core: {
|
||||
v3: {
|
||||
Authority: MessageTypeDefinition
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
|
||||
import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from '../../validate/FieldRules';
|
||||
import type { FieldMigrateAnnotation as _udpa_annotations_FieldMigrateAnnotation, FieldMigrateAnnotation__Output as _udpa_annotations_FieldMigrateAnnotation__Output } from '../../udpa/annotations/FieldMigrateAnnotation';
|
||||
import type { FieldStatusAnnotation as _xds_annotations_v3_FieldStatusAnnotation, FieldStatusAnnotation__Output as _xds_annotations_v3_FieldStatusAnnotation__Output } from '../../xds/annotations/v3/FieldStatusAnnotation';
|
||||
|
||||
// Original file: null
|
||||
|
||||
|
@ -32,6 +33,7 @@ export interface FieldOptions {
|
|||
'.udpa.annotations.sensitive'?: (boolean);
|
||||
'.udpa.annotations.field_migrate'?: (_udpa_annotations_FieldMigrateAnnotation | null);
|
||||
'.envoy.annotations.disallowed_by_default'?: (boolean);
|
||||
'.xds.annotations.v3.field_status'?: (_xds_annotations_v3_FieldStatusAnnotation | null);
|
||||
}
|
||||
|
||||
export interface FieldOptions__Output {
|
||||
|
@ -46,4 +48,5 @@ export interface FieldOptions__Output {
|
|||
'.udpa.annotations.sensitive': (boolean);
|
||||
'.udpa.annotations.field_migrate': (_udpa_annotations_FieldMigrateAnnotation__Output | null);
|
||||
'.envoy.annotations.disallowed_by_default': (boolean);
|
||||
'.xds.annotations.v3.field_status': (_xds_annotations_v3_FieldStatusAnnotation__Output | null);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
|
||||
import type { FileMigrateAnnotation as _udpa_annotations_FileMigrateAnnotation, FileMigrateAnnotation__Output as _udpa_annotations_FileMigrateAnnotation__Output } from '../../udpa/annotations/FileMigrateAnnotation';
|
||||
import type { StatusAnnotation as _udpa_annotations_StatusAnnotation, StatusAnnotation__Output as _udpa_annotations_StatusAnnotation__Output } from '../../udpa/annotations/StatusAnnotation';
|
||||
import type { FileStatusAnnotation as _xds_annotations_v3_FileStatusAnnotation, FileStatusAnnotation__Output as _xds_annotations_v3_FileStatusAnnotation__Output } from '../../xds/annotations/v3/FileStatusAnnotation';
|
||||
|
||||
// Original file: null
|
||||
|
||||
|
@ -30,6 +31,7 @@ export interface FileOptions {
|
|||
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
|
||||
'.udpa.annotations.file_migrate'?: (_udpa_annotations_FileMigrateAnnotation | null);
|
||||
'.udpa.annotations.file_status'?: (_udpa_annotations_StatusAnnotation | null);
|
||||
'.xds.annotations.v3.file_status'?: (_xds_annotations_v3_FileStatusAnnotation | null);
|
||||
}
|
||||
|
||||
export interface FileOptions__Output {
|
||||
|
@ -50,4 +52,5 @@ export interface FileOptions__Output {
|
|||
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
|
||||
'.udpa.annotations.file_migrate': (_udpa_annotations_FileMigrateAnnotation__Output | null);
|
||||
'.udpa.annotations.file_status': (_udpa_annotations_StatusAnnotation__Output | null);
|
||||
'.xds.annotations.v3.file_status': (_xds_annotations_v3_FileStatusAnnotation__Output | null);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
|
||||
import type { VersioningAnnotation as _udpa_annotations_VersioningAnnotation, VersioningAnnotation__Output as _udpa_annotations_VersioningAnnotation__Output } from '../../udpa/annotations/VersioningAnnotation';
|
||||
import type { MigrateAnnotation as _udpa_annotations_MigrateAnnotation, MigrateAnnotation__Output as _udpa_annotations_MigrateAnnotation__Output } from '../../udpa/annotations/MigrateAnnotation';
|
||||
import type { MessageStatusAnnotation as _xds_annotations_v3_MessageStatusAnnotation, MessageStatusAnnotation__Output as _xds_annotations_v3_MessageStatusAnnotation__Output } from '../../xds/annotations/v3/MessageStatusAnnotation';
|
||||
|
||||
export interface MessageOptions {
|
||||
'messageSetWireFormat'?: (boolean);
|
||||
|
@ -13,6 +14,7 @@ export interface MessageOptions {
|
|||
'.validate.disabled'?: (boolean);
|
||||
'.udpa.annotations.versioning'?: (_udpa_annotations_VersioningAnnotation | null);
|
||||
'.udpa.annotations.message_migrate'?: (_udpa_annotations_MigrateAnnotation | null);
|
||||
'.xds.annotations.v3.message_status'?: (_xds_annotations_v3_MessageStatusAnnotation | null);
|
||||
}
|
||||
|
||||
export interface MessageOptions__Output {
|
||||
|
@ -24,4 +26,5 @@ export interface MessageOptions__Output {
|
|||
'.validate.disabled': (boolean);
|
||||
'.udpa.annotations.versioning': (_udpa_annotations_VersioningAnnotation__Output | null);
|
||||
'.udpa.annotations.message_migrate': (_udpa_annotations_MigrateAnnotation__Output | null);
|
||||
'.xds.annotations.v3.message_status': (_xds_annotations_v3_MessageStatusAnnotation__Output | null);
|
||||
}
|
||||
|
|
|
@ -250,6 +250,15 @@ export interface ProtoGrpcType {
|
|||
UInt64Rules: MessageTypeDefinition
|
||||
}
|
||||
xds: {
|
||||
annotations: {
|
||||
v3: {
|
||||
FieldStatusAnnotation: MessageTypeDefinition
|
||||
FileStatusAnnotation: MessageTypeDefinition
|
||||
MessageStatusAnnotation: MessageTypeDefinition
|
||||
PackageVersionStatus: EnumTypeDefinition
|
||||
StatusAnnotation: MessageTypeDefinition
|
||||
}
|
||||
}
|
||||
core: {
|
||||
v3: {
|
||||
Authority: MessageTypeDefinition
|
||||
|
|
|
@ -228,6 +228,15 @@ export interface ProtoGrpcType {
|
|||
UInt64Rules: MessageTypeDefinition
|
||||
}
|
||||
xds: {
|
||||
annotations: {
|
||||
v3: {
|
||||
FieldStatusAnnotation: MessageTypeDefinition
|
||||
FileStatusAnnotation: MessageTypeDefinition
|
||||
MessageStatusAnnotation: MessageTypeDefinition
|
||||
PackageVersionStatus: EnumTypeDefinition
|
||||
StatusAnnotation: MessageTypeDefinition
|
||||
}
|
||||
}
|
||||
core: {
|
||||
v3: {
|
||||
Authority: MessageTypeDefinition
|
||||
|
|
|
@ -192,6 +192,15 @@ export interface ProtoGrpcType {
|
|||
UInt64Rules: MessageTypeDefinition
|
||||
}
|
||||
xds: {
|
||||
annotations: {
|
||||
v3: {
|
||||
FieldStatusAnnotation: MessageTypeDefinition
|
||||
FileStatusAnnotation: MessageTypeDefinition
|
||||
MessageStatusAnnotation: MessageTypeDefinition
|
||||
PackageVersionStatus: EnumTypeDefinition
|
||||
StatusAnnotation: MessageTypeDefinition
|
||||
}
|
||||
}
|
||||
core: {
|
||||
v3: {
|
||||
Authority: MessageTypeDefinition
|
||||
|
|
|
@ -70,5 +70,12 @@ export interface ProtoGrpcType {
|
|||
UInt32Rules: MessageTypeDefinition
|
||||
UInt64Rules: MessageTypeDefinition
|
||||
}
|
||||
xds: {
|
||||
type: {
|
||||
v3: {
|
||||
TypedStruct: MessageTypeDefinition
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/udpa/annotations/migrate.proto
|
||||
// Original file: deps/xds/udpa/annotations/migrate.proto
|
||||
|
||||
|
||||
export interface FieldMigrateAnnotation {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/udpa/annotations/security.proto
|
||||
// Original file: deps/xds/udpa/annotations/security.proto
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/udpa/annotations/migrate.proto
|
||||
// Original file: deps/xds/udpa/annotations/migrate.proto
|
||||
|
||||
|
||||
export interface FileMigrateAnnotation {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/udpa/annotations/migrate.proto
|
||||
// Original file: deps/xds/udpa/annotations/migrate.proto
|
||||
|
||||
|
||||
export interface MigrateAnnotation {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/udpa/annotations/status.proto
|
||||
// Original file: deps/xds/udpa/annotations/status.proto
|
||||
|
||||
export enum PackageVersionStatus {
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/udpa/annotations/status.proto
|
||||
// Original file: deps/xds/udpa/annotations/status.proto
|
||||
|
||||
import type { PackageVersionStatus as _udpa_annotations_PackageVersionStatus } from '../../udpa/annotations/PackageVersionStatus';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/udpa/annotations/versioning.proto
|
||||
// Original file: deps/xds/udpa/annotations/versioning.proto
|
||||
|
||||
|
||||
export interface VersioningAnnotation {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/udpa/type/v1/typed_struct.proto
|
||||
// Original file: deps/xds/udpa/type/v1/typed_struct.proto
|
||||
|
||||
import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../google/protobuf/Struct';
|
||||
|
||||
|
|
16
packages/grpc-js-xds/src/generated/xds/annotations/v3/FieldStatusAnnotation.ts
generated
Normal file
16
packages/grpc-js-xds/src/generated/xds/annotations/v3/FieldStatusAnnotation.ts
generated
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Original file: deps/xds/xds/annotations/v3/status.proto
|
||||
|
||||
|
||||
export interface FieldStatusAnnotation {
|
||||
/**
|
||||
* The entity is work-in-progress and subject to breaking changes.
|
||||
*/
|
||||
'work_in_progress'?: (boolean);
|
||||
}
|
||||
|
||||
export interface FieldStatusAnnotation__Output {
|
||||
/**
|
||||
* The entity is work-in-progress and subject to breaking changes.
|
||||
*/
|
||||
'work_in_progress': (boolean);
|
||||
}
|
16
packages/grpc-js-xds/src/generated/xds/annotations/v3/FileStatusAnnotation.ts
generated
Normal file
16
packages/grpc-js-xds/src/generated/xds/annotations/v3/FileStatusAnnotation.ts
generated
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Original file: deps/xds/xds/annotations/v3/status.proto
|
||||
|
||||
|
||||
export interface FileStatusAnnotation {
|
||||
/**
|
||||
* The entity is work-in-progress and subject to breaking changes.
|
||||
*/
|
||||
'work_in_progress'?: (boolean);
|
||||
}
|
||||
|
||||
export interface FileStatusAnnotation__Output {
|
||||
/**
|
||||
* The entity is work-in-progress and subject to breaking changes.
|
||||
*/
|
||||
'work_in_progress': (boolean);
|
||||
}
|
16
packages/grpc-js-xds/src/generated/xds/annotations/v3/MessageStatusAnnotation.ts
generated
Normal file
16
packages/grpc-js-xds/src/generated/xds/annotations/v3/MessageStatusAnnotation.ts
generated
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Original file: deps/xds/xds/annotations/v3/status.proto
|
||||
|
||||
|
||||
export interface MessageStatusAnnotation {
|
||||
/**
|
||||
* The entity is work-in-progress and subject to breaking changes.
|
||||
*/
|
||||
'work_in_progress'?: (boolean);
|
||||
}
|
||||
|
||||
export interface MessageStatusAnnotation__Output {
|
||||
/**
|
||||
* The entity is work-in-progress and subject to breaking changes.
|
||||
*/
|
||||
'work_in_progress': (boolean);
|
||||
}
|
21
packages/grpc-js-xds/src/generated/xds/annotations/v3/PackageVersionStatus.ts
generated
Normal file
21
packages/grpc-js-xds/src/generated/xds/annotations/v3/PackageVersionStatus.ts
generated
Normal file
|
@ -0,0 +1,21 @@
|
|||
// Original file: deps/xds/xds/annotations/v3/status.proto
|
||||
|
||||
export enum PackageVersionStatus {
|
||||
/**
|
||||
* Unknown package version status.
|
||||
*/
|
||||
UNKNOWN = 0,
|
||||
/**
|
||||
* This version of the package is frozen.
|
||||
*/
|
||||
FROZEN = 1,
|
||||
/**
|
||||
* This version of the package is the active development version.
|
||||
*/
|
||||
ACTIVE = 2,
|
||||
/**
|
||||
* This version of the package is the candidate for the next major version. It
|
||||
* is typically machine generated from the active development version.
|
||||
*/
|
||||
NEXT_MAJOR_VERSION_CANDIDATE = 3,
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// Original file: deps/xds/xds/annotations/v3/status.proto
|
||||
|
||||
import type { PackageVersionStatus as _xds_annotations_v3_PackageVersionStatus } from '../../../xds/annotations/v3/PackageVersionStatus';
|
||||
|
||||
export interface StatusAnnotation {
|
||||
/**
|
||||
* The entity is work-in-progress and subject to breaking changes.
|
||||
*/
|
||||
'work_in_progress'?: (boolean);
|
||||
/**
|
||||
* The entity belongs to a package with the given version status.
|
||||
*/
|
||||
'package_version_status'?: (_xds_annotations_v3_PackageVersionStatus | keyof typeof _xds_annotations_v3_PackageVersionStatus);
|
||||
}
|
||||
|
||||
export interface StatusAnnotation__Output {
|
||||
/**
|
||||
* The entity is work-in-progress and subject to breaking changes.
|
||||
*/
|
||||
'work_in_progress': (boolean);
|
||||
/**
|
||||
* The entity belongs to a package with the given version status.
|
||||
*/
|
||||
'package_version_status': (keyof typeof _xds_annotations_v3_PackageVersionStatus);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/xds/core/v3/authority.proto
|
||||
// Original file: deps/xds/xds/core/v3/authority.proto
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/xds/core/v3/collection_entry.proto
|
||||
// Original file: deps/xds/xds/core/v3/collection_entry.proto
|
||||
|
||||
import type { ResourceLocator as _xds_core_v3_ResourceLocator, ResourceLocator__Output as _xds_core_v3_ResourceLocator__Output } from '../../../xds/core/v3/ResourceLocator';
|
||||
import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/xds/core/v3/context_params.proto
|
||||
// Original file: deps/xds/xds/core/v3/context_params.proto
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Original file: deps/udpa/xds/core/v3/resource_locator.proto
|
||||
// Original file: deps/xds/xds/core/v3/resource_locator.proto
|
||||
|
||||
import type { ContextParams as _xds_core_v3_ContextParams, ContextParams__Output as _xds_core_v3_ContextParams__Output } from '../../../xds/core/v3/ContextParams';
|
||||
import type { ResourceLocator as _xds_core_v3_ResourceLocator, ResourceLocator__Output as _xds_core_v3_ResourceLocator__Output } from '../../../xds/core/v3/ResourceLocator';
|
||||
|
@ -95,7 +95,7 @@ export interface _xds_core_v3_ResourceLocator_Directive__Output {
|
|||
'directive': "alt"|"entry";
|
||||
}
|
||||
|
||||
// Original file: deps/udpa/xds/core/v3/resource_locator.proto
|
||||
// Original file: deps/xds/xds/core/v3/resource_locator.proto
|
||||
|
||||
export enum _xds_core_v3_ResourceLocator_Scheme {
|
||||
XDSTP = 0,
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
// Original file: deps/xds/xds/type/v3/typed_struct.proto
|
||||
|
||||
import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../google/protobuf/Struct';
|
||||
|
||||
/**
|
||||
* A TypedStruct contains an arbitrary JSON serialized protocol buffer message with a URL that
|
||||
* describes the type of the serialized message. This is very similar to google.protobuf.Any,
|
||||
* instead of having protocol buffer binary, this employs google.protobuf.Struct as value.
|
||||
*
|
||||
* This message is intended to be embedded inside Any, so it shouldn't be directly referred
|
||||
* from other UDPA messages.
|
||||
*
|
||||
* When packing an opaque extension config, packing the expected type into Any is preferred
|
||||
* wherever possible for its efficiency. TypedStruct should be used only if a proto descriptor
|
||||
* is not available, for example if:
|
||||
* - A control plane sends opaque message that is originally from external source in human readable
|
||||
* format such as JSON or YAML.
|
||||
* - The control plane doesn't have the knowledge of the protocol buffer schema hence it cannot
|
||||
* serialize the message in protocol buffer binary format.
|
||||
* - The DPLB doesn't have have the knowledge of the protocol buffer schema its plugin or extension
|
||||
* uses. This has to be indicated in the DPLB capability negotiation.
|
||||
*
|
||||
* When a DPLB receives a TypedStruct in Any, it should:
|
||||
* - Check if the type_url of the TypedStruct matches the type the extension expects.
|
||||
* - Convert value to the type described in type_url and perform validation.
|
||||
* TODO(lizan): Figure out how TypeStruct should be used with DPLB extensions that doesn't link
|
||||
* protobuf descriptor with DPLB itself, (e.g. gRPC LB Plugin, Envoy WASM extensions).
|
||||
*/
|
||||
export interface TypedStruct {
|
||||
/**
|
||||
* A URL that uniquely identifies the type of the serialize protocol buffer message.
|
||||
* This has same semantics and format described in google.protobuf.Any:
|
||||
* https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto
|
||||
*/
|
||||
'type_url'?: (string);
|
||||
/**
|
||||
* A JSON representation of the above specified type.
|
||||
*/
|
||||
'value'?: (_google_protobuf_Struct | null);
|
||||
}
|
||||
|
||||
/**
|
||||
* A TypedStruct contains an arbitrary JSON serialized protocol buffer message with a URL that
|
||||
* describes the type of the serialized message. This is very similar to google.protobuf.Any,
|
||||
* instead of having protocol buffer binary, this employs google.protobuf.Struct as value.
|
||||
*
|
||||
* This message is intended to be embedded inside Any, so it shouldn't be directly referred
|
||||
* from other UDPA messages.
|
||||
*
|
||||
* When packing an opaque extension config, packing the expected type into Any is preferred
|
||||
* wherever possible for its efficiency. TypedStruct should be used only if a proto descriptor
|
||||
* is not available, for example if:
|
||||
* - A control plane sends opaque message that is originally from external source in human readable
|
||||
* format such as JSON or YAML.
|
||||
* - The control plane doesn't have the knowledge of the protocol buffer schema hence it cannot
|
||||
* serialize the message in protocol buffer binary format.
|
||||
* - The DPLB doesn't have have the knowledge of the protocol buffer schema its plugin or extension
|
||||
* uses. This has to be indicated in the DPLB capability negotiation.
|
||||
*
|
||||
* When a DPLB receives a TypedStruct in Any, it should:
|
||||
* - Check if the type_url of the TypedStruct matches the type the extension expects.
|
||||
* - Convert value to the type described in type_url and perform validation.
|
||||
* TODO(lizan): Figure out how TypeStruct should be used with DPLB extensions that doesn't link
|
||||
* protobuf descriptor with DPLB itself, (e.g. gRPC LB Plugin, Envoy WASM extensions).
|
||||
*/
|
||||
export interface TypedStruct__Output {
|
||||
/**
|
||||
* A URL that uniquely identifies the type of the serialize protocol buffer message.
|
||||
* This has same semantics and format described in google.protobuf.Any:
|
||||
* https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto
|
||||
*/
|
||||
'type_url': (string);
|
||||
/**
|
||||
* A JSON representation of the above specified type.
|
||||
*/
|
||||
'value': (_google_protobuf_Struct__Output | null);
|
||||
}
|
|
@ -20,7 +20,7 @@ import { experimental, logVerbosity } from '@grpc/grpc-js';
|
|||
import { Any__Output } from './generated/google/protobuf/Any';
|
||||
import Filter = experimental.Filter;
|
||||
import FilterFactory = experimental.FilterFactory;
|
||||
import { TypedStruct__Output } from './generated/udpa/type/v1/TypedStruct';
|
||||
import { TypedStruct__Output as TypedStruct__Output } from './generated/xds/type/v3/TypedStruct';
|
||||
import { FilterConfig__Output } from './generated/envoy/config/route/v3/FilterConfig';
|
||||
import { HttpFilter__Output } from './generated/envoy/extensions/filters/network/http_connection_manager/v3/HttpFilter';
|
||||
|
||||
|
@ -30,19 +30,22 @@ function trace(text: string): void {
|
|||
experimental.trace(logVerbosity.DEBUG, TRACER_NAME, text);
|
||||
}
|
||||
|
||||
const TYPED_STRUCT_URL = 'type.googleapis.com/udpa.type.v1.TypedStruct';
|
||||
const TYPED_STRUCT_NAME = 'udpa.type.v1.TypedStruct';
|
||||
const TYPED_STRUCT_UDPA_URL = 'type.googleapis.com/udpa.type.v1.TypedStruct';
|
||||
const TYPED_STRUCT_UDPA_NAME = 'udpa.type.v1.TypedStruct';
|
||||
const TYPED_STRUCT_XDS_URL = 'type.googleapis.com/xds.type.v3.TypedStruct';
|
||||
const TYPED_STRUCT_XDS_NAME = 'xds.type.v3.TypedStruct';
|
||||
|
||||
const FILTER_CONFIG_URL = 'type.googleapis.com/envoy.config.route.v3.FilterConfig';
|
||||
const FILTER_CONFIG_NAME = 'envoy.config.route.v3.FilterConfig';
|
||||
|
||||
const resourceRoot = loadProtosWithOptionsSync([
|
||||
'udpa/type/v1/typed_struct.proto',
|
||||
'xds/type/v3/typed_struct.proto',
|
||||
'envoy/config/route/v3/route_components.proto'], {
|
||||
keepCase: true,
|
||||
includeDirs: [
|
||||
// Paths are relative to src/build
|
||||
__dirname + '/../../deps/udpa/',
|
||||
__dirname + '/../../deps/xds/',
|
||||
__dirname + '/../../deps/envoy-api/',
|
||||
__dirname + '/../../deps/protoc-gen-validate/'
|
||||
],
|
||||
|
@ -91,7 +94,7 @@ function parseAnyMessage<MessageType>(message: Any__Output): MessageType | null
|
|||
|
||||
export function getTopLevelFilterUrl(encodedConfig: Any__Output): string {
|
||||
let typeUrl: string;
|
||||
if (encodedConfig.type_url === TYPED_STRUCT_URL) {
|
||||
if (encodedConfig.type_url === TYPED_STRUCT_UDPA_URL || encodedConfig.type_url === TYPED_STRUCT_XDS_URL) {
|
||||
const typedStruct = parseAnyMessage<TypedStruct__Output>(encodedConfig)
|
||||
if (typedStruct) {
|
||||
return typedStruct.type_url;
|
||||
|
@ -154,7 +157,7 @@ export function validateOverrideFilter(encodedConfig: Any__Output): boolean {
|
|||
} else {
|
||||
realConfig = encodedConfig;
|
||||
}
|
||||
if (realConfig.type_url === TYPED_STRUCT_URL) {
|
||||
if (realConfig.type_url === TYPED_STRUCT_UDPA_URL || realConfig.type_url === TYPED_STRUCT_XDS_URL) {
|
||||
const typedStruct = parseAnyMessage<TypedStruct__Output>(encodedConfig);
|
||||
if (typedStruct) {
|
||||
typeUrl = typedStruct.type_url;
|
||||
|
@ -215,7 +218,7 @@ export function parseOverrideFilterConfig(encodedConfig: Any__Output) {
|
|||
} else {
|
||||
realConfig = encodedConfig;
|
||||
}
|
||||
if (realConfig.type_url === TYPED_STRUCT_URL) {
|
||||
if (realConfig.type_url === TYPED_STRUCT_UDPA_URL || realConfig.type_url === TYPED_STRUCT_XDS_URL) {
|
||||
const typedStruct = parseAnyMessage<TypedStruct__Output>(encodedConfig);
|
||||
if (typedStruct) {
|
||||
typeUrl = typedStruct.type_url;
|
||||
|
|
|
@ -38,7 +38,7 @@ const resourceRoot = loadProtosWithOptionsSync([
|
|||
keepCase: true,
|
||||
includeDirs: [
|
||||
// Paths are relative to src/build/http-filter
|
||||
__dirname + '/../../../deps/udpa/',
|
||||
__dirname + '/../../../deps/xds/',
|
||||
__dirname + '/../../../deps/envoy-api/',
|
||||
__dirname + '/../../../deps/protoc-gen-validate/'
|
||||
],
|
||||
|
|
|
@ -70,7 +70,7 @@ const resourceRoot = loadProtosWithOptionsSync([
|
|||
includeDirs: [
|
||||
// Paths are relative to src/build
|
||||
__dirname + '/../../deps/envoy-api/',
|
||||
__dirname + '/../../deps/udpa/',
|
||||
__dirname + '/../../deps/xds/',
|
||||
__dirname + '/../../deps/googleapis/',
|
||||
__dirname + '/../../deps/protoc-gen-validate/',
|
||||
],
|
||||
|
|
|
@ -87,7 +87,7 @@ function loadAdsProtos(): Promise<
|
|||
includeDirs: [
|
||||
// Paths are relative to src/build
|
||||
__dirname + '/../../deps/envoy-api/',
|
||||
__dirname + '/../../deps/udpa/',
|
||||
__dirname + '/../../deps/xds/',
|
||||
__dirname + '/../../deps/googleapis/',
|
||||
__dirname + '/../../deps/protoc-gen-validate/',
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue