Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated fix for refs/heads/local_creds #10

Open
wants to merge 1 commit into
base: local_creds
Choose a base branch
from
Open
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
52 changes: 52 additions & 0 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions build_autogenerated.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4069,9 +4069,9 @@ grpc_cc_library(
"//:promise",
"//:ref_counted_ptr",
"//:sockaddr_utils",
"//src/core:experiments",
"//:tsi_base",
"//:uri_parser",
"//src/core:experiments",
],
)

Expand Down
17 changes: 1 addition & 16 deletions src/core/lib/experiments/experiments.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions src/core/lib/experiments/experiments.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ void local_check_peer(tsi_peer peer, grpc_endpoint* ep,
if (grpc_core::IsLocalConnectorSecureEnabled()) {
switch (type) {
case UDS:
security_level = tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY);
security_level =
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY);
break;
default:
security_level = tsi_security_level_to_string(TSI_SECURITY_NONE);
Expand Down
59 changes: 23 additions & 36 deletions test/core/security/local_security_connector_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

#include <gtest/gtest.h>

#include <grpc/impl/grpc_types.h>

#include "src/core/client_channel/client_channel_filter.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/tsi/transport_security.h"
#include "test/core/test_util/test_config.h"
#include "src/core/client_channel/client_channel_filter.h"
#include "include/grpc/impl/grpc_types.h"

namespace grpc_core {
namespace testing {
Expand All @@ -32,40 +33,27 @@ absl::string_view me_get_local_address_unix(grpc_endpoint* /*ep*/) {
return "unix:";
}

const grpc_endpoint_vtable vtable_unix = {nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
me_get_local_address_unix,
nullptr,
nullptr};
const grpc_endpoint_vtable vtable_unix = {
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, me_get_local_address_unix,
nullptr, nullptr};

absl::string_view me_get_local_address_local(grpc_endpoint* /*ep*/) {
return "ipv4:127.0.0.1:12667";
}

const grpc_endpoint_vtable vtable_local = {nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
me_get_local_address_local,
nullptr,
nullptr};
const grpc_endpoint_vtable vtable_local = {
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, me_get_local_address_local,
nullptr, nullptr};

void CheckSecurityLevelForServer(grpc_local_connect_type connect_type,
tsi_security_level level,
grpc_endpoint ep) {
grpc_server_credentials
* server_creds = grpc_local_server_credentials_create(connect_type);
tsi_security_level level, grpc_endpoint ep) {
grpc_server_credentials* server_creds =
grpc_local_server_credentials_create(connect_type);
ChannelArgs args;
RefCountedPtr<grpc_server_security_connector> connector = server_creds->
create_security_connector(args);
RefCountedPtr<grpc_server_security_connector> connector =
server_creds->create_security_connector(args);
ASSERT_NE(connector, nullptr);
tsi_peer peer;
CHECK(tsi_construct_peer(0, &peer) == TSI_OK);
Expand All @@ -83,15 +71,14 @@ void CheckSecurityLevelForServer(grpc_local_connect_type connect_type,
grpc_server_credentials_release(server_creds);
}

static void CheckSecurityLevelForChannel(grpc_local_connect_type connect_type,
tsi_security_level level,
grpc_endpoint ep) {
grpc_channel_credentials
* channel_creds = grpc_local_credentials_create(connect_type);
void CheckSecurityLevelForChannel(grpc_local_connect_type connect_type,
tsi_security_level level, grpc_endpoint ep) {
grpc_channel_credentials* channel_creds =
grpc_local_credentials_create(connect_type);
ChannelArgs args;
args = args.Set((char*) GRPC_ARG_SERVER_URI, (char*) "unix:");
RefCountedPtr<grpc_channel_security_connector> connector = channel_creds->
create_security_connector(nullptr, "unix:", &args);
args = args.Set((char*)GRPC_ARG_SERVER_URI, (char*)"unix:");
RefCountedPtr<grpc_channel_security_connector> connector =
channel_creds->create_security_connector(nullptr, "unix:", &args);
ASSERT_NE(connector, nullptr);
tsi_peer peer;
CHECK(tsi_construct_peer(0, &peer) == TSI_OK);
Expand Down
24 changes: 24 additions & 0 deletions tools/run_tests/generated/tests.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.