From ecf288e70aa32d532bed79f8d940c349419ce0e8 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 18 Jul 2020 14:22:01 -0400 Subject: feat(3p/nix/nix-daemon): Implement Worker::AddSignatures handler I got the message proto wrong on this one as well - it needs both a path and a signatures. Change-Id: I9a489b1285bda61c15b2a3b47d9cfc3b50e387da Reviewed-on: https://cl.tvl.fyi/c/depot/+/1270 Tested-by: BuildkiteCI Reviewed-by: tazjin --- third_party/nix/src/nix-daemon/nix-daemon-proto.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'third_party/nix/src/nix-daemon') diff --git a/third_party/nix/src/nix-daemon/nix-daemon-proto.cc b/third_party/nix/src/nix-daemon/nix-daemon-proto.cc index 26ae538f29ad..d94e34cb40cd 100644 --- a/third_party/nix/src/nix-daemon/nix-daemon-proto.cc +++ b/third_party/nix/src/nix-daemon/nix-daemon-proto.cc @@ -227,6 +227,20 @@ class WorkerServiceImpl final : public WorkerService::Service { return Status::OK; } + Status AddSignatures(grpc::ServerContext* context, + const nix::proto::AddSignaturesRequest* request, + google::protobuf::Empty* response) override { + auto path = request->path().path(); + store_->assertStorePath(path); + + StringSet sigs; + sigs.insert(request->sigs().sigs().begin(), request->sigs().sigs().end()); + + store_->addSignatures(path, sigs); + + return Status::OK; + } + Status QueryMissing(grpc::ServerContext* context, const StorePaths* request, nix::proto::QueryMissingResponse* response) override { std::set targets; -- cgit 1.4.1