1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

GO-3478 Merge main

This commit is contained in:
kirillston 2024-05-17 16:57:47 +03:00
commit 344136ff3c
No known key found for this signature in database
GPG key ID: 88218A7F1109754B
11 changed files with 290 additions and 130 deletions

View file

@ -3,6 +3,12 @@ package commonspace
import (
"context"
"fmt"
"math/rand"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/anyproto/any-sync/commonspace/object/accountdata"
"github.com/anyproto/any-sync/commonspace/object/tree/objecttree"
"github.com/anyproto/any-sync/commonspace/object/tree/treechangeproto"
@ -12,10 +18,6 @@ import (
"github.com/anyproto/any-sync/commonspace/spacestorage"
"github.com/anyproto/any-sync/commonspace/spacesyncproto"
"github.com/anyproto/any-sync/util/crypto"
"github.com/stretchr/testify/require"
"math/rand"
"testing"
"time"
)
func addIncorrectSnapshot(settingsObject settings.SettingsObject, acc *accountdata.AccountKeys, partialIds map[string]struct{}, newId string) (err error) {

View file

@ -4,14 +4,16 @@ package objecttree
import (
"context"
"errors"
"fmt"
"sync"
"time"
"github.com/anyproto/any-sync/util/crypto"
"go.uber.org/zap"
"github.com/anyproto/any-sync/commonspace/object/acl/list"
"github.com/anyproto/any-sync/commonspace/object/tree/treechangeproto"
"github.com/anyproto/any-sync/commonspace/object/tree/treestorage"
"github.com/anyproto/any-sync/util/crypto"
"github.com/anyproto/any-sync/util/slice"
)
@ -29,6 +31,7 @@ var (
ErrNoChangeInTree = errors.New("no such change in tree")
ErrMissingKey = errors.New("missing current read key")
ErrDerived = errors.New("expect >= 2 changes in derived tree")
ErrDeleted = errors.New("object tree is deleted")
)
type AddResultSummary int
@ -105,6 +108,7 @@ type objectTree struct {
keys map[string]crypto.SymKey
currentReadKey crypto.SymKey
isDeleted bool
// buffers
difSnapshotBuf []*treechangeproto.RawTreeChangeWithId
@ -122,6 +126,7 @@ func (ot *objectTree) rebuildFromStorage(theirHeads []string, newChanges []*Chan
ot.treeBuilder.Reset()
ot.tree, err = ot.treeBuilder.Build(theirHeads, newChanges)
if err != nil {
ot.tree = oldTree
return
}
@ -179,6 +184,9 @@ func (ot *objectTree) Storage() treestorage.TreeStorage {
}
func (ot *objectTree) GetChange(id string) (*Change, error) {
if ot.isDeleted {
return nil, ErrDeleted
}
if ch, ok := ot.tree.attached[id]; ok {
return ch, nil
}
@ -186,6 +194,10 @@ func (ot *objectTree) GetChange(id string) (*Change, error) {
}
func (ot *objectTree) AddContent(ctx context.Context, content SignableChangeContent) (res AddResult, err error) {
if ot.isDeleted {
err = ErrDeleted
return
}
payload, err := ot.prepareBuilderContent(content)
if err != nil {
return
@ -227,6 +239,10 @@ func (ot *objectTree) AddContent(ctx context.Context, content SignableChangeCont
}
func (ot *objectTree) UnpackChange(raw *treechangeproto.RawTreeChangeWithId) (data []byte, err error) {
if ot.isDeleted {
err = ErrDeleted
return
}
unmarshalled, err := ot.changeBuilder.Unmarshall(raw, true)
if err != nil {
return
@ -236,6 +252,10 @@ func (ot *objectTree) UnpackChange(raw *treechangeproto.RawTreeChangeWithId) (da
}
func (ot *objectTree) PrepareChange(content SignableChangeContent) (res *treechangeproto.RawTreeChangeWithId, err error) {
if ot.isDeleted {
err = ErrDeleted
return
}
payload, err := ot.prepareBuilderContent(content)
if err != nil {
return
@ -291,6 +311,10 @@ func (ot *objectTree) prepareBuilderContent(content SignableChangeContent) (cnt
}
func (ot *objectTree) AddRawChanges(ctx context.Context, changesPayload RawChangesPayload) (addResult AddResult, err error) {
if ot.isDeleted {
err = ErrDeleted
return
}
lastHeadId := ot.tree.lastIteratedHeadId
addResult, err = ot.addRawChanges(ctx, changesPayload)
if err != nil {
@ -408,20 +432,27 @@ func (ot *objectTree) addRawChanges(ctx context.Context, changesPayload RawChang
break
}
}
log := log.With(zap.String("treeId", ot.id))
if shouldRebuildFromStorage {
err = ot.rebuildFromStorage(headsToUse, ot.newChangesBuf)
if err != nil {
log.Error("failed to rebuild with new heads", zap.Strings("headsToUse", headsToUse), zap.Error(err))
// rebuilding without new changes
ot.rebuildFromStorage(nil, nil)
rebuildErr := ot.rebuildFromStorage(nil, nil)
if rebuildErr != nil {
log.Error("failed to rebuild from storage", zap.Strings("heads", ot.Heads()), zap.Error(rebuildErr))
}
return
}
addResult, err = ot.createAddResult(prevHeadsCopy, Rebuild, nil, changesPayload.RawChanges)
if err != nil {
log.Error("failed to create add result", zap.Strings("headsToUse", headsToUse), zap.Error(err))
// that means that some unattached changes were somehow corrupted in memory
// this shouldn't happen but if that happens, then rebuilding from storage
ot.rebuildFromStorage(nil, nil)
return
rebuildErr := ot.rebuildFromStorage(nil, nil)
if rebuildErr != nil {
log.Error("failed to rebuild after add result", zap.Strings("heads", ot.Heads()), zap.Error(rebuildErr))
}
}
return
}
@ -442,7 +473,7 @@ func (ot *objectTree) addRawChanges(ctx context.Context, changesPayload RawChang
err = ot.validateTree(treeChangesAdded)
if err != nil {
rollback(treeChangesAdded)
err = ErrHasInvalidChanges
err = fmt.Errorf("%w: %w", ErrHasInvalidChanges, err)
return
}
addResult, err = ot.createAddResult(prevHeadsCopy, mode, treeChangesAdded, changesPayload.RawChanges)
@ -526,6 +557,10 @@ func (ot *objectTree) IterateRoot(convert ChangeConvertFunc, iterate ChangeItera
}
func (ot *objectTree) IterateFrom(id string, convert ChangeConvertFunc, iterate ChangeIterateFunc) (err error) {
if ot.isDeleted {
err = ErrDeleted
return
}
if convert == nil {
ot.tree.Iterate(id, iterate)
return
@ -575,12 +610,14 @@ func (ot *objectTree) IterateFrom(id string, convert ChangeConvertFunc, iterate
}
func (ot *objectTree) HasChanges(chs ...string) bool {
if ot.isDeleted {
return false
}
for _, ch := range chs {
if _, attachedExists := ot.tree.attached[ch]; !attachedExists {
return false
}
}
return true
}
@ -601,10 +638,17 @@ func (ot *objectTree) Close() error {
}
func (ot *objectTree) Delete() error {
if ot.isDeleted {
return nil
}
ot.isDeleted = true
return ot.treeStorage.Delete()
}
func (ot *objectTree) SnapshotPath() []string {
if ot.isDeleted {
return nil
}
// TODO: Add error as return parameter
if ot.snapshotPathIsActual() {
return ot.snapshotPath
@ -627,6 +671,9 @@ func (ot *objectTree) SnapshotPath() []string {
}
func (ot *objectTree) ChangesAfterCommonSnapshot(theirPath, theirHeads []string) ([]*treechangeproto.RawTreeChangeWithId, error) {
if ot.isDeleted {
return nil, ErrDeleted
}
var (
needFullDocument = len(theirPath) == 0
ourPath = ot.SnapshotPath()

View file

@ -2,6 +2,7 @@ package objecttree
import (
"context"
"errors"
"fmt"
"testing"
"time"
@ -121,6 +122,51 @@ func TestObjectTree(t *testing.T) {
aclList, keys := prepareAclList(t)
ctx := context.Background()
t.Run("delete object tree", func(t *testing.T) {
exec := list.NewAclExecutor("spaceId")
type cmdErr struct {
cmd string
err error
}
cmds := []cmdErr{
{"a.init::a", nil},
}
for _, cmd := range cmds {
err := exec.Execute(cmd.cmd)
require.Equal(t, cmd.err, err, cmd)
}
aAccount := exec.ActualAccounts()["a"]
root, err := CreateObjectTreeRoot(ObjectTreeCreatePayload{
PrivKey: aAccount.Keys.SignKey,
ChangeType: "changeType",
ChangePayload: nil,
SpaceId: "spaceId",
IsEncrypted: true,
}, aAccount.Acl)
require.NoError(t, err)
aStore, _ := treestorage.NewInMemoryTreeStorage(root, []string{root.Id}, []*treechangeproto.RawTreeChangeWithId{root})
aTree, err := BuildKeyFilterableObjectTree(aStore, aAccount.Acl)
require.NoError(t, err)
err = aTree.Delete()
require.NoError(t, err)
_, err = aTree.ChangesAfterCommonSnapshot(nil, nil)
require.Equal(t, ErrDeleted, err)
err = aTree.IterateFrom("", nil, func(change *Change) bool {
return true
})
require.Equal(t, ErrDeleted, err)
_, err = aTree.AddContent(ctx, SignableChangeContent{})
require.Equal(t, ErrDeleted, err)
_, err = aTree.AddRawChanges(ctx, RawChangesPayload{})
require.Equal(t, ErrDeleted, err)
_, err = aTree.PrepareChange(SignableChangeContent{})
require.Equal(t, ErrDeleted, err)
_, err = aTree.UnpackChange(nil)
require.Equal(t, ErrDeleted, err)
_, err = aTree.GetChange("")
require.Equal(t, ErrDeleted, err)
})
t.Run("user delete logic: validation, key change, decryption", func(t *testing.T) {
exec := list.NewAclExecutor("spaceId")
type cmdErr struct {
@ -1183,6 +1229,6 @@ func TestObjectTree(t *testing.T) {
Heads: []string{"3"},
Changes: rawChanges,
}, ctx.aclList)
require.Equal(t, ErrHasInvalidChanges, err)
require.True(t, errors.Is(err, ErrHasInvalidChanges))
})
}

View file

@ -170,7 +170,7 @@ func ValidateRawTreeBuildFunc(payload treestorage.TreeStorageCreatePayload, buil
return
}
if !slice.UnsortedEquals(res.Heads, payload.Heads) {
return payload, ErrHasInvalidChanges
return payload, fmt.Errorf("heads mismatch: %v != %v, %w", res.Heads, payload.Heads, ErrHasInvalidChanges)
}
// if tree has only one change we still should check if the snapshot id is same as root
if IsEmptyDerivedTree(tree) {

View file

@ -3,9 +3,10 @@ package treestorage
import (
"context"
"fmt"
"sync"
"github.com/anyproto/any-sync/commonspace/object/tree/treechangeproto"
"github.com/anyproto/any-sync/util/slice"
"sync"
)
type InMemoryTreeStorage struct {
@ -111,6 +112,9 @@ func (t *InMemoryTreeStorage) GetRawChange(ctx context.Context, changeId string)
}
func (t *InMemoryTreeStorage) Delete() error {
t.root = nil
t.Changes = nil
t.heads = nil
return nil
}

View file

@ -186,7 +186,7 @@ func (i *InMemorySpaceStorage) AllTrees() map[string]treestorage.TreeStorage {
defer i.Unlock()
cp := map[string]treestorage.TreeStorage{}
for id, store := range i.trees {
cp[id] = store
cp[id] = store.(*treestorage.InMemoryTreeStorage).Copy()
}
return cp
}

14
go.mod
View file

@ -9,7 +9,7 @@ require (
github.com/anyproto/go-slip21 v1.0.0
github.com/cespare/xxhash v1.1.0
github.com/cheggaaa/mb/v3 v3.0.2
github.com/ethereum/go-ethereum v1.13.12
github.com/ethereum/go-ethereum v1.13.15
github.com/gobwas/glob v0.2.3
github.com/goccy/go-graphviz v0.1.2
github.com/gogo/protobuf v1.3.2
@ -25,17 +25,17 @@ require (
github.com/mr-tron/base58 v1.2.0
github.com/multiformats/go-multibase v0.2.0
github.com/multiformats/go-multihash v0.2.3
github.com/prometheus/client_golang v1.19.0
github.com/quic-go/quic-go v0.43.0
github.com/prometheus/client_golang v1.19.1
github.com/quic-go/quic-go v0.43.1
github.com/stretchr/testify v1.9.0
github.com/tyler-smith/go-bip39 v1.1.0
github.com/zeebo/blake3 v0.2.3
go.uber.org/atomic v1.11.0
go.uber.org/mock v0.4.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.22.0
golang.org/x/crypto v0.23.0
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
golang.org/x/net v0.24.0
golang.org/x/net v0.25.0
golang.org/x/time v0.5.0
gopkg.in/yaml.v3 v3.0.1
storj.io/drpc v0.0.34
@ -105,9 +105,9 @@ require (
golang.org/x/image v0.14.0 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)

32
go.sum
View file

@ -86,8 +86,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etly
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY=
github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-ethereum v1.13.12 h1:iDr9UM2JWkngBHGovRJEQn4Kor7mT4gt9rUZqB5M29Y=
github.com/ethereum/go-ethereum v1.13.12/go.mod h1:hKL2Qcj1OvStXNSEDbucexqnEt1Wh4Cz329XsjAalZY=
github.com/ethereum/go-ethereum v1.13.15 h1:U7sSGYGo4SPjP6iNIifNoyIAiNjrmQkz6EwQG+/EZWo=
github.com/ethereum/go-ethereum v1.13.15/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU=
github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg=
github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
@ -294,8 +294,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4=
github.com/polydawn/refmt v0.89.0/go.mod h1:/zvteZs/GwLtCgZ4BL6CBsk9IKIlexP43ObX9AxTqTw=
github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
@ -304,8 +304,8 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
github.com/quic-go/quic-go v0.43.0 h1:sjtsTKWX0dsHpuMJvLxGqoQdtgJnbAPWY+W+5vjYW/g=
github.com/quic-go/quic-go v0.43.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M=
github.com/quic-go/quic-go v0.43.1 h1:fLiMNfQVe9q2JvSsiXo4fXOEguXHGGl9+6gLp4RPeZQ=
github.com/quic-go/quic-go v0.43.1/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M=
github.com/quic-go/webtransport-go v0.6.0 h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY=
github.com/quic-go/webtransport-go v0.6.0/go.mod h1:9KjU4AEBqEQidGHNDkZrb8CAa1abRaosM2yGOyiikEc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
@ -384,8 +384,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw=
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
@ -403,8 +403,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -423,13 +423,13 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@ -445,8 +445,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=

View file

@ -26,4 +26,5 @@ var (
ErrEmailFailedToSend = errGroup.Register(errors.New("failed to send email"), uint64(ErrorCodes_EmailFailedToSend))
ErrEmailExpired = errGroup.Register(errors.New("email verification request expired. try getting new code"), uint64(ErrorCodes_EmailExpired))
ErrEmailWrongCode = errGroup.Register(errors.New("wrong verification code"), uint64(ErrorCodes_EmailWrongCode))
ErrInvalidReceipt = errGroup.Register(errors.New("invalid AppStore receipt"), uint64(ErrorCodes_InvalidReceipt))
)

View file

@ -170,6 +170,7 @@ const (
ErrorCodes_EmailFailedToSend ErrorCodes = 15
ErrorCodes_EmailExpired ErrorCodes = 16
ErrorCodes_EmailWrongCode ErrorCodes = 17
ErrorCodes_InvalidReceipt ErrorCodes = 18
ErrorCodes_ErrorOffset ErrorCodes = 600
)
@ -192,6 +193,7 @@ var ErrorCodes_name = map[int32]string{
15: "EmailFailedToSend",
16: "EmailExpired",
17: "EmailWrongCode",
18: "InvalidReceipt",
600: "ErrorOffset",
}
@ -214,6 +216,7 @@ var ErrorCodes_value = map[string]int32{
"EmailFailedToSend": 15,
"EmailExpired": 16,
"EmailWrongCode": 17,
"InvalidReceipt": 18,
"ErrorOffset": 600,
}
@ -490,6 +493,8 @@ type BuySubscriptionRequest struct {
// if empty - then no name requested
// if non-empty - PP node will register that name on behalf of the user
RequestedAnyName string `protobuf:"bytes,5,opt,name=requestedAnyName,proto3" json:"requestedAnyName,omitempty"`
// for some payment methods we need to know the user's email
UserEmail string `protobuf:"bytes,6,opt,name=userEmail,proto3" json:"userEmail,omitempty"`
}
func (m *BuySubscriptionRequest) Reset() { *m = BuySubscriptionRequest{} }
@ -560,6 +565,13 @@ func (m *BuySubscriptionRequest) GetRequestedAnyName() string {
return ""
}
func (m *BuySubscriptionRequest) GetUserEmail() string {
if m != nil {
return m.UserEmail
}
return ""
}
type BuySubscriptionRequestSigned struct {
// BuySubscriptionRequest
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
@ -1574,98 +1586,99 @@ func init() {
}
var fileDescriptor_4feb29dcc5ba50f6 = []byte{
// 1446 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcb, 0x73, 0x1b, 0x45,
0x13, 0xd7, 0xea, 0x61, 0x5b, 0xed, 0xd7, 0x78, 0x2c, 0x3b, 0x1b, 0xc5, 0xd6, 0xe7, 0xec, 0xf7,
0x72, 0x99, 0x62, 0x53, 0x84, 0x1c, 0x28, 0x8a, 0xa2, 0x90, 0x6d, 0xd9, 0xb8, 0x2a, 0x18, 0x97,
0xa4, 0x24, 0x40, 0x28, 0x60, 0xad, 0x6d, 0xdb, 0x4b, 0xd6, 0x33, 0xcb, 0xec, 0x28, 0xce, 0x72,
0xe3, 0xc8, 0x8d, 0x2a, 0x0e, 0xfc, 0x41, 0x5c, 0x38, 0xe6, 0x98, 0x23, 0x24, 0x37, 0x4e, 0x1c,
0x39, 0x52, 0x33, 0xbb, 0xb2, 0x56, 0xd6, 0x4a, 0x36, 0x71, 0x71, 0xb1, 0x66, 0x7e, 0x33, 0xdd,
0xd3, 0xfd, 0xeb, 0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 0x63,
0x5f, 0x14, 0x2b, 0xb7, 0xf9, 0xde, 0x2f, 0x2f, 0x6b, 0xc6, 0xf3, 0x97, 0x35, 0xe3, 0xd7, 0x97,
0x35, 0xe3, 0x87, 0x57, 0xb5, 0xdc, 0xf3, 0x57, 0xb5, 0xdc, 0x8b, 0x57, 0xb5, 0xdc, 0x67, 0xd6,
0xe5, 0xff, 0x79, 0x38, 0x9c, 0xd0, 0x3f, 0x6f, 0xff, 0x15, 0x00, 0x00, 0xff, 0xff, 0x72, 0x4d,
0xf4, 0xd7, 0xe6, 0x10, 0x00, 0x00,
// 1457 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x5b, 0x6f, 0x1b, 0xc5,
0x17, 0xf7, 0xfa, 0x96, 0xf8, 0xe4, 0x36, 0x99, 0x38, 0xe9, 0xd6, 0x4d, 0xfc, 0x4f, 0xf7, 0x7f,
0x8b, 0x82, 0xd8, 0x8a, 0xd2, 0x07, 0x84, 0x10, 0xc2, 0x49, 0x9c, 0x10, 0xa9, 0x84, 0xc8, 0x76,
0x5b, 0xa0, 0x08, 0xd8, 0x78, 0x4f, 0x92, 0xa5, 0x9b, 0x99, 0x65, 0x76, 0xdc, 0x74, 0xf9, 0x04,
0xf0, 0x86, 0x84, 0x10, 0x1f, 0x88, 0x17, 0x1e, 0xfb, 0xd8, 0x47, 0x68, 0xbf, 0x00, 0x8f, 0x3c,
0xa2, 0x99, 0x5d, 0xc7, 0xeb, 0x78, 0xe3, 0x84, 0x46, 0xbc, 0x34, 0x3b, 0xbf, 0x99, 0x73, 0xe6,
0x9c, 0xdf, 0xb9, 0xcc, 0x71, 0xe1, 0xfd, 0xc0, 0x89, 0x4e, 0x90, 0xc9, 0x10, 0xc5, 0x53, 0xaf,
0x8b, 0x77, 0x86, 0x97, 0x81, 0xe0, 0x92, 0xdf, 0xd1, 0xff, 0x86, 0xe7, 0xb6, 0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xbf, 0xac, 0x1b, 0xbf, 0xbd, 0xac, 0x1b, 0x3f, 0xbc, 0xaa, 0xe7,
0x9e, 0xbf, 0xaa, 0xe7, 0x5e, 0xbc, 0xaa, 0xe7, 0x3e, 0xb3, 0x2e, 0xff, 0xbf, 0x8a, 0x83, 0xb2,
0xfe, 0xf3, 0xf6, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x52, 0xc6, 0x90, 0x45, 0x18, 0x11, 0x00,
0x00,
}
func (m *GetSubscriptionRequest) Marshal() (dAtA []byte, err error) {
@ -1837,6 +1850,13 @@ func (m *BuySubscriptionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
_ = i
var l int
_ = l
if len(m.UserEmail) > 0 {
i -= len(m.UserEmail)
copy(dAtA[i:], m.UserEmail)
i = encodeVarintPaymentservice(dAtA, i, uint64(len(m.UserEmail)))
i--
dAtA[i] = 0x32
}
if len(m.RequestedAnyName) > 0 {
i -= len(m.RequestedAnyName)
copy(dAtA[i:], m.RequestedAnyName)
@ -2637,6 +2657,10 @@ func (m *BuySubscriptionRequest) Size() (n int) {
if l > 0 {
n += 1 + l + sovPaymentservice(uint64(l))
}
l = len(m.UserEmail)
if l > 0 {
n += 1 + l + sovPaymentservice(uint64(l))
}
return n
}
@ -3553,6 +3577,38 @@ func (m *BuySubscriptionRequest) Unmarshal(dAtA []byte) error {
}
m.RequestedAnyName = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field UserEmail", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPaymentservice
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthPaymentservice
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthPaymentservice
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.UserEmail = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipPaymentservice(dAtA[iNdEx:])

View file

@ -89,6 +89,8 @@ message BuySubscriptionRequest {
// if empty - then no name requested
// if non-empty - PP node will register that name on behalf of the user
string requestedAnyName = 5;
// for some payment methods we need to know the user's email
string userEmail = 6;
}
message BuySubscriptionRequestSigned {
@ -254,6 +256,8 @@ enum ErrorCodes {
EmailExpired = 16;
EmailWrongCode = 17;
InvalidReceipt = 18;
ErrorOffset = 600;
}