Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daemon: error out when using drkey endpoints without configured drkey #4453

Merged
merged 1 commit into from
Dec 7, 2023
Merged
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
9 changes: 9 additions & 0 deletions daemon/internal/servers/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ func (s *DaemonServer) DRKeyASHost(
req *pb_daemon.DRKeyASHostRequest,
) (*pb_daemon.DRKeyASHostResponse, error) {

if s.DRKeyClient == nil {
return nil, serrors.New("DRKey is not available")
}
meta, err := requestToASHostMeta(req)
if err != nil {
return nil, serrors.WrapStr("parsing protobuf ASHostReq", err)
Expand All @@ -378,6 +381,9 @@ func (s *DaemonServer) DRKeyHostAS(
req *pb_daemon.DRKeyHostASRequest,
) (*pb_daemon.DRKeyHostASResponse, error) {

if s.DRKeyClient == nil {
return nil, serrors.New("DRKey is not available")
}
meta, err := requestToHostASMeta(req)
if err != nil {
return nil, serrors.WrapStr("parsing protobuf HostASReq", err)
Expand All @@ -400,6 +406,9 @@ func (s *DaemonServer) DRKeyHostHost(
req *pb_daemon.DRKeyHostHostRequest,
) (*pb_daemon.DRKeyHostHostResponse, error) {

if s.DRKeyClient == nil {
return nil, serrors.New("DRKey is not available")
}
meta, err := requestToHostHostMeta(req)
if err != nil {
return nil, serrors.WrapStr("parsing protobuf HostHostReq", err)
Expand Down
Loading