1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-29 06:33:53 +00:00

reset for v2

This commit is contained in:
Kyle Spearrin
2019-03-27 16:23:00 -04:00
parent 5a7f106e3e
commit 297beac169
1180 changed files with 0 additions and 126197 deletions

View File

@@ -1,9 +0,0 @@
using System;
namespace Bit.App.Abstractions
{
public interface IDataObject<T> where T : IEquatable<T>
{
T Id { get; }
}
}

View File

@@ -1,8 +0,0 @@
namespace Bit.App.Abstractions
{
public interface ITreeNodeObject
{
string Id { get; set; }
string Name { get; set; }
}
}

View File

@@ -1,15 +0,0 @@
using System.Threading.Tasks;
using Bit.App.Models.Api;
using System;
namespace Bit.App.Abstractions
{
public interface IAccountsApiRepository
{
Task<ApiResult<PreloginResponse>> PostPreloginAsync(PreloginRequest requestObj);
Task<ApiResult> PostRegisterAsync(RegisterRequest requestObj);
Task<ApiResult> PostPasswordHintAsync(PasswordHintRequest requestObj);
Task<ApiResult<DateTime?>> GetAccountRevisionDateAsync();
Task<ApiResult<ProfileResponse>> GetProfileAsync();
}
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models.Api;
namespace Bit.App.Abstractions
{
public interface IApiRepository<TRequest, TResponse, TId>
where TRequest : class
where TResponse : class
where TId : IEquatable<TId>
{
Task<ApiResult<TResponse>> GetByIdAsync(TId id);
Task<ApiResult<ListResponse<TResponse>>> GetAsync();
Task<ApiResult<TResponse>> PostAsync(TRequest requestObj);
Task<ApiResult<TResponse>> PutAsync(TId id, TRequest requestObj);
Task<ApiResult> DeleteAsync(TId id);
}
}

View File

@@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models.Data;
namespace Bit.App.Abstractions
{
public interface IAttachmentRepository : IRepository<AttachmentData, string>
{
Task<IEnumerable<AttachmentData>> GetAllByCipherIdAsync(string cipherId);
Task<IEnumerable<AttachmentData>> GetAllByUserIdAsync(string userId);
}
}

View File

@@ -1,12 +0,0 @@
using System;
using System.Threading.Tasks;
using Bit.App.Models.Api;
namespace Bit.App.Abstractions
{
public interface ICipherApiRepository : IApiRepository<CipherRequest, CipherResponse, string>
{
Task<ApiResult<CipherResponse>> PostAttachmentAsync(string cipherId, byte[] data, string key, string fileName);
Task<ApiResult> DeleteAttachmentAsync(string cipherId, string attachmentId);
}
}

View File

@@ -1,15 +0,0 @@
using System.Threading.Tasks;
using Bit.App.Models.Data;
using System.Collections.Generic;
namespace Bit.App.Abstractions
{
public interface ICipherCollectionRepository
{
Task<IEnumerable<CipherCollectionData>> GetAllByUserIdAsync(string userId);
Task<IEnumerable<CipherCollectionData>> GetAllByUserIdCollectionAsync(string userId, string collectionId);
Task InsertAsync(CipherCollectionData obj);
Task DeleteAsync(CipherCollectionData obj);
Task DeleteByUserIdAsync(string userId);
}
}

View File

@@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models.Data;
namespace Bit.App.Abstractions
{
public interface ICipherRepository : IRepository<CipherData, string>
{
Task<IEnumerable<CipherData>> GetAllByUserIdAsync(string userId);
Task<IEnumerable<CipherData>> GetAllByUserIdAsync(string userId, bool favorite);
}
}

View File

@@ -1,11 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models.Data;
namespace Bit.App.Abstractions
{
public interface ICollectionRepository : IRepository<CollectionData, string>
{
Task<IEnumerable<CollectionData>> GetAllByUserIdAsync(string userId);
}
}

View File

@@ -1,10 +0,0 @@
using System.Threading.Tasks;
using Bit.App.Models.Api;
namespace Bit.App.Abstractions
{
public interface IConnectApiRepository
{
Task<ApiResult<TokenResponse>> PostTokenAsync(TokenRequest requestObj);
}
}

View File

@@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models.Api;
using Bit.App.Repositories;
namespace Bit.App.Abstractions
{
public interface IDeviceApiRepository : IApiRepository<DeviceRequest, DeviceResponse, string>
{
Task<ApiResult> PutTokenAsync(string identifier, DeviceTokenRequest request);
Task<ApiResult> PutClearTokenAsync(string identifier);
}
}

View File

@@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models.Api;
namespace Bit.App.Abstractions
{
public interface IFolderApiRepository : IApiRepository<FolderRequest, FolderResponse, string>
{ }
}

View File

@@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models.Data;
namespace Bit.App.Abstractions
{
public interface IFolderRepository : IRepository<FolderData, string>
{
Task<IEnumerable<FolderData>> GetAllByUserIdAsync(string userId);
Task DeleteWithCipherUpdateAsync(string id, DateTime revisionDate);
}
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Bit.App.Abstractions
{
public interface IRepository<T, TId>
where T : class, IDataObject<TId>, new()
where TId : IEquatable<TId>
{
Task<T> GetByIdAsync(TId id);
Task<IEnumerable<T>> GetAllAsync();
Task UpdateAsync(T obj);
Task InsertAsync(T obj);
Task UpsertAsync(T obj);
Task DeleteAsync(TId id);
Task DeleteAsync(T obj);
}
}

View File

@@ -1,10 +0,0 @@
using System.Threading.Tasks;
using Bit.App.Models.Api;
namespace Bit.App.Abstractions
{
public interface ISettingsApiRepository
{
Task<ApiResult<DomainsResponse>> GetDomains(bool excluded = false);
}
}

View File

@@ -1,8 +0,0 @@
using Bit.App.Models.Data;
namespace Bit.App.Abstractions
{
public interface ISettingsRepository : IRepository<SettingsData, string>
{
}
}

View File

@@ -1,10 +0,0 @@
using System.Threading.Tasks;
using Bit.App.Models.Api;
namespace Bit.App.Abstractions
{
public interface ISyncApiRepository
{
Task<ApiResult<SyncResponse>> Get();
}
}

View File

@@ -1,10 +0,0 @@
using System.Threading.Tasks;
using Bit.App.Models.Api;
namespace Bit.App.Abstractions
{
public interface ITwoFactorApiRepository
{
Task<ApiResult> PostSendEmailLoginAsync(TwoFactorEmailRequest requestObj);
}
}

View File

@@ -1,8 +0,0 @@
namespace Bit.App.Abstractions
{
public interface IAppIdService
{
string AppId { get; }
string AnonymousAppId { get; }
}
}

View File

@@ -1,10 +0,0 @@
namespace Bit.App.Abstractions
{
public interface IAppInfoService
{
string Build { get; }
string Version { get; }
bool AutofillAccessibilityServiceEnabled { get; }
bool AutofillServiceEnabled { get; }
}
}

View File

@@ -1,24 +0,0 @@
using System;
namespace Bit.App.Abstractions
{
public interface IAppSettingsService
{
bool Locked { get; set; }
int FailedPinAttempts { get; set; }
DateTime LastActivity { get; set; }
DateTime LastCacheClear { get; set; }
bool AutofillPersistNotification { get; set; }
bool AutofillPasswordField { get; set; }
bool DisableWebsiteIcons { get; set; }
string SecurityStamp { get; set; }
string BaseUrl { get; set; }
string WebVaultUrl { get; set; }
string ApiUrl { get; set; }
string IdentityUrl { get; set; }
string IconsUrl { get; set; }
bool ClearCiphersCache { get; set; }
bool ClearExtensionCiphersCache { get; set; }
bool OrganizationGivesPremium { get; set; }
}
}

View File

@@ -1,23 +0,0 @@
using Bit.App.Enums;
using Bit.App.Models;
using System.Threading.Tasks;
namespace Bit.App.Abstractions
{
public interface IAuthService
{
bool IsAuthenticated { get; }
string UserId { get; set; }
string PreviousUserId { get; }
bool UserIdChanged { get; }
string Email { get; set; }
KdfType Kdf { get; set; }
int KdfIterations { get; set; }
string PIN { get; set; }
bool BelongsToOrganization(string orgId);
void LogOut(string logoutMessage = null);
Task<FullLoginResult> TokenPostAsync(string email, string masterPassword);
Task<LoginResult> TokenPostTwoFactorAsync(TwoFactorProviderType type, string token, bool remember, string email,
string masterPasswordHash, SymmetricCryptoKey key);
}
}

View File

@@ -1,28 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models;
using Bit.App.Models.Api;
using System;
using Bit.App.Models.Data;
namespace Bit.App.Abstractions
{
public interface ICipherService
{
Task<Cipher> GetByIdAsync(string id);
Task<IEnumerable<Cipher>> GetAllAsync();
Task<IEnumerable<Cipher>> GetAllAsync(bool favorites);
Task<IEnumerable<Cipher>> GetAllByFolderAsync(string folderId);
Task<IEnumerable<Cipher>> GetAllByCollectionAsync(string collectionId);
Task<Tuple<IEnumerable<Cipher>, IEnumerable<Cipher>, IEnumerable<Cipher>>> GetAllAsync(string uriString);
Task<ApiResult<CipherResponse>> SaveAsync(Cipher cipher);
Task UpsertDataAsync(CipherData cipher, bool sendMessage, bool created);
Task<ApiResult> DeleteAsync(string id);
Task DeleteDataAsync(string id, bool sendMessage);
Task<byte[]> DownloadAndDecryptAttachmentAsync(string url, CipherString key, string orgId = null);
Task<ApiResult<CipherResponse>> EncryptAndSaveAttachmentAsync(Cipher cipher, byte[] data, string fileName);
Task UpsertAttachmentDataAsync(IEnumerable<AttachmentData> attachments);
Task<ApiResult> DeleteAttachmentAsync(Cipher cipher, string attachmentId);
Task DeleteAttachmentDataAsync(string attachmentId);
}
}

View File

@@ -1,14 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models;
using System;
namespace Bit.App.Abstractions
{
public interface ICollectionService
{
Task<Collection> GetByIdAsync(string id);
Task<IEnumerable<Collection>> GetAllAsync();
Task<IEnumerable<Tuple<string, string>>> GetAllCipherAssociationsAsync();
}
}

View File

@@ -1,32 +0,0 @@
using Bit.App.Enums;
using Bit.App.Models;
using Bit.App.Models.Api;
using System;
using System.Collections.Generic;
namespace Bit.App.Abstractions
{
public interface ICryptoService
{
SymmetricCryptoKey Key { get; set; }
SymmetricCryptoKey EncKey { get; }
byte[] PrivateKey { get; }
IDictionary<string, SymmetricCryptoKey> OrgKeys { get; }
void SetEncKey(CipherString encKeyEnc);
void SetPrivateKey(CipherString privateKeyEnc);
void SetOrgKeys(ProfileResponse profile);
void SetOrgKeys(Dictionary<string, string> orgKeysEncDict);
SymmetricCryptoKey GetOrgKey(string orgId);
void ClearKeys();
string Decrypt(CipherString encyptedValue, SymmetricCryptoKey key = null);
byte[] DecryptToBytes(CipherString encyptedValue, SymmetricCryptoKey key = null);
byte[] DecryptToBytes(byte[] encyptedValue, SymmetricCryptoKey key = null);
byte[] RsaDecryptToBytes(CipherString encyptedValue, byte[] privateKey);
CipherString Encrypt(string plaintextValue, SymmetricCryptoKey key = null);
byte[] EncryptToBytes(byte[] plainBytes, SymmetricCryptoKey key = null);
SymmetricCryptoKey MakeKeyFromPassword(string password, string salt, KdfType kdf, int kdfIterations);
byte[] HashPassword(SymmetricCryptoKey key, string password);
string HashPasswordBase64(SymmetricCryptoKey key, string password);
Tuple<SymmetricCryptoKey, CipherString> MakeEncKey(SymmetricCryptoKey key);
}
}

View File

@@ -1,7 +0,0 @@
namespace Bit.App.Abstractions
{
public interface IDatabaseService
{
void CreateTables();
}
}

View File

@@ -1,28 +0,0 @@
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Bit.App.Abstractions
{
public interface IDeviceActionService
{
Task ShowLoadingAsync(string text);
Task HideLoadingAsync();
void Toast(string text, bool longDuration = false);
void CopyToClipboard(string text);
bool OpenFile(byte[] fileData, string id, string fileName);
bool CanOpenFile(string fileName);
Task SelectFileAsync();
void ClearCache();
void Autofill(Models.Page.VaultListPageModel.Cipher cipher);
void CloseAutofill();
void Background();
void RateApp();
void DismissKeyboard();
void OpenAccessibilitySettings();
void OpenAutofillSettings();
Task LaunchAppAsync(string appName, Page page);
Task<string> DisplayPromptAync(string title = null, string description = null, string text = null);
Task<string> DisplayAlertAsync(string title, string message, string cancel, params string[] buttons);
}
}

View File

@@ -1,15 +0,0 @@
namespace Bit.App.Abstractions
{
public interface IDeviceInfoService
{
string Type { get; }
string Model { get; }
int Version { get; }
float Scale { get; }
bool NfcEnabled { get; }
bool HasCamera { get; }
bool AutofillServiceSupported { get; }
bool HasFaceIdSupport { get; }
bool IsExtension { get; }
}
}

View File

@@ -1,15 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Models;
using Bit.App.Models.Api;
namespace Bit.App.Abstractions
{
public interface IFolderService
{
Task<Folder> GetByIdAsync(string id);
Task<IEnumerable<Folder>> GetAllAsync();
Task<ApiResult<FolderResponse>> SaveAsync(Folder folder);
Task<ApiResult> DeleteAsync(string folderId);
}
}

View File

@@ -1,16 +0,0 @@
using System;
namespace Bit.App.Abstractions
{
public interface IGoogleAnalyticsService
{
void TrackPage(string pageName);
void TrackAppEvent(string eventName, string label = null);
void TrackExtensionEvent(string eventName, string label = null);
void TrackAutofillExtensionEvent(string eventName, string label = null);
void TrackEvent(string category, string eventName, string label = null);
void TrackException(string message, bool fatal);
void Dispatch(Action completionHandler = null);
void SetAppOptOut(bool optOut);
}
}

View File

@@ -1,8 +0,0 @@
namespace Bit.App.Abstractions
{
public interface IHttpService
{
ApiHttpClient ApiClient { get; }
IdentityHttpClient IdentityClient { get; }
}
}

View File

@@ -1,7 +0,0 @@
namespace Bit.App.Abstractions
{
public interface IKeyDerivationService
{
byte[] DeriveKey(byte[] password, byte[] salt, uint rounds);
}
}

View File

@@ -1,31 +0,0 @@
using System;
using System.Globalization;
namespace Bit.App.Abstractions
{
/// <summary>
/// Implementations of this interface MUST convert iOS and Android
/// platform-specific locales to a value supported in .NET because
/// ONLY valid .NET cultures can have their RESX resources loaded and used.
/// </summary>
/// <remarks>
/// Lists of valid .NET cultures can be found here:
/// http://www.localeplanet.com/dotnet/
/// http://www.csharp-examples.net/culture-names/
/// You should always test all the locales implemented in your application.
/// </remarks>
public interface ILocalizeService
{
/// <summary>
/// This method must evaluate platform-specific locale settings
/// and convert them (when necessary) to a valid .NET locale.
/// </summary>
CultureInfo GetCurrentCultureInfo();
/// <summary>
/// CurrentCulture and CurrentUICulture must be set in the platform project,
/// because the Thread object can't be accessed in a PCL.
/// </summary>
void SetLocale(CultureInfo ci);
}
}

View File

@@ -1,14 +0,0 @@
using Bit.App.Enums;
using System;
using System.Threading.Tasks;
namespace Bit.App.Abstractions
{
public interface ILockService
{
void UpdateLastActivity();
Task<LockType> GetLockTypeAsync(bool forceLock, bool onlyIfAlreadyLocked = false);
Task CheckLockAsync(bool forceLock, bool onlyIfAlreadyLocked = false);
bool TopPageIsLock();
}
}

View File

@@ -1,7 +0,0 @@
namespace Bit.App.Abstractions
{
public interface ILogService
{
void WriteLine(string message);
}
}

View File

@@ -1,17 +0,0 @@
namespace Bit.App.Abstractions
{
public interface IPasswordGenerationService
{
string GeneratePassword(
int? length = null,
bool? uppercase = null,
bool? lowercase = null,
bool? numbers = null,
bool? special = null,
bool? ambiguous = null,
int? minUppercase = null,
int? minLowercase = null,
int? minNumbers = null,
int? minSpecial = null);
}
}

View File

@@ -1,9 +0,0 @@
namespace Bit.App.Abstractions
{
public interface IPushNotificationService
{
string Token { get; }
void Register();
void Unregister();
}
}

View File

@@ -1,13 +0,0 @@
using Newtonsoft.Json.Linq;
namespace Bit.App.Abstractions
{
public interface IPushNotificationListener
{
void OnMessage(JObject values, string device);
void OnRegistered(string token, string device);
void OnUnregistered(string device);
void OnError(string message, string device);
bool ShouldShowNotification();
}
}

View File

@@ -1,10 +0,0 @@
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);
}
}

