Encode credentials as a protocol buffer message
This permits to decode a credential of a different version without failing.
This commit is contained in:
@@ -335,6 +335,7 @@ where
|
||||
user_handle: vec![],
|
||||
other_ui: None,
|
||||
cred_random: None,
|
||||
unknown_fields: BTreeMap::new(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -501,6 +502,7 @@ where
|
||||
.user_display_name
|
||||
.map(|s| truncate_to_char_boundary(&s, 64).to_string()),
|
||||
cred_random,
|
||||
unknown_fields: BTreeMap::new(),
|
||||
};
|
||||
self.persistent_store.store_credential(credential_source)?;
|
||||
random_id
|
||||
@@ -1279,6 +1281,7 @@ mod test {
|
||||
user_handle: vec![],
|
||||
other_ui: None,
|
||||
cred_random: None,
|
||||
unknown_fields: BTreeMap::new(),
|
||||
};
|
||||
assert!(ctap_state
|
||||
.persistent_store
|
||||
@@ -1476,6 +1479,7 @@ mod test {
|
||||
user_handle: vec![],
|
||||
other_ui: None,
|
||||
cred_random: None,
|
||||
unknown_fields: BTreeMap::new(),
|
||||
};
|
||||
assert!(ctap_state
|
||||
.persistent_store
|
||||
|
||||
Reference in New Issue
Block a user