mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-10 18:10:49 +09:00
GO-5297: fixes
Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
This commit is contained in:
parent
f41af256fa
commit
1b107488d2
4 changed files with 14 additions and 11 deletions
|
@ -108,11 +108,11 @@ import (
|
|||
"github.com/anyproto/anytype-heart/space/spacecore"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/clientserver"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/credentialprovider"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/keystore"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/localdiscovery"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/oldstorage"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/peermanager"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/peerstore"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/spacekeystore"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/storage"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/storage/migrator"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/storage/migratorfinisher"
|
||||
|
@ -322,7 +322,7 @@ func Bootstrap(a *app.App, components ...app.Component) {
|
|||
Register(peerstatus.New()).
|
||||
Register(spaceview.New()).
|
||||
Register(api.New()).
|
||||
Register(keystore.New()).
|
||||
Register(spacekeystore.New()).
|
||||
Register(pushnotifcation.New())
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@ import (
|
|||
"github.com/anyproto/anytype-heart/core/pushnotifcation/client"
|
||||
"github.com/anyproto/anytype-heart/core/wallet"
|
||||
"github.com/anyproto/anytype-heart/pb"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/keystore"
|
||||
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/spacekeystore"
|
||||
)
|
||||
|
||||
const CName = "core.pushnotification.service"
|
||||
|
@ -30,13 +31,13 @@ func New() Service {
|
|||
type service struct {
|
||||
pushClient client.Client
|
||||
wallet wallet.Wallet
|
||||
spaceKeyStore keystore.SpaceKeyStore
|
||||
spaceKeyStore spacekeystore.Store
|
||||
}
|
||||
|
||||
func (s *service) Init(a *app.App) (err error) {
|
||||
s.pushClient = client.NewClient()
|
||||
s.wallet = app.MustComponent[wallet.Wallet](a)
|
||||
s.spaceKeyStore = app.MustComponent[keystore.SpaceKeyStore](a)
|
||||
s.spaceKeyStore = app.MustComponent[spacekeystore.Store](a)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
"github.com/anyproto/anytype-heart/space/internal/components/participantwatcher"
|
||||
"github.com/anyproto/anytype-heart/space/internal/components/spaceloader"
|
||||
"github.com/anyproto/anytype-heart/space/internal/components/spacestatus"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/keystore"
|
||||
"github.com/anyproto/anytype-heart/space/spacecore/spacekeystore"
|
||||
"github.com/anyproto/anytype-heart/space/spaceinfo"
|
||||
)
|
||||
|
||||
|
@ -50,7 +50,7 @@ type aclObjectManager struct {
|
|||
notificationService aclnotifications.AclNotification
|
||||
participantWatcher participantwatcher.ParticipantWatcher
|
||||
inviteMigrator invitemigrator.InviteMigrator
|
||||
spaceKeyStore keystore.SpaceKeyStore
|
||||
spaceKeyStore spacekeystore.Store
|
||||
|
||||
ownerMetadata []byte
|
||||
lastIndexed string
|
||||
|
@ -97,7 +97,7 @@ func (a *aclObjectManager) Init(ap *app.App) (err error) {
|
|||
a.statService.AddProvider(a)
|
||||
a.waitLoad = make(chan struct{})
|
||||
a.wait = make(chan struct{})
|
||||
a.spaceKeyStore = app.MustComponent[keystore.SpaceKeyStore](ap)
|
||||
a.spaceKeyStore = app.MustComponent[spacekeystore.Store](ap)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package keystore
|
||||
package spacekeystore
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
@ -22,7 +22,7 @@ var ErrNotFound = errors.New("key not found")
|
|||
|
||||
const (
|
||||
CName = "space.core.spaceKeyStore"
|
||||
spaceKeyPath = "m/SLIP-0021/anytype/space/key"
|
||||
spaceKeyPath = "m/99999'/1'"
|
||||
spaceVersion = 0xB5
|
||||
)
|
||||
|
||||
|
@ -42,6 +42,7 @@ type SpaceKeyStore struct {
|
|||
}
|
||||
|
||||
func (s *SpaceKeyStore) Init(a *app.App) (err error) {
|
||||
s.eventSender = app.MustComponent[event.Sender](a)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -49,13 +50,14 @@ func (s *SpaceKeyStore) Name() (name string) {
|
|||
return CName
|
||||
}
|
||||
|
||||
func New() app.Component {
|
||||
func New() Store {
|
||||
return &SpaceKeyStore{
|
||||
spaceIdToKey: make(map[string]string),
|
||||
spaceKeyToEncryptionKey: make(map[string]crypto.PrivKey),
|
||||
spaceKeyToAclRecordId: make(map[string]string),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *SpaceKeyStore) SyncKeysFromAclState(spaceID string, aclState *list.AclState) {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
Loading…
Add table
Add a link
Reference in a new issue