Skip to content

Commit

Permalink
revert: 342810e
Browse files Browse the repository at this point in the history
Stop using a custom version of go-resty. The original reason for forking
resty has since been fixed.

See:
- go-resty/resty#334
- go-resty/resty#879
  • Loading branch information
major0 committed Jan 16, 2025
1 parent c4303a1 commit fffc1f0
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 127 deletions.
6 changes: 3 additions & 3 deletions attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ func (c *Client) UploadAttachment(ctx context.Context, addrKR *crypto.KeyRing, r
Param: "KeyPackets",
FileName: "blob",
ContentType: "application/octet-stream",
Stream: resty.NewByteMultipartStream(enc.KeyPacket),
Reader: bytes.NewReader(enc.KeyPacket),
},
&resty.MultipartField{
Param: "DataPacket",
FileName: "blob",
ContentType: "application/octet-stream",
Stream: resty.NewByteMultipartStream(enc.DataPacket),
Reader: bytes.NewReader(enc.DataPacket),
},
&resty.MultipartField{
Param: "Signature",
FileName: "blob",
ContentType: "application/octet-stream",
Stream: resty.NewByteMultipartStream(sig.GetBinary()),
Reader: bytes.NewReader(sig.GetBinary()),
},
).
Post("/mail/v4/attachments")
Expand Down
2 changes: 1 addition & 1 deletion block.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *Client) RequestBlockUpload(ctx context.Context, req BlockUploadReq) ([]
return res.UploadLinks, nil
}

func (c *Client) UploadBlock(ctx context.Context, bareURL, token string, block resty.MultiPartStream) error {
func (c *Client) UploadBlock(ctx context.Context, bareURL, token string, block io.Reader) error {
return c.do(ctx, func(r *resty.Request) (*resty.Response, error) {
return r.
SetHeader("pm-storage-token", token).
Expand Down
40 changes: 20 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
module github.com/ProtonMail/go-proton-api

go 1.21
go 1.23

toolchain go1.23.4

require (
github.com/Masterminds/semver/v3 v3.2.0
github.com/ProtonMail/gluon v0.17.1-0.20230724134000-308be39be96e
github.com/ProtonMail/go-crypto v0.0.0-20230717121622-edf196117233
github.com/ProtonMail/go-crypto v1.1.5
github.com/ProtonMail/go-srp v0.0.7
github.com/ProtonMail/gopenpgp/v2 v2.7.4-proton
github.com/PuerkitoBio/goquery v1.8.1
github.com/bradenaw/juniper v0.12.0
github.com/emersion/go-message v0.16.0
github.com/emersion/go-vcard v0.0.0-20230331202150-f3d26859ccd3
github.com/ProtonMail/gopenpgp/v2 v2.8.2
github.com/PuerkitoBio/goquery v1.10.1
github.com/bradenaw/juniper v0.15.3
github.com/emersion/go-message v0.18.2
github.com/emersion/go-vcard v0.0.0-20241024213814-c9703dde27ff
github.com/gin-gonic/gin v1.9.1
github.com/go-resty/resty/v2 v2.7.0
github.com/google/uuid v1.3.0
github.com/sirupsen/logrus v1.9.2
github.com/go-resty/resty/v2 v2.16.3
github.com/google/uuid v1.6.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.3
github.com/urfave/cli/v2 v2.24.4
gitlab.com/c0b/go-ordered-json v0.0.0-20201030195603-febf46534d5a
go.uber.org/goleak v1.2.1
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
golang.org/x/net v0.24.0
golang.org/x/text v0.14.0
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8
golang.org/x/net v0.34.0
golang.org/x/text v0.21.0
google.golang.org/grpc v1.56.3
google.golang.org/protobuf v1.33.0
)

require (
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf // indirect
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/andybalholm/cascadia v1.3.3 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cloudflare/circl v1.5.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cronokirby/saferith v0.33.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down Expand Up @@ -61,11 +63,9 @@ require (
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.29.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/go-resty/resty/v2 => github.com/LBeernaertProton/resty/v2 v2.0.0-20231129100320-dddf8030d93a
Loading

0 comments on commit fffc1f0

Please sign in to comment.