Output identity details in human-readable format.
(&self, identity: &atomic_identity::Identity, is_default: bool)
| 98 | impl Show { |
| 99 | /// Output identity details in human-readable format. |
| 100 | fn output_default(&self, identity: &atomic_identity::Identity, is_default: bool) { |
| 101 | print_section(&format!("Identity: {}", identity.name)); |
| 102 | println!(); |
| 103 | |
| 104 | // Basic info |
| 105 | println!(" ID: {}", identity.id.to_base32()); |
| 106 | |
| 107 | if let Some(email) = &identity.email { |
| 108 | println!(" Email: {}", email); |
| 109 | } |
| 110 | |
| 111 | println!( |
| 112 | " Type: {}", |
| 113 | super::format_identity_type(&identity.identity_type) |
| 114 | ); |
| 115 | println!(" Usage: {}", super::format_usage(&identity.usage)); |
| 116 | |
| 117 | // Metadata |
| 118 | println!( |
| 119 | " Created: {}", |
| 120 | identity.metadata.created_at.format("%Y-%m-%d %H:%M:%S UTC") |
| 121 | ); |
| 122 | |
| 123 | if let Some(modified) = identity.metadata.modified_at { |
| 124 | println!( |
| 125 | " Modified: {}", |
| 126 | modified.format("%Y-%m-%d %H:%M:%S UTC") |
| 127 | ); |
| 128 | } |
| 129 | |
| 130 | if let Some(expires) = identity.metadata.expires_at { |
| 131 | let expired = identity.is_expired(); |
| 132 | println!( |
| 133 | " Expires: {} {}", |
| 134 | expires.format("%Y-%m-%d %H:%M:%S UTC"), |
| 135 | if expired { "(EXPIRED)" } else { "" } |
| 136 | ); |
| 137 | } |
| 138 | |
| 139 | if let Some(description) = &identity.metadata.description { |
| 140 | println!(" Description: {}", description); |
| 141 | } |
| 142 | |
| 143 | // Delegation info |
| 144 | if let Some(delegated_by) = &identity.delegated_by { |
| 145 | println!(" Delegated by: {}", delegated_by.short()); |
| 146 | } |
| 147 | |
| 148 | // Public key |
| 149 | println!(); |
| 150 | if self.show_public_key { |
| 151 | println!(" Public Key: {}", identity.public_key_base32()); |
| 152 | } else { |
| 153 | println!( |
| 154 | " Public Key: {}... (use --show-public-key for full key)", |
| 155 | &identity.public_key_base32()[..24] |
| 156 | ); |
| 157 | } |
no test coverage detected