using Bit.Core.Utilities.Fido2;
namespace Bit.Core.Abstractions
{
///
/// Parameters used to ask the user to pick a credential from a list of existing credentials.
///
public struct Fido2PickCredentialParams
{
///
/// The IDs of the credentials that the user can pick from.
///
public string[] CipherIds { get; set; }
///
/// Whether or not the user must be verified before completing the operation.
///
public bool UserVerification { get; set; }
}
///
/// The result of asking the user to pick a credential from a list of existing credentials.
///
public struct Fido2PickCredentialResult
{
///
/// The ID of the cipher that contains the credentials the user picked.
///
public string CipherId { get; set; }
///
/// Whether or not the user was verified before completing the operation.
///
public bool UserVerified { get; set; }
}
public struct Fido2ConfirmNewCredentialParams
{
///
/// The name of the credential.
///
public string CredentialName { get; set; }
///
/// The name of the user.
///
public string UserName { get; set; }
///
/// Whether or not the user must be verified before completing the operation.
///
public bool UserVerification { get; set; }
}
public struct Fido2ConfirmNewCredentialResult
{
///
/// The name of the user.
///
public string CipherId { get; set; }
///
/// Whether or not the user was verified.
///
public bool UserVerified { get; set; }
}
public interface IFido2UserInterface
{
///
/// Ask the user to pick a credential from a list of existing credentials.
///
/// The parameters to use when asking the user to pick a credential.
/// The ID of the cipher that contains the credentials the user picked.
Task PickCredentialAsync(Fido2PickCredentialParams pickCredentialParams);
///
/// Inform the user that the operation was cancelled because their vault contains excluded credentials.
///
/// The IDs of the excluded credentials.
/// When user has confirmed the message
Task InformExcludedCredential(string[] existingCipherIds);
///
/// Ask the user to confirm the creation of a new credential.
///
/// The parameters to use when asking the user to confirm the creation of a new credential.
/// The ID of the cipher where the new credential should be saved.
Task ConfirmNewCredentialAsync(Fido2ConfirmNewCredentialParams confirmNewCredentialParams);
}
}