Change identity error
This commit is contained in:
parent
e34d298b8e
commit
ba39057a23
@ -1,6 +1,7 @@
|
|||||||
package commonspace
|
package commonspace
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"github.com/anytypeio/any-sync/commonspace/object/acl/aclrecordproto"
|
"github.com/anytypeio/any-sync/commonspace/object/acl/aclrecordproto"
|
||||||
"github.com/anytypeio/any-sync/commonspace/object/acl/list"
|
"github.com/anytypeio/any-sync/commonspace/object/acl/list"
|
||||||
"github.com/anytypeio/any-sync/commonspace/object/tree/objecttree"
|
"github.com/anytypeio/any-sync/commonspace/object/tree/objecttree"
|
||||||
@ -21,6 +22,8 @@ const (
|
|||||||
SpaceReserved = "any-sync.space"
|
SpaceReserved = "any-sync.space"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var ErrIncorrectIdentity = errors.New("incorrect identity")
|
||||||
|
|
||||||
func storagePayloadForSpaceCreate(payload SpaceCreatePayload) (storagePayload spacestorage.SpaceStorageCreatePayload, err error) {
|
func storagePayloadForSpaceCreate(payload SpaceCreatePayload) (storagePayload spacestorage.SpaceStorageCreatePayload, err error) {
|
||||||
// marshalling keys
|
// marshalling keys
|
||||||
identity, err := payload.SigningKey.GetPublic().Marshall()
|
identity, err := payload.SigningKey.GetPublic().Marshall()
|
||||||
@ -247,7 +250,7 @@ func ValidateSpaceHeader(rawHeaderWithId *spacesyncproto.RawSpaceHeaderWithId, i
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !payloadIdentity.Equals(identity) {
|
if !payloadIdentity.Equals(identity) {
|
||||||
err = spacestorage.ErrIncorrectSpaceHeader
|
err = ErrIncorrectIdentity
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user