chore: add app id
This commit is contained in:
@@ -51,7 +51,8 @@ impl fmt::Display for U2FDeviceInfo {
|
|||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct U2fRegistrationData {
|
pub struct U2fRegistrationData {
|
||||||
pub u2f_device_info: U2FDeviceInfo,
|
pub app_id: String,
|
||||||
|
pub device_info: U2FDeviceInfo,
|
||||||
pub device_name: Option<String>,
|
pub device_name: Option<String>,
|
||||||
pub attestation_cert_pem: Option<String>,
|
pub attestation_cert_pem: Option<String>,
|
||||||
pub pub_key: String,
|
pub pub_key: String,
|
||||||
@@ -65,8 +66,8 @@ impl U2fRegistrationData {
|
|||||||
Err(e) => return simple_error!("Parse registration data failed: {}", e),
|
Err(e) => return simple_error!("Parse registration data failed: {}", e),
|
||||||
};
|
};
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
// register_result,
|
app_id: app_id.to_string(),
|
||||||
u2f_device_info: U2FDeviceInfo::from(®ister_result),
|
device_info: U2FDeviceInfo::from(®ister_result),
|
||||||
device_name: rr.device_name,
|
device_name: rr.device_name,
|
||||||
attestation_cert_pem: rr.attestation_cert.map(|c| {
|
attestation_cert_pem: rr.attestation_cert.map(|c| {
|
||||||
to_pem(&c, "CERTIFICATE", 64)
|
to_pem(&c, "CERTIFICATE", 64)
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ impl Command for CommandImpl {
|
|||||||
if json_output {
|
if json_output {
|
||||||
success!("{}", serde_json::to_string_pretty(&data).unwrap());
|
success!("{}", serde_json::to_string_pretty(&data).unwrap());
|
||||||
} else {
|
} else {
|
||||||
success!("Device info: {}", data.u2f_device_info);
|
success!("Device info: {}", data.device_info);
|
||||||
if let Some(cert) = data.attestation_cert_pem {
|
if let Some(cert) = data.attestation_cert_pem {
|
||||||
success!("Certificate: {}", cert);
|
success!("Certificate: {}", cert);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user