mirror of
https://github.com/bitwarden/mobile
synced 2026-01-09 03:53:15 +00:00
initial commit
This commit is contained in:
9
src/App/Abstractions/IDataObject.cs
Normal file
9
src/App/Abstractions/IDataObject.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IDataObject<T> where T : IEquatable<T>
|
||||
{
|
||||
T Id { get; }
|
||||
}
|
||||
}
|
||||
13
src/App/Abstractions/Services/IApiService.cs
Normal file
13
src/App/Abstractions/Services/IApiService.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models.Api;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IApiService
|
||||
{
|
||||
HttpClient Client { get; set; }
|
||||
|
||||
Task<ApiResult<T>> HandleErrorAsync<T>(HttpResponseMessage response);
|
||||
}
|
||||
}
|
||||
13
src/App/Abstractions/Services/IAuthService.cs
Normal file
13
src/App/Abstractions/Services/IAuthService.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models.Api;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IAuthService
|
||||
{
|
||||
bool IsAuthenticated { get; }
|
||||
string Token { get; set; }
|
||||
|
||||
Task<ApiResult<TokenResponse>> TokenPostAsync(TokenRequest request);
|
||||
}
|
||||
}
|
||||
17
src/App/Abstractions/Services/ICryptoService.cs
Normal file
17
src/App/Abstractions/Services/ICryptoService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Bit.App.Models;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ICryptoService
|
||||
{
|
||||
string Base64Key { get; }
|
||||
byte[] Key { get; set; }
|
||||
|
||||
string Decrypt(CipherString encyptedValue);
|
||||
CipherString Encrypt(string plaintextValue);
|
||||
byte[] MakeKeyFromPassword(string password, string salt);
|
||||
string MakeKeyFromPasswordBase64(string password, string salt);
|
||||
byte[] HashPassword(byte[] key, string password);
|
||||
string HashPasswordBase64(byte[] key, string password);
|
||||
}
|
||||
}
|
||||
7
src/App/Abstractions/Services/IDatabaseService.cs
Normal file
7
src/App/Abstractions/Services/IDatabaseService.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IDatabaseService
|
||||
{
|
||||
void CreateTables();
|
||||
}
|
||||
}
|
||||
12
src/App/Abstractions/Services/IFolderService.cs
Normal file
12
src/App/Abstractions/Services/IFolderService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IFolderService
|
||||
{
|
||||
Task<IEnumerable<Folder>> GetAllAsync();
|
||||
Task SaveAsync(Folder folder);
|
||||
}
|
||||
}
|
||||
10
src/App/Abstractions/Services/ISecureStorageService.cs
Normal file
10
src/App/Abstractions/Services/ISecureStorageService.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ISecureStorageService
|
||||
{
|
||||
void Store(string key, byte[] dataBytes);
|
||||
byte[] Retrieve(string key);
|
||||
void Delete(string key);
|
||||
bool Contains(string key);
|
||||
}
|
||||
}
|
||||
12
src/App/Abstractions/Services/ISiteService.cs
Normal file
12
src/App/Abstractions/Services/ISiteService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ISiteService
|
||||
{
|
||||
Task<IEnumerable<Site>> GetAllAsync();
|
||||
Task SaveAsync(Site site);
|
||||
}
|
||||
}
|
||||
9
src/App/Abstractions/Services/ISqlService.cs
Normal file
9
src/App/Abstractions/Services/ISqlService.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using SQLite;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ISqlService
|
||||
{
|
||||
SQLiteConnection GetConnection();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user