diff --git a/acl/object.go b/acl/object.go index 32a7487d..4c6c9e48 100644 --- a/acl/object.go +++ b/acl/object.go @@ -59,7 +59,7 @@ func (a *aclObject) AddConsensusRecords(recs []*consensusproto.RawRecordWithId) if a.store, a.consErr = list.NewInMemoryStorage(a.id, recs); a.consErr != nil { return } - if a.AclList, a.consErr = list.BuildAclListWithIdentity(a.aclService.accountService.Account(), a.store, recordverifier.NewValidateFull()); a.consErr != nil { + if a.AclList, a.consErr = list.BuildAclListWithIdentity(a.aclService.accountService.Account(), a.store, recordverifier.New()); a.consErr != nil { return } } else { diff --git a/commonspace/acl/aclclient/acjoiningclient.go b/commonspace/acl/aclclient/acjoiningclient.go index 8beaa91b..9a1a8ee2 100644 --- a/commonspace/acl/aclclient/acjoiningclient.go +++ b/commonspace/acl/aclclient/acjoiningclient.go @@ -61,7 +61,7 @@ func (c *aclJoiningClient) getAcl(ctx context.Context, spaceId string) (l list.A if err != nil { return } - return list.BuildAclListWithIdentity(c.keys, storage, recordverifier.NewValidateFull()) + return list.BuildAclListWithIdentity(c.keys, storage, recordverifier.New()) } func (c *aclJoiningClient) CancelJoin(ctx context.Context, spaceId string) (err error) { diff --git a/commonspace/acl/aclwaiter/aclwaiter.go b/commonspace/acl/aclwaiter/aclwaiter.go index e9d8eb10..75ec6481 100644 --- a/commonspace/acl/aclwaiter/aclwaiter.go +++ b/commonspace/acl/aclwaiter/aclwaiter.go @@ -83,7 +83,7 @@ func (a *aclWaiter) loop(ctx context.Context) error { if err != nil { return err } - acl, err := list.BuildAclListWithIdentity(a.keys, storage, recordverifier.NewValidateFull()) + acl, err := list.BuildAclListWithIdentity(a.keys, storage, recordverifier.New()) if err != nil { return err } diff --git a/commonspace/object/acl/recordverifier/recordverifier.go b/commonspace/object/acl/recordverifier/recordverifier.go index b52f130d..b7d28187 100644 --- a/commonspace/object/acl/recordverifier/recordverifier.go +++ b/commonspace/object/acl/recordverifier/recordverifier.go @@ -5,7 +5,6 @@ import ( "github.com/anyproto/any-sync/app" "github.com/anyproto/any-sync/consensus/consensusproto" - "github.com/anyproto/any-sync/nodeconf" "github.com/anyproto/any-sync/util/crypto" ) @@ -22,20 +21,16 @@ type RecordVerifier interface { } func New() RecordVerifier { - return &recordVerifier{} + return &recordVerifier{ + store: crypto.NewKeyStorage(), + } } type recordVerifier struct { - configuration nodeconf.NodeConf - networkKey crypto.PubKey - store crypto.KeyStorage + store crypto.KeyStorage } func (r *recordVerifier) Init(a *app.App) (err error) { - r.configuration = a.MustComponent(nodeconf.CName).(nodeconf.NodeConf) - r.store = crypto.NewKeyStorage() - networkId := r.configuration.Configuration().NetworkId - r.networkKey, err = crypto.DecodeNetworkId(networkId) return } diff --git a/commonspace/object/acl/recordverifier/recordverifier_test.go b/commonspace/object/acl/recordverifier/recordverifier_test.go index 40b9b337..5b36db4a 100644 --- a/commonspace/object/acl/recordverifier/recordverifier_test.go +++ b/commonspace/object/acl/recordverifier/recordverifier_test.go @@ -8,7 +8,6 @@ import ( "github.com/anyproto/any-sync/app" "github.com/anyproto/any-sync/consensus/consensusproto" - "github.com/anyproto/any-sync/nodeconf/testconf" "github.com/anyproto/any-sync/testutil/accounttest" "github.com/anyproto/any-sync/util/crypto" ) @@ -22,9 +21,8 @@ type fixture struct { func newFixture(t *testing.T) *fixture { accService := &accounttest.AccountTestService{} a := &app.App{} - verifier := &recordVerifier{} + verifier := New().(*recordVerifier) a.Register(accService). - Register(&testconf.StubConf{}). Register(verifier) require.NoError(t, a.Start(context.Background())) return &fixture{ diff --git a/commonspace/spacestorage/migration/aclmigrator.go b/commonspace/spacestorage/migration/aclmigrator.go index 0ca48e59..ec4dc64f 100644 --- a/commonspace/spacestorage/migration/aclmigrator.go +++ b/commonspace/spacestorage/migration/aclmigrator.go @@ -32,7 +32,7 @@ func migrateAclList(ctx context.Context, oldStorage oldstorage.ListStorage, head if err != nil { return nil, fmt.Errorf("migration: failed to generate keys: %w", err) } - aclList, err := list.BuildAclListWithIdentity(keys, aclStorage, recordverifier.NewValidateFull()) + aclList, err := list.BuildAclListWithIdentity(keys, aclStorage, recordverifier.New()) if err != nil { return nil, fmt.Errorf("migration: failed to build acl list: %w", err) }