@@ -31,17 +31,17 @@ DEFINE_string(
31
31
ssl_target, " " ,
32
32
" If not empty, treat the server host name as this for ssl/tls certificate "
33
33
" validation." );
34
- DEFINE_string (
35
- channel_creds_type, " " ,
36
- " The channel creds type: insecure, ssl, or alts." );
34
+ DEFINE_string (channel_creds_type, " " ,
35
+ " The channel creds type: insecure, ssl, or alts." );
37
36
38
37
namespace grpc {
39
38
namespace testing {
40
39
41
40
grpc::string CliCredentials::GetDefaultChannelCredsType () const {
42
41
// Compatibility logic for --enable_ssl.
43
42
if (FLAGS_enable_ssl) {
44
- fprintf (stderr, " warning: --enable_ssl is deprecated. Use "
43
+ fprintf (stderr,
44
+ " warning: --enable_ssl is deprecated. Use "
45
45
" --channel_creds_type=ssl.\n " );
46
46
return " ssl" ;
47
47
}
@@ -53,7 +53,7 @@ grpc::string CliCredentials::GetDefaultChannelCredsType() const {
53
53
}
54
54
55
55
std::shared_ptr<grpc::ChannelCredentials>
56
- CliCredentials::GetChannelCredentials () const {
56
+ CliCredentials::GetChannelCredentials () const {
57
57
if (FLAGS_channel_creds_type.compare (" insecure" ) == 0 ) {
58
58
return grpc::InsecureChannelCredentials ();
59
59
} else if (FLAGS_channel_creds_type.compare (" ssl" ) == 0 ) {
@@ -86,7 +86,8 @@ std::shared_ptr<grpc::ChannelCredentials> CliCredentials::GetCredentials()
86
86
if (FLAGS_channel_creds_type.empty ()) {
87
87
FLAGS_channel_creds_type = GetDefaultChannelCredsType ();
88
88
} else if (FLAGS_enable_ssl && FLAGS_channel_creds_type.compare (" ssl" ) != 0 ) {
89
- fprintf (stderr, " warning: ignoring --enable_ssl because "
89
+ fprintf (stderr,
90
+ " warning: ignoring --enable_ssl because "
90
91
" --channel_creds_type already set to %s.\n " ,
91
92
FLAGS_channel_creds_type.c_str ());
92
93
}
@@ -112,8 +113,9 @@ std::shared_ptr<grpc::ChannelCredentials> CliCredentials::GetCredentials()
112
113
}
113
114
// Composite any call-type credentials on top of the base channel.
114
115
std::shared_ptr<grpc::CallCredentials> call_creds = GetCallCredentials ();
115
- return (channel_creds == nullptr || call_creds == nullptr ) ? channel_creds :
116
- grpc::CompositeChannelCredentials (channel_creds, call_creds);
116
+ return (channel_creds == nullptr || call_creds == nullptr )
117
+ ? channel_creds
118
+ : grpc::CompositeChannelCredentials (channel_creds, call_creds);
117
119
}
118
120
119
121
const grpc::string CliCredentials::GetCredentialUsage () const {
@@ -128,7 +130,7 @@ const grpc::string CliCredentials::GetCredentialUsage() const {
128
130
129
131
const grpc::string CliCredentials::GetSslTargetNameOverride () const {
130
132
bool use_ssl = FLAGS_channel_creds_type.compare (" ssl" ) == 0 ||
131
- (FLAGS_access_token.empty () && FLAGS_use_auth);
133
+ (FLAGS_access_token.empty () && FLAGS_use_auth);
132
134
return use_ssl ? FLAGS_ssl_target : " " ;
133
135
}
134
136
0 commit comments