Skip to content

Commit

Permalink
Merge pull request #25 from erm-g/create-pull-request/patch-8bda74f
Browse files Browse the repository at this point in the history
Automated fix for refs/heads/local_creds
  • Loading branch information
erm-g authored Sep 24, 2024
2 parents 8bda74f + 7c7b17b commit bf9e089
Show file tree
Hide file tree
Showing 11 changed files with 186 additions and 83 deletions.
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 @@ -4098,9 +4098,9 @@ grpc_cc_library(
"//:promise",
"//:ref_counted_ptr",
"//:sockaddr_utils",
"//src/core:experiments",
"//:tsi_base",
"//:uri_parser",
"//src/core:experiments",
],
)

Expand Down
11 changes: 7 additions & 4 deletions src/core/lib/experiments/experiments.cc

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

3 changes: 0 additions & 3 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 @@ -144,10 +144,11 @@ void local_check_peer(tsi_peer peer, grpc_endpoint* ep,
}
if (peer.properties != nullptr) gpr_free(peer.properties);
peer.properties = new_properties;
// Set security level to PRIVACY_AND_INTEGRITY for UDS, or NONE otherwise.
// Set security level to PRIVACY_AND_INTEGRITY for UDS, or NONE otherwise.
const char* security_level;
if (grpc_core::IsLocalConnectorSecureEnabled()) {
security_level = tsi_security_level_to_string(type == UDS ? TSI_PRIVACY_AND_INTEGRITY : TSI_SECURITY_NONE);
security_level = tsi_security_level_to_string(
type == UDS ? TSI_PRIVACY_AND_INTEGRITY : TSI_SECURITY_NONE);
} else {
security_level = tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ def test_propagation_to_auth_plugin(self):
composite_credentials = grpc.composite_channel_credentials(
local_credentials, call_credentials
)
with grpc.secure_channel(f"unix:{uds_path}", composite_credentials) as channel:
with grpc.secure_channel(
f"unix:{uds_path}", composite_credentials
) as channel:
stub = channel.unary_unary(
grpc._common.fully_qualified_method(
_SERVICE_NAME, _UNARY_UNARY
Expand Down
56 changes: 28 additions & 28 deletions test/core/end2end/end2end_test_suites.cc
Original file line number Diff line number Diff line change
Expand Up @@ -638,34 +638,34 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
}},
#endif

CoreTestConfiguration{"Chttp2FullstackLocalIpv4",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_DO_NOT_FUZZ |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS |
FEATURE_MASK_IS_LOCAL_TCP_CREDS,
nullptr,
[](const ChannelArgs& /*client_args*/,
const ChannelArgs& /*server_args*/) {
int port = grpc_pick_unused_port_or_die();
return std::make_unique<LocalTestFixture>(
JoinHostPort("127.0.0.1", port), LOCAL_TCP);
}},
CoreTestConfiguration{"Chttp2FullstackLocalIpv6",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_DO_NOT_FUZZ |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS |
FEATURE_MASK_IS_LOCAL_TCP_CREDS,
nullptr,
[](const ChannelArgs& /*client_args*/,
const ChannelArgs& /*server_args*/) {
int port = grpc_pick_unused_port_or_die();
return std::make_unique<LocalTestFixture>(
JoinHostPort("[::1]", port), LOCAL_TCP);
}},
CoreTestConfiguration{"Chttp2FullstackLocalIpv4",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_DO_NOT_FUZZ |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS |
FEATURE_MASK_IS_LOCAL_TCP_CREDS,
nullptr,
[](const ChannelArgs& /*client_args*/,
const ChannelArgs& /*server_args*/) {
int port = grpc_pick_unused_port_or_die();
return std::make_unique<LocalTestFixture>(
JoinHostPort("127.0.0.1", port), LOCAL_TCP);
}},
CoreTestConfiguration{"Chttp2FullstackLocalIpv6",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_DO_NOT_FUZZ |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS |
FEATURE_MASK_IS_LOCAL_TCP_CREDS,
nullptr,
[](const ChannelArgs& /*client_args*/,
const ChannelArgs& /*server_args*/) {
int port = grpc_pick_unused_port_or_die();
return std::make_unique<LocalTestFixture>(
JoinHostPort("[::1]", port), LOCAL_TCP);
}},
#ifdef GRPC_HAVE_UNIX_SOCKET
CoreTestConfiguration{
"Chttp2FullstackLocalUdsPercentEncoded",
Expand Down
4 changes: 2 additions & 2 deletions test/core/end2end/tests/call_creds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ CORE_END2END_TEST(PerCallCredsOnInsecureTest,
}

CORE_END2END_TEST(PerCallCredsTest, RequestResponseWithPayloadAndCallCreds) {
if (grpc_core::IsLocalConnectorSecureEnabled()) {
if (IsLocalConnectorSecureEnabled()) {
SKIP_IF_LOCAL_TCP_CREDS();
}
TestRequestResponseWithPayloadAndCallCreds(*this, true);
}

CORE_END2END_TEST(PerCallCredsTest,
RequestResponseWithPayloadAndOverriddenCallCreds) {
if (grpc_core::IsLocalConnectorSecureEnabled()) {
if (IsLocalConnectorSecureEnabled()) {
SKIP_IF_LOCAL_TCP_CREDS();
}
TestRequestResponseWithPayloadAndOverriddenCallCreds(*this, true);
Expand Down
Loading

0 comments on commit bf9e089

Please sign in to comment.