MCPcopy Create free account
hub / github.com/bcspragu/logseq-sync / getGraphEncryptKeys

Method getGraphEncryptKeys

cmd/server/main.go:556–574  ·  view source on GitHub ↗
(ctx context.Context, req *getGraphEncryptKeysRequest)

Source from the content-addressed store, hash-verified

554}
555
556func (s *server) getGraphEncryptKeys(ctx context.Context, req *getGraphEncryptKeysRequest) (*getGraphEncryptKeysResponse, error) {
557 gID := db.GraphID(req.GraphUUID)
558
559 keys, err := s.db.GraphEncryptKeys(ctx, gID)
560 if err != nil {
561 return nil, httperr.Internal("failed to get graph encrypt keys %w", err)
562 }
563 if len(keys) == 0 {
564 return nil, httperr.NotFound("no graph encrypt keys for %q", gID)
565 }
566
567 // Get the last/latest key
568 key := keys[len(keys)-1]
569
570 return &getGraphEncryptKeysResponse{
571 PublicKey: key.PublicKey,
572 EncryptedPrivateKey: key.EncryptedPrivateKey,
573 }, nil
574}
575
576type createGraphSaltRequest struct {
577 GraphUUID string `json:"GraphUUID"`

Callers

nothing calls this directly

Calls 4

GraphIDTypeAlias · 0.92
InternalFunction · 0.92
NotFoundFunction · 0.92
GraphEncryptKeysMethod · 0.65

Tested by

no test coverage detected