Browse Source

Fixed new comments

Danny Reidenbach 5 years ago
parent
commit
05841158b0

+ 1 - 2
include/grpcpp/security/alts_context.h

@@ -24,7 +24,6 @@
 
 #include <map>
 #include <memory>
-#include <map>
 
 struct grpc_gcp_AltsContext;
 
@@ -62,7 +61,7 @@ class AltsContext {
   std::string local_service_account_;
   grpc_security_level security_level_ = GRPC_SECURITY_NONE;
   RpcProtocolVersions peer_rpc_versions_ = {{0, 0}, {0, 0}};
-  std::map<std::string, std::string> peer_attributes_map;
+  std::map<std::string, std::string> peer_attributes_map_;
 };
 
 }  // namespace experimental

+ 1 - 1
src/core/tsi/alts/handshaker/alts_handshaker_client.cc

@@ -263,7 +263,7 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c,
   }
   tsi_handshaker_result* result = nullptr;
   if (is_handshake_finished_properly(resp)) {
-    tsi_result status =
+    tsi_result status = 
         alts_tsi_handshaker_result_create(resp, client->is_client, &result);
     if (status != TSI_OK) {
       gpr_log(GPR_ERROR, "alts_tsi_handshaker_result_create() failed");

+ 0 - 4
src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc

@@ -301,7 +301,6 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
     gpr_log(GPR_ERROR, "Invalid local identity");
     return TSI_FAILED_PRECONDITION;
   }
-
   upb_strview local_service_account =
       grpc_gcp_Identity_service_account(local_identity);
   // We don't check if local service account is empty here
@@ -335,13 +334,11 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
                                                  local_service_account);
   grpc_gcp_AltsContext_set_peer_rpc_versions(
       context, const_cast<grpc_gcp_RpcProtocolVersions*>(peer_rpc_version));
-
   grpc_gcp_Identity* peer_identity = const_cast<grpc_gcp_Identity*>(identity);
   if (peer_identity == nullptr) {
     gpr_log(GPR_ERROR, "Null peer identity in ALTS context.");
     return TSI_FAILED_PRECONDITION;
   }
-
   if (grpc_gcp_Identity_has_attributes(
           const_cast<grpc_gcp_Identity*>(peer_identity))) {
     size_t iter = UPB_MAP_BEGIN;
@@ -357,7 +354,6 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
           grpc_gcp_Identity_attributes_nextmutable(peer_identity, &iter);
     }
   }
- 
   size_t serialized_ctx_length;
   char* serialized_ctx = grpc_gcp_AltsContext_serialize(
       context, context_arena.ptr(), &serialized_ctx_length);

+ 2 - 2
src/cpp/common/alts_context.cc

@@ -89,7 +89,7 @@ AltsContext::AltsContext(const grpc_gcp_AltsContext* ctx) {
           grpc_gcp_AltsContext_PeerAttributesEntry_key(peer_attributes_entry);
       upb_strview val = 
           grpc_gcp_AltsContext_PeerAttributesEntry_value(peer_attributes_entry);
-      peer_attributes_map[std::string(key.data, key.size)] = 
+      peer_attributes_map_[std::string(key.data, key.size)] = 
           std::string(val.data, val.size);
       peer_attributes_entry = 
           grpc_gcp_AltsContext_peer_attributes_next(ctx, &iter);
@@ -121,7 +121,7 @@ AltsContext::RpcProtocolVersions AltsContext::peer_rpc_versions() const {
 }
 
 std::map<std::string, std::string> AltsContext::peer_attributes() {
-  return peer_attributes_map;
+  return peer_attributes_map_;
 }
 
 }  // namespace experimental

+ 2 - 2
test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc

@@ -345,7 +345,7 @@ static void on_client_next_success_cb(tsi_result status, void* user_data,
   grpc_gcp_AltsContext_PeerAttributesEntry* peer_attributes_entry = 
       grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
   GPR_ASSERT(peer_attributes_entry != nullptr);
-  while ( peer_attributes_entry != nullptr) {
+  while (peer_attributes_entry != nullptr) {
     upb_strview key = grpc_gcp_AltsContext_PeerAttributesEntry_key(
         const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(
             peer_attributes_entry));
@@ -439,7 +439,7 @@ static void on_server_next_success_cb(tsi_result status, void* user_data,
   grpc_gcp_AltsContext_PeerAttributesEntry* peer_attributes_entry = 
       grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
   GPR_ASSERT(peer_attributes_entry != nullptr);
-  while ( peer_attributes_entry != nullptr) {
+  while (peer_attributes_entry != nullptr) {
     upb_strview key = grpc_gcp_AltsContext_PeerAttributesEntry_key(
         const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(
             peer_attributes_entry));