2016-05-02 09:52:09 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2016-05-08 06:11:47 +03:00
|
|
|
|
using Bit.App.Resources;
|
2016-05-02 09:52:09 +03:00
|
|
|
|
|
2016-05-08 06:11:47 +03:00
|
|
|
|
namespace Bit.App.Models.Page
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
2016-05-08 06:11:47 +03:00
|
|
|
|
public class VaultListPageModel
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
2017-01-03 08:17:15 +03:00
|
|
|
|
public class Login
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
2017-01-03 08:17:15 +03:00
|
|
|
|
public Login(Models.Login login)
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
2017-01-03 08:17:15 +03:00
|
|
|
|
Id = login.Id;
|
2017-04-24 22:00:55 +03:00
|
|
|
|
Shared = !string.IsNullOrWhiteSpace(login.OrganizationId);
|
2017-01-03 08:17:15 +03:00
|
|
|
|
FolderId = login.FolderId;
|
2017-04-20 18:23:30 +03:00
|
|
|
|
Name = login.Name?.Decrypt(login.OrganizationId);
|
|
|
|
|
Username = login.Username?.Decrypt(login.OrganizationId) ?? " ";
|
|
|
|
|
Password = new Lazy<string>(() => login.Password?.Decrypt(login.OrganizationId));
|
|
|
|
|
Uri = new Lazy<string>(() => login.Uri?.Decrypt(login.OrganizationId));
|
2017-07-21 18:39:22 +03:00
|
|
|
|
Totp = new Lazy<string>(() => login.Totp?.Decrypt(login.OrganizationId));
|
2016-05-02 09:52:09 +03:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-03 09:08:50 +03:00
|
|
|
|
public string Id { get; set; }
|
2017-04-24 22:00:55 +03:00
|
|
|
|
public bool Shared { get; set; }
|
2016-05-04 02:49:49 +03:00
|
|
|
|
public string FolderId { get; set; }
|
2016-05-02 09:52:09 +03:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string Username { get; set; }
|
2016-07-07 05:59:13 +03:00
|
|
|
|
public Lazy<string> Password { get; set; }
|
|
|
|
|
public Lazy<string> Uri { get; set; }
|
2017-07-21 18:39:22 +03:00
|
|
|
|
public Lazy<string> Totp { get; set; }
|
2016-05-02 09:52:09 +03:00
|
|
|
|
}
|
|
|
|
|
|
2017-02-14 06:10:34 +03:00
|
|
|
|
public class AutofillLogin : Login
|
|
|
|
|
{
|
|
|
|
|
public AutofillLogin(Models.Login login, bool fuzzy = false)
|
|
|
|
|
: base(login)
|
|
|
|
|
{
|
|
|
|
|
Fuzzy = fuzzy;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Fuzzy { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-03 08:17:15 +03:00
|
|
|
|
public class Folder : List<Login>
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
2016-07-11 08:12:31 +03:00
|
|
|
|
public Folder(Models.Folder folder)
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
2016-07-11 08:12:31 +03:00
|
|
|
|
Id = folder.Id;
|
|
|
|
|
Name = folder.Name?.Decrypt();
|
2016-05-02 09:52:09 +03:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-03 08:17:15 +03:00
|
|
|
|
public Folder(List<Login> logins)
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
2017-01-03 08:17:15 +03:00
|
|
|
|
AddRange(logins);
|
2016-05-02 09:52:09 +03:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-03 09:08:50 +03:00
|
|
|
|
public string Id { get; set; }
|
2016-05-08 06:11:47 +03:00
|
|
|
|
public string Name { get; set; } = AppResources.FolderNone;
|
2016-05-02 09:52:09 +03:00
|
|
|
|
}
|
2017-02-14 03:12:02 +03:00
|
|
|
|
|
2017-02-14 06:10:34 +03:00
|
|
|
|
public class AutofillGrouping : List<AutofillLogin>
|
2017-02-14 03:12:02 +03:00
|
|
|
|
{
|
2017-02-14 06:10:34 +03:00
|
|
|
|
public AutofillGrouping(List<AutofillLogin> logins, string name)
|
2017-02-14 03:12:02 +03:00
|
|
|
|
{
|
|
|
|
|
AddRange(logins);
|
|
|
|
|
Name = name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
}
|
2016-05-02 09:52:09 +03:00
|
|
|
|
}
|
|
|
|
|
}
|