1#[derive(Debug, Clone)]
3pub struct AuthenticatorOptions {
4 pub rk: bool,
6
7 pub up: bool,
9
10 pub uv: Option<bool>,
12
13 pub plat: bool,
15
16 pub client_pin: Option<bool>,
20
21 pub pin_uv_auth_token: Option<bool>,
23
24 pub cred_mgmt: Option<bool>,
26
27 pub bio_enroll: Option<bool>,
29
30 pub large_blobs: Option<bool>,
32
33 pub ep: Option<bool>,
35
36 pub always_uv: Option<bool>,
38
39 pub make_cred_uv_not_required: Option<bool>,
45}
46
47impl Default for AuthenticatorOptions {
48 fn default() -> Self {
49 Self {
50 rk: true,
51 up: true,
52 uv: None,
53 plat: false,
54 client_pin: Some(true),
55 pin_uv_auth_token: Some(true),
56 cred_mgmt: None,
57 bio_enroll: None,
58 large_blobs: None,
59 ep: None,
60 always_uv: None,
61 make_cred_uv_not_required: None,
62 }
63 }
64}
65
66impl AuthenticatorOptions {
67 pub fn new() -> Self {
69 Self::default()
70 }
71
72 pub fn with_resident_keys(mut self, enabled: bool) -> Self {
74 self.rk = enabled;
75 self
76 }
77
78 pub fn with_user_presence(mut self, enabled: bool) -> Self {
80 self.up = enabled;
81 self
82 }
83
84 pub fn with_user_verification(mut self, state: Option<bool>) -> Self {
86 self.uv = state;
87 self
88 }
89
90 pub fn with_platform_device(mut self, is_platform: bool) -> Self {
92 self.plat = is_platform;
93 self
94 }
95
96 pub fn with_client_pin(mut self, state: Option<bool>) -> Self {
98 self.client_pin = state;
99 self
100 }
101
102 pub fn with_pin_uv_auth_token(mut self, state: Option<bool>) -> Self {
104 self.pin_uv_auth_token = state;
105 self
106 }
107
108 pub fn with_credential_management(mut self, state: Option<bool>) -> Self {
110 self.cred_mgmt = state;
111 self
112 }
113
114 pub fn with_biometric_enrollment(mut self, state: Option<bool>) -> Self {
116 self.bio_enroll = state;
117 self
118 }
119
120 pub fn with_large_blobs(mut self, state: Option<bool>) -> Self {
122 self.large_blobs = state;
123 self
124 }
125
126 pub fn with_enterprise_attestation(mut self, state: Option<bool>) -> Self {
128 self.ep = state;
129 self
130 }
131
132 pub fn with_always_uv(mut self, state: Option<bool>) -> Self {
134 self.always_uv = state;
135 self
136 }
137
138 pub fn with_make_cred_uv_not_required(mut self, state: Option<bool>) -> Self {
140 self.make_cred_uv_not_required = state;
141 self
142 }
143}