mirror of
https://github.com/bitwarden/mobile
synced 2025-12-16 00:03:22 +00:00
[EC-770] Implement MessagePack on Watch sync (#2264)
* EC-770 Started implementing MessagePack for the iPhone -> Watch communication * EC-770 Removed Pods and installed MessagePack through SPM * EC-770 Implemented MessagePack + Lzfse compression when syncing iPhone -> Watch * EC-770 Added MessagePack as submodule and updated the build to checkout the submodule as well. Also added MessagePack files as reference in the watch project * EC-770 Updated build Updated build.yml to checkout submodules on iOS
This commit is contained in:
committed by
GitHub
parent
a18f74a72a
commit
9f8307a4ff
@@ -1,11 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Bit.Core.Enums;
|
||||
using MessagePack;
|
||||
|
||||
namespace Bit.Core.Models.View
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class SimpleCipherView
|
||||
{
|
||||
public SimpleCipherView()
|
||||
{
|
||||
}
|
||||
|
||||
public SimpleCipherView(CipherView c)
|
||||
{
|
||||
Id = c.Id;
|
||||
@@ -22,26 +28,40 @@ namespace Bit.Core.Models.View
|
||||
}
|
||||
}
|
||||
|
||||
[Key(0)]
|
||||
public string Id { get; set; }
|
||||
[Key(1)]
|
||||
public string Name { get; set; }
|
||||
public CipherType Type { get; set; }
|
||||
[IgnoreMember]
|
||||
public CipherType Type { get; set; } // ignoring on serialization for now, given that all are going to be of type Login
|
||||
[Key(2)]
|
||||
public SimpleLoginView Login { get; set; }
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class SimpleLoginView
|
||||
{
|
||||
[Key(0)]
|
||||
public string Username { get; set; }
|
||||
[Key(1)]
|
||||
public string Totp { get; set; }
|
||||
[Key(2)]
|
||||
public List<SimpleLoginUriView> Uris { get; set; }
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class SimpleLoginUriView
|
||||
{
|
||||
public SimpleLoginUriView()
|
||||
{
|
||||
}
|
||||
|
||||
public SimpleLoginUriView(string uri)
|
||||
{
|
||||
Uri = uri;
|
||||
}
|
||||
|
||||
[Key(0)]
|
||||
public string Uri { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,56 @@
|
||||
using System.Collections.Generic;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.View;
|
||||
using MessagePack;
|
||||
|
||||
namespace Bit.Core.Models
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class WatchDTO
|
||||
{
|
||||
public WatchDTO()
|
||||
{
|
||||
}
|
||||
|
||||
public WatchDTO(WatchState state)
|
||||
{
|
||||
State = state;
|
||||
}
|
||||
|
||||
[Key(0)]
|
||||
public WatchState State { get; private set; }
|
||||
|
||||
[Key(1)]
|
||||
public List<SimpleCipherView> Ciphers { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public UserDataDto UserData { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public EnvironmentUrlDataDto EnvironmentData { get; set; }
|
||||
|
||||
//public SettingsDataDto SettingsData { get; set; }
|
||||
|
||||
[MessagePackObject]
|
||||
public class UserDataDto
|
||||
{
|
||||
[Key(0)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[Key(1)]
|
||||
public string Email { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class EnvironmentUrlDataDto
|
||||
{
|
||||
[Key(0)]
|
||||
public string Base { get; set; }
|
||||
|
||||
[Key(1)]
|
||||
public string Icons { get; set; }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user