syntax = "proto3"; package gloo.solo.io; import "extproto/ext.proto"; import "github.com/solo-io/gloo/projects/gloo/api/v1/proxy.proto"; import "github.com/solo-io/gloo/projects/gloo/api/v1/upstream.proto"; import "github.com/solo-io/solo-kit/api/v1/ref.proto"; option go_package = "github.com/solo-io/gloo/projects/gloo/pkg/api/grpc/validation"; option (extproto.equal_all) = true; option (extproto.hash_all) = true; option (extproto.clone_all) = true; // The gloo validation service validates gloo resources for clients against current snapshot resources service GlooValidationService { // Notify the client whenever the Gloo Validation Service resyncs rpc NotifyOnResync(NotifyOnResyncRequest) returns (stream NotifyOnResyncResponse) { } // Submit gloo resources for validation rpc Validate(GlooValidationServiceRequest) returns (GlooValidationServiceResponse) { } } message GlooValidationServiceRequest { // Optional. If a proxy is provided in the request, the response will contain only the report for that proxy. // If no proxy is provided, the response will contain a report for each proxy in the Gloo API snapshot. Proxy proxy = 1; // Each validation request can either be a create/modify request or a delete request for one or more resources. // For deletions, we pass in the resource refs rather than the full resources. oneof resources { // Resources to be created or modified. ModifiedResources modified_resources = 2; // Resources to be deleted. DeletedResources deleted_resources = 3; } } message GlooValidationServiceResponse { // This list contains a validation report for each proxy that was translated and validated with the proposed // Gloo API snapshot. repeated ValidationReport validation_reports = 1; } message ModifiedResources { // Optional, a list of the upstreams to create or modify. repeated Upstream upstreams = 1; // TODO when we support other resource types, add them here } message DeletedResources { // Optional, a list of the upstreams to delete. repeated core.solo.io.ResourceRef upstream_refs = 1; // Optional, a list of the secrets to delete. repeated core.solo.io.ResourceRef secret_refs = 2; // TODO when we support other resource types, add them here } // A validation report represents the warnings and errors that produced during // a single translation loop of a proxy. message ValidationReport { // The report for this proxy, including any warnings or errors in its sub-resources. ProxyReport proxy_report = 1; // The reports for all upstreams that were translated with this proxy. repeated ResourceReport upstream_reports = 2; // The proxy for this translation loop. Proxy proxy = 3; } message ResourceReport { // A way to refer to resources in different namespaces by including the // name and namespace of the resource in this `resourceRef`. core.solo.io.ResourceRef resource_ref = 1; // The warnings that are returned for the resource. Warnings do not // necessarily prevent an operation from happening, but might require action. repeated string warnings = 2; // The errors that are returned for the resource. You cannot modify the // resource until the errors are resolved. For help troubleshooting, see the // [Debug guide]({{< versioned_link_path fromRoot="/operations/debugging_gloo/" >}}). repeated string errors = 3; } message NotifyOnResyncRequest { } message NotifyOnResyncResponse { } /* * The Proxy Report should contain one report for each sub-resource of the Proxy * E.g., each listener will have a corresponding report. Within each listener report is * a route report corresponding to each route on the listener. * * If the report contains no errors, the (sub-)resource is valid. */ message ProxyReport { repeated ListenerReport listener_reports = 1; } message ListenerReport { // error types for top-level listener config message Error { enum Type { NameNotUniqueError = 0; BindPortNotUniqueError = 1; SSLConfigError = 2; ProcessingError = 3; } // the type of the error Type type = 1; // any extra info as a string string reason = 2; // Source metadata for the ListenerReport, can be used by external components to associate // sources with the ListenerError SourceMetadata metadata = 3; } // warning types for the given listener config message Warning { enum Type { SSLConfigWarning = 0; } // the type of the error Type type = 1; // any extra info as a string string reason = 2; } // errors on top-level config of the listener repeated Error errors = 2; // warnings on the top-levelconfig of the listener repeated Warning warnings = 7; oneof listener_type_report { // report for the http listener HttpListenerReport http_listener_report = 3; // report for the tcp listener TcpListenerReport tcp_listener_report = 4; // report for the hybrid listener HybridListenerReport hybrid_listener_report = 5; // report for the aggregate listener AggregateListenerReport aggregate_listener_report = 6; } } message HttpListenerReport { // error types for top-level http listener config message Error { enum Type { ProcessingError = 0; } // the type of the error Type type = 1; // any extra info as a string string reason = 2; // Source metadata for the HttpListenerReport, can be used by external components to associate sources with the HttpListenerError SourceMetadata metadata = 3; } repeated Error errors = 1; // report for nested virtual hosts repeated VirtualHostReport virtual_host_reports = 2; // warning types for the given listener message Warning { enum Type { UnknownWarning = 0; InvalidDestinationWarning = 1; } // the type of the warning Type type = 1; // any extra info as a string string reason = 2; } // warnings on the config of listener repeated Warning warnings = 3; } message VirtualHostReport { // error types for top-level virtual host config message Error { enum Type { NameNotUniqueError = 0; DomainsNotUniqueError = 1; ProcessingError = 2; EmptyDomainError = 3; } // the type of the error Type type = 1; // any extra info as a string string reason = 2; // Source metadata for the VirtualHostReport, can be used by external components to associate sources with the VirtualHostError SourceMetadata metadata = 3; } // errors on top-level config of the virtual host repeated Error errors = 1; repeated RouteReport route_reports = 2; } message RouteReport { // error types for the given route config message Error { enum Type { InvalidMatcherError = 0; ProcessingError = 1; } // the type of the error Type type = 1; // any extra info as a string string reason = 2; // Source metadata for the RouteReport, can be used by external components to associate sources with the RouteError SourceMetadata metadata = 3; } // warning types for the given route config message Warning { enum Type { InvalidDestinationWarning = 0; } // the type of the error Type type = 1; // any extra info as a string string reason = 2; } // errors on the config of the route repeated Error errors = 1; // warnings on the config of the route repeated Warning warnings = 2; } message TcpListenerReport { // error types for top-level tcp listener config message Error { enum Type { NameNotUniqueError = 0; BindPortNotUniqueError = 1; SSLConfigError = 2; ProcessingError = 3; } // the type of the error Type type = 1; // any extra info as a string string reason = 2; } // errors on top-level config of the listener repeated Error errors = 1; repeated TcpHostReport tcp_host_reports = 2; // warning types for the given listener message Warning { enum Type { UnknownWarning = 0; InvalidDestinationWarning = 1; } // the type of the warning Type type = 1; // any extra info as a string string reason = 2; } // warnings on the config of listener repeated Warning warnings = 3; } message TcpHostReport { // error types for tcp host config message Error { enum Type { NameNotUniqueError = 0; InvalidDestinationError = 1 [deprecated = true]; ProcessingError = 2; } // the type of the error Type type = 1; // any extra info as a string string reason = 2; } // warning types for the given tcp host config message Warning { enum Type { UnknownWarning = 0; InvalidDestinationWarning = 1; } // the type of the warning Type type = 1; // any extra info as a string string reason = 2; } // errors on the tcp host repeated Error errors = 2; // warnings on the config of the tcp host repeated Warning warnings = 3; } message HybridListenerReport { // map key should uniquely identify MatchedListenerReport by matcher map matched_listener_reports = 1; } message MatchedListenerReport { oneof ListenerReportType { HttpListenerReport http_listener_report = 1; TcpListenerReport tcp_listener_report = 2; } } // the report for an AggregateListener message AggregateListenerReport { map http_listener_reports = 1; map tcp_listener_reports = 2; }