Skip to content

Commit 58f49e7

Browse files
committed
Fix moveLink to send NameSignatureEmail required by Proton Drive API
Set the new NameSignatureEmail field on MoveLinkReq and stop sending NodePassphraseSignature/SignatureEmail. Per the official Proton Drive Windows client (MoveLinkParameters.cs) the latter pair are only sent when moving an anonymously-signed node; for ordinary user-owned nodes they must be omitted so the server preserves the existing signature on the link. Bump go-proton-api for the new MoveLinkReq schema. Fixes rclone/rclone#8512
1 parent d6edc66 commit 58f49e7

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

folder.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ func (protonDrive *ProtonDrive) MoveFolder(ctx context.Context, srcLink *proton.
202202
func (protonDrive *ProtonDrive) moveLink(ctx context.Context, srcLink *proton.Link, dstParentLink *proton.Link, dstName string) error {
203203
// we are moving the srcLink to under dstParentLink, with name dstName
204204
req := proton.MoveLinkReq{
205-
ParentLinkID: dstParentLink.LinkID,
206-
OriginalHash: srcLink.Hash,
207-
SignatureAddress: protonDrive.signatureAddress,
205+
ParentLinkID: dstParentLink.LinkID,
206+
OriginalHash: srcLink.Hash,
207+
NameSignatureEmail: protonDrive.signatureAddress,
208208
}
209209

210210
dstParentKR, err := protonDrive.getLinkKR(ctx, dstParentLink)
@@ -239,7 +239,11 @@ func (protonDrive *ProtonDrive) moveLink(ctx context.Context, srcLink *proton.Li
239239
return err
240240
}
241241
req.NodePassphrase = nodePassphrase
242-
req.NodePassphraseSignature = srcLink.NodePassphraseSignature
242+
243+
// NodePassphraseSignature/SignatureEmail are only required for
244+
// anonymously created nodes (matching the official Proton Drive Windows
245+
// client). For regular user-owned nodes they are omitted so the server
246+
// preserves the existing signature on the link.
243247

244248
protonDrive.removeLinkIDFromCache(srcLink.LinkID, false)
245249

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.23.5
77
require (
88
github.com/ProtonMail/gluon v0.17.1-0.20230724134000-308be39be96e
99
github.com/ProtonMail/gopenpgp/v2 v2.8.2
10-
github.com/rclone/go-proton-api v1.0.1-0.20260127173028-eb465cac3b18
10+
github.com/rclone/go-proton-api v1.0.1
1111
github.com/relvacode/iso8601 v1.6.0
1212
golang.org/x/sync v0.10.0
1313
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
7575
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
7676
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
7777
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
78-
github.com/rclone/go-proton-api v1.0.1-0.20260127173028-eb465cac3b18 h1:Lc+d3ISfQaMJKWZOE7z4ZSY4RVmdzbn1B0IM8xN18qM=
79-
github.com/rclone/go-proton-api v1.0.1-0.20260127173028-eb465cac3b18/go.mod h1:LB2kCEaZMzNn3ocdz+qYfxXmuLxxN0ka62KJd2x53Bc=
78+
github.com/rclone/go-proton-api v1.0.1 h1:Nb7E1d0kPpniupBTqvf0JCmAfRdmuQx0IVjfo5T1/jg=
79+
github.com/rclone/go-proton-api v1.0.1/go.mod h1:LB2kCEaZMzNn3ocdz+qYfxXmuLxxN0ka62KJd2x53Bc=
8080
github.com/relvacode/iso8601 v1.6.0 h1:eFXUhMJN3Gz8Rcq82f9DTMW0svjtAVuIEULglM7QHTU=
8181
github.com/relvacode/iso8601 v1.6.0/go.mod h1:FlNp+jz+TXpyRqgmM7tnzHHzBnz776kmAH2h3sZCn0I=
8282
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=

0 commit comments

Comments
 (0)