Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class SISLConan(ConanFile):
name = "sisl"
version = "14.8.2"
version = "14.8.1"

homepage = "https://github.com/eBay/sisl"
description = "Library for fast data structures, utilities"
Expand Down
5 changes: 0 additions & 5 deletions include/sisl/grpc/rpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,6 @@ class GrpcSyncClient : public GrpcBaseClient {
std::unique_ptr< typename ServiceT::StubInterface > MakeStub() {
return ServiceT::NewStub(m_channel);
}

protected:
void inject_auth_metadata(::grpc::ClientContext& ctx) const {
if (m_token_client) { ctx.AddMetadata(m_token_client->get_auth_header_key(), m_token_client->get_token()); }
}
};

ENUM(ClientState, uint8_t, VOID, INIT, RUNNING, SHUTTING_DOWN, TERMINATED)
Expand Down
29 changes: 0 additions & 29 deletions src/grpc/tests/unit/auth_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,6 @@ class EchoAndPingClient : public GrpcSyncClient {

const std::unique_ptr< EchoService::StubInterface >& echo_stub() { return echo_stub_; }

// Simulates how a real sync client subclass uses inject_auth_metadata (analogous to OmClient::init_ctx).
::grpc::Status call_echo(const EchoRequest& req, EchoReply& reply) {
::grpc::ClientContext ctx;
inject_auth_metadata(ctx);
return echo_stub_->Echo(&ctx, req, &reply);
}

private:
std::unique_ptr< EchoService::StubInterface > echo_stub_;
};
Expand All @@ -350,28 +343,6 @@ TEST_F(AuthEnableTest, allow_sync_client_with_auth) {
EXPECT_EQ(req.message(), reply.message());
}

TEST_F(AuthEnableTest, sync_client_injects_auth_header) {
EchoAndPingClient sync_client{grpc_server_addr, m_token_client, "", ""};
sync_client.init();
EchoRequest req;
EchoReply reply;
req.set_message("sync_inject_auth");
::grpc::Status status = sync_client.call_echo(req, reply);
ASSERT_TRUE(status.ok()) << status.error_message();
EXPECT_EQ(req.message(), reply.message());
}

TEST_F(AuthServerOnlyTest, sync_client_no_token_is_noop) {
EchoAndPingClient sync_client{grpc_server_addr, "", ""};
sync_client.init();
EchoRequest req;
EchoReply reply;
req.set_message("sync_no_token");
::grpc::Status status = sync_client.call_echo(req, reply);
EXPECT_FALSE(status.ok());
EXPECT_EQ(status.error_code(), ::grpc::UNAUTHENTICATED);
}

void validate_generic_reply(const std::string& method, ::grpc::Status& status) {
if (method == "method1" || method == "method2") {
EXPECT_TRUE(status.ok());
Expand Down
Loading