|
|
@@ -83,6 +83,11 @@ TEST(AltsUtilTest, AuthContextWithGoodAltsContextWithoutRpcVersions) {
|
|
|
std::string expected_rp("record protocol");
|
|
|
std::string expected_peer("peer");
|
|
|
std::string expected_local("local");
|
|
|
+
|
|
|
+ //doggo
|
|
|
+ std::string expected_peer_atrributes_key("peer");
|
|
|
+ std::string expected_peer_atrributes_value("attributes");
|
|
|
+
|
|
|
grpc_security_level expected_sl = GRPC_INTEGRITY_ONLY;
|
|
|
upb::Arena context_arena;
|
|
|
grpc_gcp_AltsContext* context = grpc_gcp_AltsContext_new(context_arena.ptr());
|
|
|
@@ -96,6 +101,12 @@ TEST(AltsUtilTest, AuthContextWithGoodAltsContextWithoutRpcVersions) {
|
|
|
grpc_gcp_AltsContext_set_local_service_account(
|
|
|
context,
|
|
|
upb_strview_make(expected_local.data(), expected_local.length()));
|
|
|
+
|
|
|
+grpc_gcp_AltsContext_peer_attributes_set(context,
|
|
|
+ upb_strview_make(expected_peer_atrributes_key.data(), expected_peer_atrributes_key.length()),
|
|
|
+ upb_strview_make(expected_peer_atrributes_value.data(), expected_peer_atrributes_value.length()),
|
|
|
+ context_arena.ptr());
|
|
|
+
|
|
|
size_t serialized_ctx_length;
|
|
|
char* serialized_ctx = grpc_gcp_AltsContext_serialize(
|
|
|
context, context_arena.ptr(), &serialized_ctx_length);
|
|
|
@@ -117,6 +128,8 @@ TEST(AltsUtilTest, AuthContextWithGoodAltsContextWithoutRpcVersions) {
|
|
|
EXPECT_EQ(0, rpc_protocol_versions.max_rpc_version.minor_version);
|
|
|
EXPECT_EQ(0, rpc_protocol_versions.min_rpc_version.major_version);
|
|
|
EXPECT_EQ(0, rpc_protocol_versions.min_rpc_version.minor_version);
|
|
|
+
|
|
|
+ EXPECT_EQ(expected_peer_atrributes_value, alts_context->peer_attributes()[expected_peer_atrributes_key]);
|
|
|
}
|
|
|
|
|
|
TEST(AltsUtilTest, AuthContextWithGoodAltsContext) {
|