diff options
author | Sarah Brofeldt <sarah@qtr.dk> | 2021-05-31 19:50:39 +0200 |
---|---|---|
committer | Sarah Brofeldt <sarah@qtr.dk> | 2021-05-31 19:59:55 +0200 |
commit | e2389e9bc84f99204f164c617b42e63578e00831 (patch) | |
tree | 942397c891f13edc603d7eb510d6be3ad8238104 | |
parent | ecbafabaf56a32f494cf52a857247624dfef5228 (diff) | |
download | rbw-e2389e9bc84f99204f164c617b42e63578e00831.tar.gz rbw-e2389e9bc84f99204f164c617b42e63578e00831.zip |
TwoFactorProviderType: Allow WebAuthn
Only allows deserialization for the new provider. See
https://github.com/bitwarden/server/pull/903
-rw-r--r-- | src/api.rs | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -48,6 +48,7 @@ pub enum TwoFactorProviderType { U2f = 4, Remember = 5, OrganizationDuo = 6, + WebAuthn = 7, } impl<'de> serde::Deserialize<'de> for TwoFactorProviderType { @@ -104,6 +105,7 @@ impl std::convert::TryFrom<u64> for TwoFactorProviderType { 4 => Ok(Self::U2f), 5 => Ok(Self::Remember), 6 => Ok(Self::OrganizationDuo), + 7 => Ok(Self::WebAuthn), _ => Err(Error::InvalidTwoFactorProvider { ty: format!("{}", ty), }), @@ -123,6 +125,7 @@ impl std::str::FromStr for TwoFactorProviderType { "4" => Ok(Self::U2f), "5" => Ok(Self::Remember), "6" => Ok(Self::OrganizationDuo), + "7" => Ok(Self::WebAuthn), _ => Err(Error::InvalidTwoFactorProvider { ty: ty.to_string() }), } } |