| 113 | }; |
| 114 | |
| 115 | static bool VerifyMyRequest(const brpc::InputMessageBase* msg_base) { |
| 116 | const brpc::policy::MostCommonMessage* msg = |
| 117 | static_cast<const brpc::policy::MostCommonMessage*>(msg_base); |
| 118 | brpc::Socket* ptr = msg->socket(); |
| 119 | |
| 120 | brpc::policy::RpcMeta meta; |
| 121 | butil::IOBufAsZeroCopyInputStream wrapper(msg->meta); |
| 122 | EXPECT_TRUE(meta.ParseFromZeroCopyStream(&wrapper)); |
| 123 | |
| 124 | if (meta.has_authentication_data()) { |
| 125 | // Credential MUST only appear in the first packet |
| 126 | EXPECT_TRUE(NULL == ptr->auth_context()); |
| 127 | EXPECT_EQ(meta.authentication_data(), MOCK_CREDENTIAL); |
| 128 | MyAuthenticator authenticator; |
| 129 | return authenticator.VerifyCredential( |
| 130 | "", butil::EndPoint(), ptr->mutable_auth_context()) == 0; |
| 131 | } |
| 132 | return true; |
| 133 | } |
| 134 | |
| 135 | class CallAfterRpcObject { |
| 136 | public: |
nothing calls this directly
no test coverage detected