Expose start date certificate getter.
This commit is contained in:
parent
c5f866738e
commit
802ef42ab5
|
|
@ -29,7 +29,7 @@ use super::easy_ext::CertInfo;
|
|||
pub struct Certificate {
|
||||
subject: Option<String>,
|
||||
issuer: Option<String>,
|
||||
pub start_date: Option<DateTime<Utc>>,
|
||||
start_date: Option<DateTime<Utc>>,
|
||||
pub expire_date: DateTime<Utc>,
|
||||
pub serial_number: String,
|
||||
pub subject_alt_name: Option<String>,
|
||||
|
|
@ -62,6 +62,10 @@ impl Certificate {
|
|||
pub fn issuer(&self) -> Option<&String> {
|
||||
self.issuer.as_ref()
|
||||
}
|
||||
|
||||
pub fn start_date(&self) -> Option<DateTime<Utc>> {
|
||||
self.start_date
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<CertInfo> for Certificate {
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ impl CertificateJson {
|
|||
CertificateJson {
|
||||
subject: c.subject().cloned(),
|
||||
issuer: c.issuer().cloned(),
|
||||
start_date: c.start_date.map(|d| d.to_string()),
|
||||
start_date: c.start_date().map(|d| d.to_string()),
|
||||
expire_date: c.expire_date.to_string(),
|
||||
serial_number: c.serial_number.to_string(),
|
||||
subject_alt_name: c.subject_alt_name.clone(),
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ fn get_call_html(
|
|||
if let Some(issuer) = certificate.issuer() {
|
||||
values.push(("Issuer", issuer.as_str()));
|
||||
}
|
||||
let start_date = certificate.start_date.map(|d| d.to_string());
|
||||
let start_date = certificate.start_date().map(|d| d.to_string());
|
||||
if let Some(start_date) = start_date.as_ref() {
|
||||
values.push(("Start Date", start_date.as_str()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -392,8 +392,8 @@ fn eval_query_certificate(
|
|||
Some(issuer) => Value::String(issuer.clone()),
|
||||
None => return Ok(None),
|
||||
},
|
||||
CertificateAttributeName::StartDate => match certificate.start_date.as_ref() {
|
||||
Some(date) => Value::Date(*date),
|
||||
CertificateAttributeName::StartDate => match certificate.start_date() {
|
||||
Some(date) => Value::Date(date),
|
||||
None => return Ok(None),
|
||||
},
|
||||
CertificateAttributeName::ExpireDate => Value::Date(certificate.expire_date),
|
||||
|
|
|
|||
Loading…
Reference in New Issue