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

Add invite type

This commit is contained in:
Mikhail Rakhmanov 2025-05-07 13:53:33 +02:00
parent 0751bbbd58
commit 4e9f1a3356
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
6 changed files with 131 additions and 90 deletions

View file

@ -22,6 +22,31 @@ var _ = math.Inf
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type AclInviteType int32
const (
AclInviteType_RequestToJoin AclInviteType = 0
AclInviteType_AnyoneCanJoin AclInviteType = 1
)
var AclInviteType_name = map[int32]string{
0: "RequestToJoin",
1: "AnyoneCanJoin",
}
var AclInviteType_value = map[string]int32{
"RequestToJoin": 0,
"AnyoneCanJoin": 1,
}
func (x AclInviteType) String() string {
return proto.EnumName(AclInviteType_name, int32(x))
}
func (AclInviteType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_c8e9f754f34e929b, []int{0}
}
// AclUserPermissions contains different possible user roles // AclUserPermissions contains different possible user roles
type AclUserPermissions int32 type AclUserPermissions int32
@ -57,7 +82,7 @@ func (x AclUserPermissions) String() string {
} }
func (AclUserPermissions) EnumDescriptor() ([]byte, []int) { func (AclUserPermissions) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_c8e9f754f34e929b, []int{0} return fileDescriptor_c8e9f754f34e929b, []int{1}
} }
// AclRoot is a root of access control list // AclRoot is a root of access control list
@ -1313,6 +1338,7 @@ func (m *AclData) GetAclContent() []*AclContentValue {
} }
func init() { func init() {
proto.RegisterEnum("aclrecord.AclInviteType", AclInviteType_name, AclInviteType_value)
proto.RegisterEnum("aclrecord.AclUserPermissions", AclUserPermissions_name, AclUserPermissions_value) proto.RegisterEnum("aclrecord.AclUserPermissions", AclUserPermissions_name, AclUserPermissions_value)
proto.RegisterType((*AclRoot)(nil), "aclrecord.AclRoot") proto.RegisterType((*AclRoot)(nil), "aclrecord.AclRoot")
proto.RegisterType((*AclAccountInvite)(nil), "aclrecord.AclAccountInvite") proto.RegisterType((*AclAccountInvite)(nil), "aclrecord.AclAccountInvite")
@ -1338,71 +1364,73 @@ func init() {
} }
var fileDescriptor_c8e9f754f34e929b = []byte{ var fileDescriptor_c8e9f754f34e929b = []byte{
// 1020 bytes of a gzipped FileDescriptorProto // 1054 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0xdc, 0x44, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x41, 0x6f, 0x1b, 0x45,
0x14, 0xb7, 0x77, 0x93, 0x6c, 0xf6, 0x39, 0x49, 0xdd, 0x29, 0xb4, 0x6e, 0x0a, 0xab, 0x65, 0x50, 0x14, 0xde, 0xb5, 0x93, 0x38, 0x7e, 0x4e, 0xd2, 0xcd, 0x14, 0xda, 0x6d, 0x0a, 0x56, 0x58, 0xd4,
0xab, 0x55, 0x85, 0x9a, 0x6a, 0x51, 0x2b, 0x54, 0x81, 0x52, 0x37, 0xa9, 0xba, 0x69, 0x55, 0xa8, 0xca, 0x8a, 0x50, 0x53, 0x19, 0xa5, 0x42, 0x15, 0x28, 0xdd, 0x3a, 0x55, 0x9d, 0x56, 0x85, 0x6a,
0xa6, 0xa2, 0x45, 0x48, 0x20, 0x39, 0xe3, 0x51, 0x31, 0xf8, 0xcf, 0x32, 0x9e, 0x5d, 0xb4, 0xdf, 0x5a, 0x5a, 0x84, 0x04, 0xd2, 0x64, 0x76, 0x54, 0x16, 0xd6, 0xb3, 0x66, 0x76, 0x6c, 0xe4, 0x7f,
0x82, 0x1b, 0x5f, 0x84, 0x2b, 0x77, 0x0e, 0x1c, 0x7a, 0xe4, 0x88, 0x92, 0x1b, 0x37, 0xbe, 0x01, 0xc1, 0x8d,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x7f, 0x25, 0x8e, 0x37, 0xd4, 0x9f, 0x4f, 0xff, 0x0f, 0x8a, 0x76, 0x4c, 0x38, 0x2b, 0x4a, 0xe5, 0xb1, 0x3a, 0xd1, 0x59, 0x7d, 0x78, 0xf8, 0xe7, 0x69,
0x00, 0x00, 0xff, 0xff, 0xb7, 0x65, 0xd3, 0x8c, 0x7a, 0x0c, 0x00, 0x00, 0xdb, 0x7e, 0x7b, 0xda, 0xb6, 0xff, 0x39, 0x6d, 0xdb, 0xbf, 0x9e, 0xb5, 0xad, 0xb7, 0x67, 0x6d,
0xeb, 0xef, 0xb3, 0xb6, 0xf5, 0xed, 0xad, 0x0b, 0xfd, 0x07, 0x72, 0xb2, 0xa6, 0xff, 0x7c, 0xfa,
0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x97, 0x9d, 0x7f, 0x03, 0xb1, 0x0c, 0x00, 0x00,
} }
func (m *AclRoot) Marshal() (dAtA []byte, err error) { func (m *AclRoot) Marshal() (dAtA []byte, err error) {

View file

@ -20,6 +20,11 @@ message AclAccountInvite {
bytes inviteKey = 1; bytes inviteKey = 1;
} }
enum AclInviteType {
RequestToJoin = 0;
AnyoneCanJoin = 1;
}
// AclAccountRequestJoin contains the reference to the invite record and the data of the person who wants to join, confirmed by the private invite key // AclAccountRequestJoin contains the reference to the invite record and the data of the person who wants to join, confirmed by the private invite key
message AclAccountRequestJoin { message AclAccountRequestJoin {
bytes inviteIdentity = 1; bytes inviteIdentity = 1;

View file

@ -323,7 +323,7 @@ func (a *aclRecordBuilder) buildInviteRevoke(inviteRecordId string) (value *aclr
err = ErrInsufficientPermissions err = ErrInsufficientPermissions
return return
} }
_, exists := a.state.inviteKeys[inviteRecordId] _, exists := a.state.invites[inviteRecordId]
if !exists { if !exists {
err = ErrNoSuchInvite err = ErrNoSuchInvite
return return
@ -334,17 +334,17 @@ func (a *aclRecordBuilder) buildInviteRevoke(inviteRecordId string) (value *aclr
func (a *aclRecordBuilder) BuildRequestJoin(payload RequestJoinPayload) (rawRecord *consensusproto.RawRecord, err error) { func (a *aclRecordBuilder) BuildRequestJoin(payload RequestJoinPayload) (rawRecord *consensusproto.RawRecord, err error) {
var inviteId string var inviteId string
for id, key := range a.state.inviteKeys { for id, inv := range a.state.invites {
if key.Equals(payload.InviteKey.GetPublic()) { if inv.Key.Equals(payload.InviteKey.GetPublic()) && inv.Type == aclrecordproto.AclInviteType_RequestToJoin {
inviteId = id inviteId = id
} }
} }
key, exists := a.state.inviteKeys[inviteId] invite, exists := a.state.invites[inviteId]
if !exists { if !exists {
err = ErrNoSuchInvite err = ErrNoSuchInvite
return return
} }
if !payload.InviteKey.GetPublic().Equals(key) { if !payload.InviteKey.GetPublic().Equals(invite.Key) {
err = ErrIncorrectInviteKey err = ErrIncorrectInviteKey
return return
} }

View file

@ -50,6 +50,11 @@ type AclKeys struct {
MetadataPubKey crypto.PubKey MetadataPubKey crypto.PubKey
} }
type Invite struct {
Key crypto.PubKey
Type aclrecordproto.AclInviteType
}
type AclState struct { type AclState struct {
id string id string
// keys represent current keys of the acl // keys represent current keys of the acl
@ -57,7 +62,7 @@ type AclState struct {
// accountStates is a map pubKey -> state which defines current account state // accountStates is a map pubKey -> state which defines current account state
accountStates map[string]AccountState accountStates map[string]AccountState
// inviteKeys is a map recordId -> invite // inviteKeys is a map recordId -> invite
inviteKeys map[string]crypto.PubKey invites map[string]Invite
// requestRecords is a map recordId -> RequestRecord // requestRecords is a map recordId -> RequestRecord
requestRecords map[string]RequestRecord requestRecords map[string]RequestRecord
// pendingRequests is a map pubKey -> recordId // pendingRequests is a map pubKey -> recordId
@ -82,7 +87,7 @@ func newAclStateWithKeys(
pubKey: key.GetPublic(), pubKey: key.GetPublic(),
keys: make(map[string]AclKeys), keys: make(map[string]AclKeys),
accountStates: make(map[string]AccountState), accountStates: make(map[string]AccountState),
inviteKeys: make(map[string]crypto.PubKey), invites: make(map[string]Invite),
requestRecords: make(map[string]RequestRecord), requestRecords: make(map[string]RequestRecord),
pendingRequests: make(map[string]string), pendingRequests: make(map[string]string),
keyStore: crypto.NewKeyStorage(), keyStore: crypto.NewKeyStorage(),
@ -103,7 +108,7 @@ func newAclState(rootRecord *AclRecord) (st *AclState, err error) {
id: rootRecord.Id, id: rootRecord.Id,
keys: make(map[string]AclKeys), keys: make(map[string]AclKeys),
accountStates: make(map[string]AccountState), accountStates: make(map[string]AccountState),
inviteKeys: make(map[string]crypto.PubKey), invites: make(map[string]Invite),
requestRecords: make(map[string]RequestRecord), requestRecords: make(map[string]RequestRecord),
pendingRequests: make(map[string]string), pendingRequests: make(map[string]string),
keyStore: crypto.NewKeyStorage(), keyStore: crypto.NewKeyStorage(),
@ -209,9 +214,9 @@ func (st *AclState) HadReadPermissions(identity crypto.PubKey) (had bool) {
return false return false
} }
func (st *AclState) Invites() []crypto.PubKey { func (st *AclState) Invites() []Invite {
var invites []crypto.PubKey var invites []Invite
for _, inv := range st.inviteKeys { for _, inv := range st.invites {
invites = append(invites, inv) invites = append(invites, inv)
} }
return invites return invites
@ -223,7 +228,7 @@ func (st *AclState) Key() crypto.PrivKey {
func (st *AclState) InviteIds() []string { func (st *AclState) InviteIds() []string {
var invites []string var invites []string
for invId := range st.inviteKeys { for invId := range st.invites {
invites = append(invites, invId) invites = append(invites, invId)
} }
return invites return invites
@ -350,7 +355,7 @@ func (st *AclState) Copy() *AclState {
pubKey: st.key.GetPublic(), pubKey: st.key.GetPublic(),
keys: make(map[string]AclKeys), keys: make(map[string]AclKeys),
accountStates: make(map[string]AccountState), accountStates: make(map[string]AccountState),
inviteKeys: make(map[string]crypto.PubKey), invites: make(map[string]Invite),
requestRecords: make(map[string]RequestRecord), requestRecords: make(map[string]RequestRecord),
pendingRequests: make(map[string]string), pendingRequests: make(map[string]string),
keyStore: st.keyStore, keyStore: st.keyStore,
@ -365,8 +370,8 @@ func (st *AclState) Copy() *AclState {
accState.PermissionChanges = permChanges accState.PermissionChanges = permChanges
newSt.accountStates[k] = accState newSt.accountStates[k] = accState
} }
for k, v := range st.inviteKeys { for k, v := range st.invites {
newSt.inviteKeys[k] = v newSt.invites[k] = v
} }
for k, v := range st.requestRecords { for k, v := range st.requestRecords {
newSt.requestRecords[k] = v newSt.requestRecords[k] = v
@ -452,7 +457,10 @@ func (st *AclState) applyInvite(ch *aclrecordproto.AclAccountInvite, record *Acl
if err != nil { if err != nil {
return err return err
} }
st.inviteKeys[record.Id] = inviteKey st.invites[record.Id] = Invite{
Key: inviteKey,
Type: aclrecordproto.AclInviteType_RequestToJoin, // Default value
}
return nil return nil
} }
@ -461,7 +469,7 @@ func (st *AclState) applyInviteRevoke(ch *aclrecordproto.AclAccountInviteRevoke,
if err != nil { if err != nil {
return err return err
} }
delete(st.inviteKeys, ch.InviteRecordId) delete(st.invites, ch.InviteRecordId)
return nil return nil
} }
@ -792,8 +800,8 @@ func (st *AclState) unmarshallDecryptPrivKey(msg []byte, decryptor func(msg []by
} }
func (st *AclState) GetInviteIdByPrivKey(inviteKey crypto.PrivKey) (recId string, err error) { func (st *AclState) GetInviteIdByPrivKey(inviteKey crypto.PrivKey) (recId string, err error) {
for id, inv := range st.inviteKeys { for id, inv := range st.invites {
if inv.Equals(inviteKey.GetPublic()) { if inv.Key.Equals(inviteKey.GetPublic()) {
return id, nil return id, nil
} }
} }

View file

@ -186,8 +186,8 @@ func TestAclList_InviteRevoke(t *testing.T) {
// checking acl state // checking acl state
require.True(t, ownerState().Permissions(ownerState().pubKey).IsOwner()) require.True(t, ownerState().Permissions(ownerState().pubKey).IsOwner())
require.True(t, ownerState().Permissions(accountState().pubKey).NoPermissions()) require.True(t, ownerState().Permissions(accountState().pubKey).NoPermissions())
require.Empty(t, ownerState().inviteKeys) require.Empty(t, ownerState().invites)
require.Empty(t, accountState().inviteKeys) require.Empty(t, accountState().invites)
} }
func TestAclList_RequestDecline(t *testing.T) { func TestAclList_RequestDecline(t *testing.T) {

View file

@ -160,7 +160,7 @@ func (c *contentValidator) ValidateInviteRevoke(ch *aclrecordproto.AclAccountInv
if !c.aclState.Permissions(authorIdentity).CanManageAccounts() { if !c.aclState.Permissions(authorIdentity).CanManageAccounts() {
return ErrInsufficientPermissions return ErrInsufficientPermissions
} }
_, exists := c.aclState.inviteKeys[ch.InviteRecordId] _, exists := c.aclState.invites[ch.InviteRecordId]
if !exists { if !exists {
return ErrNoSuchInvite return ErrNoSuchInvite
} }
@ -168,7 +168,7 @@ func (c *contentValidator) ValidateInviteRevoke(ch *aclrecordproto.AclAccountInv
} }
func (c *contentValidator) ValidateRequestJoin(ch *aclrecordproto.AclAccountRequestJoin, authorIdentity crypto.PubKey) (err error) { func (c *contentValidator) ValidateRequestJoin(ch *aclrecordproto.AclAccountRequestJoin, authorIdentity crypto.PubKey) (err error) {
inviteKey, exists := c.aclState.inviteKeys[ch.InviteRecordId] invite, exists := c.aclState.invites[ch.InviteRecordId]
if !exists { if !exists {
return ErrNoSuchInvite return ErrNoSuchInvite
} }
@ -189,7 +189,7 @@ func (c *contentValidator) ValidateRequestJoin(ch *aclrecordproto.AclAccountRequ
if err != nil { if err != nil {
return err return err
} }
ok, err := inviteKey.Verify(rawInviteIdentity, ch.InviteIdentitySignature) ok, err := invite.Key.Verify(rawInviteIdentity, ch.InviteIdentitySignature)
if err != nil { if err != nil {
return ErrInvalidSignature return ErrInvalidSignature
} }