-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28ae8c1
commit a931af7
Showing
17 changed files
with
248 additions
and
98 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#-- metatron verifier library | ||
if(NFLX_INTERNAL) | ||
add_library(metatron | ||
"auth_context.pb.cc" | ||
"auth_context.pb.h" | ||
"metatron_config.cc" | ||
"metatron_config.h" | ||
) | ||
else() | ||
add_library(metatron | ||
"metatron_config.h" | ||
"metatron_sample.cc" | ||
) | ||
endif() | ||
|
||
target_include_directories(metatron PRIVATE | ||
${CMAKE_SOURCE_DIR} | ||
) | ||
target_link_libraries(metatron util ${CONAN_LIBS}) | ||
|
||
#-- protobuf generated files must exist in both the SOURCE_DIR and the BINARY_DIR | ||
add_custom_command( | ||
OUTPUT auth_context.pb.cc auth_context.pb.h | ||
COMMAND ${CONAN_PROTOBUF_ROOT}/bin/protoc --proto_path=${CMAKE_CURRENT_SOURCE_DIR} --cpp_out=${CMAKE_CURRENT_SOURCE_DIR} auth_context.proto | ||
COMMAND ${CONAN_PROTOBUF_ROOT}/bin/protoc --proto_path=${CMAKE_CURRENT_SOURCE_DIR} --cpp_out=${CMAKE_CURRENT_BINARY_DIR} auth_context.proto | ||
) |
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,22 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <curl/curl.h> | ||
#include <openssl/ssl.h> | ||
|
||
namespace metatron { | ||
|
||
struct CertInfo { | ||
std::string ssl_cert; | ||
std::string ssl_key; | ||
std::string ca_info; | ||
std::string app_name; | ||
}; | ||
|
||
CertInfo find_certificate(bool external_enabled, const std::string& metatron_dir); | ||
|
||
int metatron_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx); | ||
|
||
CURLcode sslctx_metatron_verify(CURL *curl, void *ssl_ctx, void *parm); | ||
|
||
} // namespace metatron |
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,22 @@ | ||
#include "metatron_config.h" | ||
#include "util/logger.h" | ||
|
||
namespace metatron { | ||
|
||
CertInfo find_certificate(bool /*unused*/, const std::string& /*unused*/) { | ||
return CertInfo{"ssl_cert", "ssl_key", "ca_info", "app_name"}; | ||
} | ||
|
||
int metatron_verify_callback(int /*unused*/, X509_STORE_CTX* /*unused*/) { | ||
static auto logger = spectatord::Logger(); | ||
logger->warn("Always stop the verification process with a verification failed state"); | ||
return 0; | ||
} | ||
|
||
CURLcode sslctx_metatron_verify(CURL* /*unused*/, void* /*unused*/, void* /*unused*/) { | ||
static auto logger = spectatord::Logger(); | ||
logger->warn("Always halt SSL processing with the sample config"); | ||
return CURLE_SSL_CONNECT_ERROR; | ||
} | ||
|
||
} // namespace metatron |
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.