View File

@@ -1,10 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Bit.App.Abstractions
{
public interface ISettingsService
{
Task<IEnumerable<IEnumerable<string>>> GetEquivalentDomainsAsync();
}
}

View File

@@ -1,9 +0,0 @@
using SQLite;
namespace Bit.App.Abstractions
{
public interface ISqlService
{
SQLiteConnection GetConnection();
}
}

View File

@@ -1,18 +0,0 @@
using System;
using System.Threading.Tasks;
namespace Bit.App.Abstractions
{
public interface ISyncService
{
bool SyncInProgress { get; }
Task<bool> SyncCipherAsync(string id);
Task<bool> SyncFolderAsync(string id);
Task<bool> SyncDeleteFolderAsync(string id, DateTime revisionDate);
Task<bool> SyncDeleteCipherAsync(string id);
Task<bool> SyncSettingsAsync();
Task<bool> SyncProfileAsync();
Task<bool> FullSyncAsync(bool forceSync = false);
Task<bool> FullSyncAsync(TimeSpan syncThreshold, bool forceSync = false);
}
}

View File

@@ -1,21 +0,0 @@
using System;
namespace Bit.App.Abstractions
{
public interface ITokenService
{
string Token { get; set; }
string RefreshToken { get; set; }
string GetTwoFactorToken(string email);
void SetTwoFactorToken(string email, string token);
DateTime TokenExpiration { get; }
string TokenIssuer { get; }
bool TokenExpired { get; }
TimeSpan TokenTimeRemaining { get; }
bool TokenNeedsRefresh { get; }
string TokenUserId { get; }
string TokenEmail { get; }
string TokenName { get; }
bool TokenPremium { get; }
}
}