Skip to content

Commit faca7a0

Browse files
Adjust CTAP transport casing
1 parent 02436bb commit faca7a0

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
use minicbor::{Decode, Encode};
2+
3+
/// Credential protection policy as defined in the CTAP2 spec.
4+
///
5+
/// This replaces the ctap_types::ctap2::credential_management::CredentialProtectionPolicy
6+
/// to avoid external dependency.
7+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Encode, Decode)]
8+
#[cbor(index_only)]
9+
pub enum CredentialProtectionPolicy {
10+
#[n(1)]
11+
UserVerificationOptional = 0x01,
12+
#[n(2)]
13+
UserVerificationOptionalWithCredentialIdList = 0x02,
14+
#[n(3)]
15+
UserVerificationRequired = 0x03,
16+
}
17+
18+
impl Default for CredentialProtectionPolicy {
19+
fn default() -> Self {
20+
Self::UserVerificationOptional
21+
}
22+
}

0 commit comments

Comments
 (0)