forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grpc: SSL credential support for Google gRPC client. (envoyproxy#2598)
* grpc: SSL credential support for Google gRPC client. Risk Level: Low (not in use). Testing: new unit tests to validate SSL connections (and client certs) for all gRPC client types. Added SSL to ads_integration_test to validate end-to-end. Signed-off-by: Harvey Tuch <[email protected]>
- Loading branch information
Showing
18 changed files
with
334 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ BROWSE | |
.deps | ||
*.pyc | ||
SOURCE_VERSION | ||
.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "common/config/datasource.h" | ||
|
||
#include "common/filesystem/filesystem_impl.h" | ||
|
||
#include "fmt/format.h" | ||
|
||
namespace Envoy { | ||
namespace Config { | ||
namespace DataSource { | ||
|
||
std::string read(const envoy::api::v2::core::DataSource& source, bool allow_empty) { | ||
switch (source.specifier_case()) { | ||
case envoy::api::v2::core::DataSource::kFilename: | ||
return Filesystem::fileReadToEnd(source.filename()); | ||
case envoy::api::v2::core::DataSource::kInlineBytes: | ||
return source.inline_bytes(); | ||
case envoy::api::v2::core::DataSource::kInlineString: | ||
return source.inline_string(); | ||
default: | ||
if (!allow_empty) { | ||
throw EnvoyException( | ||
fmt::format("Unexpected DataSource::specifier_case(): {}", source.specifier_case())); | ||
} | ||
return ""; | ||
} | ||
} | ||
|
||
std::string getPath(const envoy::api::v2::core::DataSource& source) { | ||
return source.specifier_case() == envoy::api::v2::core::DataSource::kFilename ? source.filename() | ||
: ""; | ||
} | ||
|
||
} // namespace DataSource | ||
} // namespace Config | ||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include "envoy/api/v2/core/base.pb.h" | ||
|
||
namespace Envoy { | ||
namespace Config { | ||
namespace DataSource { | ||
|
||
/** | ||
* Read contents of the DataSource. | ||
* @param source data source. | ||
* @param allow_empty return an empty string if no DataSource case is specified. | ||
* @return std::string with DataSource contents. | ||
* @throw EnvoyException if no DataSource case is specified and !allow_empty. | ||
*/ | ||
std::string read(const envoy::api::v2::core::DataSource& source, bool allow_empty); | ||
|
||
/** | ||
* @param source data source. | ||
* @return std::string path to DataSource if a filename, otherwise an empty string. | ||
*/ | ||
std::string getPath(const envoy::api::v2::core::DataSource& source); | ||
|
||
} // namespace DataSource | ||
} // namespace Config | ||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.