From 3ed7d578920384f979aa0341cbfca4947771d89b Mon Sep 17 00:00:00 2001 From: Jin Jiu Date: Tue, 22 Oct 2024 17:50:15 +0800 Subject: [PATCH] Fix the problems found in PR[#78] review. --- src/modules/credential/cert/path_certs.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/credential/cert/path_certs.rs b/src/modules/credential/cert/path_certs.rs index 59eea06..ed02ed7 100644 --- a/src/modules/credential/cert/path_certs.rs +++ b/src/modules/credential/cert/path_certs.rs @@ -207,7 +207,7 @@ This endpoint allows you to create, read, update, and delete trusted certificate that are allowed to authenticate. Deleting a certificate will not revoke auth for prior authenticated connections. -To do this, do a revoke on "login". If you don'log need to revoke login immediately, +To do this, do a revoke on "login". If you don't need to revoke login immediately, then the next renew will cause the lease to expire. "# }); @@ -262,7 +262,14 @@ impl CertBackendInner { let cert_entry = entry.unwrap(); let mut cert_entry_data = serde_json::to_value(&cert_entry)?; let data = cert_entry_data.as_object_mut().unwrap(); - //TODO + + if cert_entry.policies.len() > 0 { + data["policies"] = data["token_policies"].clone(); + } + + if cert_entry.bound_cidrs.len() > 0 { + data["bound_cidrs"] = data["token_bound_cidrs"].clone(); + } Ok(Some(Response::data_response(Some(data.clone())))) }