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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions api/bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ REPOSITORY_LOCATIONS_SPEC = dict(
license_url = "https://github.com/bazelbuild/bazel-skylib/blob/{version}/LICENSE",
),
com_envoyproxy_protoc_gen_validate = dict(
release_date = "2022-09-01",
project_name = "protoc-gen-validate (PGV)",
project_desc = "protoc plugin to generate polyglot message validators",
project_url = "https://github.com/bufbuild/protoc-gen-validate",
version = "0.6.13",
sha256 = "cfa8741c939387969550a305f237e627db26e3ca00c69c0d6a5148843d14655a",
release_date = "2022-10-03",
strip_prefix = "protoc-gen-validate-{version}",
urls = ["https://github.com/bufbuild/protoc-gen-validate/archive/v{version}.tar.gz"],
project_url = "https://github.com/alyssawilk/protoc-gen-validate/tree/minimal",
use_category = ["api"],
sha256 = "4c8eaf5e58f2fc64a8a9075081b1ce4b5aea3967a5448d9a4f7763c7f4a41c00",
version = "2682ad06cca00550030e177834f58a2bc06eb61e",
urls = ["https://github.com/alyssawilk/protoc-gen-validate/archive/refs/heads/minimal.zip"],
strip_prefix = "protoc-gen-validate-minimal",
implied_untracked_deps = [
"com_github_iancoleman_strcase",
"com_github_lyft_protoc_gen_star",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@
#include "source/extensions/transport_sockets/tls/cert_validator/factory.h"

#include "library/common/extensions/cert_validator/platform_bridge/platform_bridge_cert_validator.h"
#include "library/common/extensions/cert_validator/platform_bridge/platform_bridge.pb.h"

namespace Envoy {
namespace Extensions {
namespace TransportSockets {
namespace Tls {

class PlatformBridgeCertValidatorFactory : public CertValidatorFactory {
class PlatformBridgeCertValidatorFactory : public CertValidatorFactory, public Config::TypedFactory {
public:
CertValidatorPtr createCertValidator(const Envoy::Ssl::CertificateValidationContextConfig* config,
SslStats& stats, TimeSource& time_source) override;

std::string name() const override {
return "envoy_mobile.cert_validator.platform_bridge_cert_validator";
}
ProtobufTypes::MessagePtr createEmptyConfigProto() override {
return std::make_unique<envoy_mobile::extensions::cert_validator::platform_bridge::PlatformBridgeCertValidator>();
}
std::string category() const override { return "envoy.tls.cert_validator"; }


private:
const envoy_cert_validator* platform_validator_ = nullptr;
Expand Down
6 changes: 4 additions & 2 deletions source/exe/process_wide.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct InitData {
InitData& processWideInitData() { MUTABLE_CONSTRUCT_ON_FIRST_USE(InitData); };
} // namespace

ProcessWide::ProcessWide() {
ProcessWide::ProcessWide(bool validate_proto_descriptors) {
// Note that the following lock has the dual use of making sure that initialization is complete
// before a second caller can enter and leave this function.
auto& init_data = processWideInitData();
Expand All @@ -31,7 +31,9 @@ ProcessWide::ProcessWide() {
// TODO(mattklein123): Audit the following as not all of these have to be re-initialized in the
// edge case where something does init/destroy/init/destroy.
Event::Libevent::Global::initialize();
Envoy::Server::validateProtoDescriptors();
if (validate_proto_descriptors) {
Envoy::Server::validateProtoDescriptors();
}
Http::Http2::initializeNghttp2Logging();

// We do not initialize Google gRPC here -- we instead instantiate
Expand Down
2 changes: 1 addition & 1 deletion source/exe/process_wide.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Envoy {
// e.g. c-ares. There should only ever be a single instance of this.
class ProcessWide {
public:
ProcessWide();
ProcessWide(bool validate_proto_descriptors = true);
~ProcessWide();
};

Expand Down
1 change: 1 addition & 0 deletions test/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,7 @@ envoy_cc_test_library(
"base_integration_test.h",
],
deps = [
"//source/server:proto_descriptors_lib",
"//source/extensions/request_id/uuid:config",
":autonomous_upstream_lib",
":fake_upstream_lib",
Expand Down
2 changes: 2 additions & 0 deletions test/integration/base_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "source/common/network/utility.h"
#include "source/extensions/transport_sockets/tls/context_config_impl.h"
#include "source/extensions/transport_sockets/tls/ssl_socket.h"
#include "source/server/proto_descriptors.h"

#include "test/integration/utility.h"
#include "test/test_common/environment.h"
Expand Down Expand Up @@ -47,6 +48,7 @@ BaseIntegrationTest::BaseIntegrationTest(const InstanceConstSharedPtrFn& upstrea
version_(version), upstream_address_fn_(upstream_address_fn),
config_helper_(version, *api_, config),
default_log_level_(TestEnvironment::getOptions().logLevel()) {
Envoy::Server::validateProtoDescriptors();
// This is a hack, but there are situations where we disconnect fake upstream connections and
// then we expect the server connection pool to get the disconnect before the next test starts.
// This does not always happen. This pause should allow the server to pick up the disconnect
Expand Down
2 changes: 1 addition & 1 deletion test/test_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int TestRunner::RunTests(int argc, char** argv) {
::testing::InitGoogleMock(&argc, argv);
// We hold on to process_wide to provide RAII cleanup of process-wide
// state.
ProcessWide process_wide;
ProcessWide process_wide(false);
// Add a test-listener so we can call a hook where we can do a quiescence
// check after each method. See
// https://github.com/google/googletest/blob/master/googletest/docs/advanced.md
Expand Down