mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
WIP Split composite key user control
Some refactoring
This commit is contained in:
@@ -19,7 +19,7 @@ namespace ModernKeePass.Infrastructure
|
||||
{
|
||||
services.AddSingleton(typeof(IDatabaseProxy), typeof(KeePassDatabaseClient));
|
||||
services.AddTransient(typeof(ICryptographyClient), typeof(KeePassCryptographyClient));
|
||||
services.AddTransient(typeof(IPasswordProxy), typeof(KeePassPasswordClient));
|
||||
services.AddTransient(typeof(ICredentialsProxy), typeof(KeePassCredentialsClient));
|
||||
return services;
|
||||
}
|
||||
|
||||
|
@@ -85,7 +85,7 @@
|
||||
<Compile Include="KeePass\IconMapper.cs" />
|
||||
<Compile Include="KeePass\KeePassCryptographyClient.cs" />
|
||||
<Compile Include="KeePass\KeePassDatabaseClient.cs" />
|
||||
<Compile Include="KeePass\KeePassPasswordClient.cs" />
|
||||
<Compile Include="KeePass\KeePassCredentialsClient.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UWP\StorageFileClient.cs" />
|
||||
<Compile Include="UWP\UwpRecentFilesClient.cs" />
|
||||
|
@@ -10,7 +10,6 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
{
|
||||
public EntryMappingProfile()
|
||||
{
|
||||
Uri url;
|
||||
CreateMap<PwEntry, EntryEntity>()
|
||||
.ForMember(dest => dest.ParentId, opt => opt.MapFrom(src => src.ParentGroup.Uuid.ToHexString()))
|
||||
.ForMember(dest => dest.ParentName, opt => opt.MapFrom(src => src.ParentGroup.Name))
|
||||
@@ -18,12 +17,7 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => GetEntryValue(src, PwDefs.TitleField)))
|
||||
.ForMember(dest => dest.UserName, opt => opt.MapFrom(src => GetEntryValue(src, PwDefs.UserNameField)))
|
||||
.ForMember(dest => dest.Password, opt => opt.MapFrom(src => GetEntryValue(src, PwDefs.PasswordField)))
|
||||
.ForMember(dest => dest.Url, opt =>
|
||||
{
|
||||
opt.PreCondition(src =>
|
||||
Uri.TryCreate(GetEntryValue(src, PwDefs.UrlField), UriKind.Absolute, out url));
|
||||
opt.MapFrom(src => new Uri(GetEntryValue(src, PwDefs.UrlField)));
|
||||
})
|
||||
.ForMember(dest => dest.Url, opt => opt.MapFrom(src => GetEntryValue(src, PwDefs.UrlField)))
|
||||
.ForMember(dest => dest.Notes, opt => opt.MapFrom(src => GetEntryValue(src, PwDefs.NotesField)))
|
||||
.ForMember(dest => dest.ForegroundColor, opt => opt.MapFrom(src => src.ForegroundColor))
|
||||
.ForMember(dest => dest.BackgroundColor, opt => opt.MapFrom(src => src.BackgroundColor))
|
||||
|
@@ -7,7 +7,7 @@ using ModernKeePassLib.Security;
|
||||
|
||||
namespace ModernKeePass.Infrastructure.KeePass
|
||||
{
|
||||
public class KeePassPasswordClient: IPasswordProxy
|
||||
public class KeePassCredentialsClient: ICredentialsProxy
|
||||
{
|
||||
public string GeneratePassword(PasswordGenerationOptions options)
|
||||
{
|
||||
@@ -35,9 +35,9 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
return password.ReadString();
|
||||
}
|
||||
|
||||
public uint EstimatePasswordComplexity(string password)
|
||||
public int EstimatePasswordComplexity(string password)
|
||||
{
|
||||
return QualityEstimation.EstimatePasswordBits(password?.ToCharArray());
|
||||
return (int)QualityEstimation.EstimatePasswordBits(password?.ToCharArray());
|
||||
}
|
||||
|
||||
public byte[] GenerateKeyFile(byte[] additionalEntropy)
|
Reference in New Issue
Block a user