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

Method uploadGraphEncryptKeys

cmd/server/main.go:648–659  ·  view source on GitHub ↗
(ctx context.Context, req *uploadGraphEncryptKeysRequest)

Source from the content-addressed store, hash-verified

646}
647
648func (s *server) uploadGraphEncryptKeys(ctx context.Context, req *uploadGraphEncryptKeysRequest) (*uploadGraphEncryptKeysResponse, error) {
649 err := s.db.AddGraphEncryptKey(ctx, db.GraphID(req.GraphUUID), &db.GraphEncryptKey{
650 EncryptedPrivateKey: req.EncryptedPrivateKey,
651 PublicKey: req.PublicKey,
652 })
653 if db.IsNotExists(err) {
654 return nil, httperr.NotFound("graph %q wasn't found", req.GraphUUID)
655 } else if err != nil {
656 return nil, httperr.Internal("failed to load graph salts: %w", err)
657 }
658 return &uploadGraphEncryptKeysResponse{}, nil
659}
660
661type getAllFilesRequest struct {
662 GraphUUID string `json:"GraphUUID"`

Callers

nothing calls this directly

Calls 5

GraphIDTypeAlias · 0.92
IsNotExistsFunction · 0.92
NotFoundFunction · 0.92
InternalFunction · 0.92
AddGraphEncryptKeyMethod · 0.65

Tested by

no test coverage detected