Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix test

Neeraj Gupta17aa01ea378a
diff --git a/main.go b/main.go
index 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.go
new file mode 100644
index 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.go
index 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.go
index 2b21336cf8..21bc33a06e 100644
--- a/pkg/remote_sync.go
+++ b/pkg/remote_sync.go
@@ -3,7 +3,6 @@ package pkg
import (
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