chore: pairings file related properties removed from the local pairing

The pairings file is transferred along with the `SyncKeypair` message.
This commit is contained in:
Sale Djenic 2023-09-12 21:31:46 +02:00 committed by saledjenic
parent 6894295ac3
commit 3bacb84a02
5 changed files with 15 additions and 20 deletions

View File

@ -15,10 +15,9 @@ type SenderConfig struct {
// DeviceType SendPairInstallation need this information
DeviceType string `json:"deviceType" validate:"required"`
KeyUID string `json:"keyUID" validate:"required,keyuid"`
Password string `json:"password" validate:"required"`
ChatKey string `json:"chatKey"` // set only in case of a Keycard user, otherwise empty
KeycardPairings string `json:"keycardPairings"`
KeyUID string `json:"keyUID" validate:"required,keyuid"`
Password string `json:"password" validate:"required"`
ChatKey string `json:"chatKey"` // set only in case of a Keycard user, otherwise empty
DB *multiaccounts.Database `json:"-"`
}

View File

@ -43,8 +43,7 @@ const (
)
type AccountData struct {
Account *multiaccounts.Account `json:"account,omitempty"`
Password string `json:"password,omitempty"`
ChatKey string `json:"chatKey,omitempty"`
KeycardPairings string `json:"keycardPairings,omitempty"`
Account *multiaccounts.Account `json:"account,omitempty"`
Password string `json:"password,omitempty"`
ChatKey string `json:"chatKey,omitempty"`
}

View File

@ -25,11 +25,10 @@ var (
// AccountPayload represents the payload structure a Server handles
type AccountPayload struct {
keys map[string][]byte // nolint: structcheck
multiaccount *multiaccounts.Account
password string
chatKey string
keycardPairings string
keys map[string][]byte // nolint: structcheck
multiaccount *multiaccounts.Account
password string
chatKey string
//flag if account already exist before sync account
exist bool
}
@ -46,10 +45,9 @@ func NewPairingPayloadMarshaller(ap *AccountPayload, logger *zap.Logger) *Accoun
func (ppm *AccountPayloadMarshaller) MarshalProtobuf() ([]byte, error) {
lpp := &protobuf.LocalPairingPayload{
Keys: ppm.accountKeysToProtobuf(),
Password: ppm.password,
ChatKey: ppm.chatKey,
KeycardPairings: ppm.keycardPairings,
Keys: ppm.accountKeysToProtobuf(),
Password: ppm.password,
ChatKey: ppm.chatKey,
}
if ppm.multiaccount != nil {
lpp.Multiaccount = ppm.multiaccount.ToProtobuf()
@ -87,7 +85,7 @@ func (ppm *AccountPayloadMarshaller) UnmarshalProtobuf(data []byte) error {
}
ppm.password = pb.Password
ppm.chatKey = pb.ChatKey
ppm.keycardPairings = pb.KeycardPairings
return nil
}

View File

@ -112,7 +112,6 @@ func NewAccountPayloadLoader(p *AccountPayload, config *SenderConfig) (*AccountP
ppr.keyUID = config.KeyUID
ppr.password = config.Password
ppr.chatKey = config.ChatKey
ppr.keycardPairings = config.KeycardPairings
ppr.keystorePath = config.KeystorePath
return ppr, nil
}

View File

@ -101,7 +101,7 @@ func NewAccountPayloadReceiver(e *PayloadEncryptor, p *AccountPayload, config *R
return NewBasePayloadReceiver(e, NewPairingPayloadMarshaller(p, l), aps,
func() {
data := AccountData{Account: p.multiaccount, Password: p.password, ChatKey: p.chatKey, KeycardPairings: p.keycardPairings}
data := AccountData{Account: p.multiaccount, Password: p.password, ChatKey: p.chatKey}
signal.SendLocalPairingEvent(Event{Type: EventReceivedAccount, Action: ActionPairingAccount, Data: data})
},
), nil