π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix test
Neeraj Gupta17aa01ea378a
diff --git a/main.go b/main.goindex 536337dd17..57433358a8 100644--- a/main.go+++ b/main.go@@ -29,4 +29,5 @@ func main() {}}()cmd.Execute(&ctrl)+ //ctrl.StartSync()}diff --git a/pkg/key_holder.go b/pkg/key_holder.gonew file mode 100644index 0000000000..284852063f--- /dev/null+++ b/pkg/key_holder.go@@ -0,0 +1,4 @@+package pkg++type KeyHolder struct {+}diff --git a/pkg/model/enc_string.go b/pkg/model/enc_string.goindex d31c86e12e..71604df427 100644--- a/pkg/model/enc_string.go+++ b/pkg/model/enc_string.go@@ -27,5 +27,5 @@ func (e *EncString) MustDecrypt(key []byte) string {if err != nil {panic(err)}- return utils.EncodeBase64(plainBytes)+ return string(plainBytes)}diff --git a/pkg/remote_sync.go b/pkg/remote_sync.goindex 2b21336cf8..21bc33a06e 100644--- a/pkg/remote_sync.go+++ b/pkg/remote_sync.go@@ -3,7 +3,6 @@ package pkgimport (enteCrypto "cli-go/internal/crypto""cli-go/pkg/model"- "cli-go/utils""context""encoding/base64""fmt"@@ -21,14 +20,14 @@ func (c *ClICtrl) SyncAccount(account model.Account) error {return err}token := account.Token.MustDecrypt(c.CliKey)- accountMasterKey[account.AccountKey()] = utils.DecodeBase64(account.MasterKey.MustDecrypt(c.CliKey))- urlEncodedToken := base64.URLEncoding.EncodeToString(utils.DecodeBase64(token))+ accountMasterKey[account.AccountKey()] = []byte(account.MasterKey.MustDecrypt(c.CliKey))+ urlEncodedToken := base64.URLEncoding.EncodeToString([]byte(token))c.Client.AddToken(account.AccountKey(), urlEncodedToken)- ctx := c.GetRequestContext(context.Background(), account)+ ctx := c.buildRequestContext(context.Background(), account)return c.syncRemoteCollections(ctx, account)}-func (c *ClICtrl) GetRequestContext(ctx context.Context, account model.Account) context.Context {+func (c *ClICtrl) buildRequestContext(ctx context.Context, account model.Account) context.Context {ctx = context.WithValue(ctx, "app", string(account.App))ctx = context.WithValue(ctx, "account_id", account.AccountKey())return ctx