mirror of
https://github.com/bitwarden/mobile
synced 2025-12-22 03:03:46 +00:00
reset for v2
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Bit.iOS.Core.Models
|
||||
{
|
||||
public class AppExtensionContext
|
||||
{
|
||||
private string _uriString;
|
||||
|
||||
public Uri Uri
|
||||
{
|
||||
get
|
||||
{
|
||||
Uri uri;
|
||||
if(string.IsNullOrWhiteSpace(UrlString) || !Uri.TryCreate(UrlString, UriKind.Absolute, out uri))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
public string UrlString
|
||||
{
|
||||
get
|
||||
{
|
||||
return _uriString;
|
||||
}
|
||||
set
|
||||
{
|
||||
_uriString = value;
|
||||
if(string.IsNullOrWhiteSpace(_uriString))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(!_uriString.StartsWith(App.Constants.iOSAppProtocol) && _uriString.Contains("."))
|
||||
{
|
||||
if(!_uriString.Contains("://") && !_uriString.Contains(" "))
|
||||
{
|
||||
_uriString = string.Concat("http://", _uriString);
|
||||
}
|
||||
}
|
||||
|
||||
if(!_uriString.StartsWith("http") && !_uriString.StartsWith(App.Constants.iOSAppProtocol))
|
||||
{
|
||||
_uriString = string.Concat(App.Constants.iOSAppProtocol, _uriString);
|
||||
}
|
||||
}
|
||||
}
|
||||
public PasswordGenerationOptions PasswordOptions { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using Bit.App.Enums;
|
||||
using Bit.App.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Bit.iOS.Core.Models
|
||||
{
|
||||
public class CipherViewModel
|
||||
{
|
||||
public CipherViewModel(Cipher cipher)
|
||||
{
|
||||
Id = cipher.Id;
|
||||
Name = cipher.Name?.Decrypt(cipher.OrganizationId);
|
||||
Username = cipher.Login?.Username?.Decrypt(cipher.OrganizationId);
|
||||
Password = cipher.Login?.Password?.Decrypt(cipher.OrganizationId);
|
||||
Uris = cipher.Login?.Uris?.Select(u => new LoginUriModel(u, cipher.OrganizationId));
|
||||
Totp = new Lazy<string>(() => cipher.Login?.Totp?.Decrypt(cipher.OrganizationId));
|
||||
Fields = new Lazy<List<Tuple<string, string>>>(() =>
|
||||
{
|
||||
if(!cipher.Fields?.Any() ?? true)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var fields = new List<Tuple<string, string>>();
|
||||
foreach(var field in cipher.Fields)
|
||||
{
|
||||
fields.Add(new Tuple<string, string>(
|
||||
field.Name?.Decrypt(cipher.OrganizationId),
|
||||
field.Value?.Decrypt(cipher.OrganizationId)));
|
||||
}
|
||||
return fields;
|
||||
});
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public IEnumerable<LoginUriModel> Uris { get; set; }
|
||||
public Lazy<string> Totp { get; set; }
|
||||
public Lazy<List<Tuple<string, string>>> Fields { get; set; }
|
||||
|
||||
public class LoginUriModel
|
||||
{
|
||||
public LoginUriModel(LoginUri data, string orgId)
|
||||
{
|
||||
Uri = data?.Uri?.Decrypt(orgId);
|
||||
Match = data?.Match;
|
||||
}
|
||||
|
||||
public string Uri { get; set; }
|
||||
public UriMatchType? Match { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Bit.iOS.Core.Models
|
||||
{
|
||||
public class PasswordGenerationOptions
|
||||
{
|
||||
public int MinLength { get; set; }
|
||||
public int MaxLength { get; set; }
|
||||
public bool RequireDigits { get; set; }
|
||||
public bool RequireSymbols { get; set; }
|
||||
public string ForbiddenCharacters { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user