mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 07:05:35 +03:00
Refactor PublicKeyCredentialCreationOptions to match WebAuthn spec (#3443)
This commit is contained in:
parent
9205dbef59
commit
b2300328e1
1 changed files with 30 additions and 3 deletions
|
@ -30,7 +30,9 @@ data class PublicKeyCredentialCreationOptions(
|
|||
@SerialName("authenticatorAttachment")
|
||||
val authenticatorAttachment: AuthenticatorAttachment? = null,
|
||||
@SerialName("residentKey")
|
||||
val residentKey: ResidentKeyRequirement? = null,
|
||||
val residentKeyRequirement: ResidentKeyRequirement? = null,
|
||||
@SerialName("userVerification")
|
||||
val userVerification: UserVerificationRequirement? = null,
|
||||
) {
|
||||
/**
|
||||
* Enum class representing the types of attachments associated with selection criteria.
|
||||
|
@ -50,13 +52,38 @@ data class PublicKeyCredentialCreationOptions(
|
|||
@Serializable
|
||||
enum class ResidentKeyRequirement {
|
||||
/**
|
||||
* User verification is preferred during selection, if supported.
|
||||
* Resident keys are preferred during selection, if supported.
|
||||
*/
|
||||
@SerialName("preferred")
|
||||
PREFERRED,
|
||||
|
||||
/**
|
||||
* User verification is required during selection.
|
||||
* Resident keys are required during selection.
|
||||
*/
|
||||
@SerialName("required")
|
||||
REQUIRED,
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum class indicating the type of user verification requested by the relying party.
|
||||
*/
|
||||
@Serializable
|
||||
enum class UserVerificationRequirement {
|
||||
/**
|
||||
* User verification should not be performed.
|
||||
*/
|
||||
@SerialName("discouraged")
|
||||
DISCOURAGED,
|
||||
|
||||
/**
|
||||
* User verification is preferred, if supported by the device or application.
|
||||
*/
|
||||
@SerialName("preferred")
|
||||
PREFERRED,
|
||||
|
||||
/**
|
||||
* User verification is required. If is cannot be performed the registration process
|
||||
* should be terminated.
|
||||
*/
|
||||
@SerialName("required")
|
||||
REQUIRED,
|
||||
|
|
Loading…
Reference in a new issue