func newIDFromPublicKeyBytes(pubKeyBytes []byte) (id.ID, error) {
	pubKey, err := ecid.FromPublicKeyBytes(pubKeyBytes)
	if err != nil {
		return nil, err
	}
	return id.FromPublicKey(pubKey), nil
}
newStubPeerFromPublicKeyBytes creates a new stub peer with an ID coming from an ECDSA public key.
package server
import (
	"github.com/drausin/libri/libri/common/ecid"
	"github.com/drausin/libri/libri/common/id"
	"github.com/drausin/libri/libri/librarian/api"
	"github.com/drausin/libri/libri/librarian/server/comm"
	"github.com/golang/protobuf/proto"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
	"golang.org/x/net/context"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)
const (
	invalidRequestMsg    = "invalid request"
	requestNotAllowedMsg = "request not allowed"
)