Skip to content

Commit

Permalink
feat(admin): renew certs command (#1880)
Browse files Browse the repository at this point in the history
jonaro00 authored Sep 17, 2024

Verified

This commit was signed with the committer’s verified signature.
Kocal Hugo Alliaume
1 parent 89b995f commit 05372f0
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions admin/src/args.rs
Original file line number Diff line number Diff line change
@@ -46,6 +46,8 @@ pub enum Command {
UnsetBetaAccess {
user_id: String,
},

RenewCerts,
}

#[derive(Subcommand, Debug)]
6 changes: 6 additions & 0 deletions admin/src/client.rs
Original file line number Diff line number Diff line change
@@ -111,4 +111,10 @@ impl Client {

Ok(())
}

pub async fn renew_old_certificates(&self) -> Result<serde_json::Value> {
self.inner
.put_json("/admin/certificates/renew", Option::<()>::None)
.await
}
}
4 changes: 4 additions & 0 deletions admin/src/main.rs
Original file line number Diff line number Diff line change
@@ -111,5 +111,9 @@ async fn main() {
client.set_beta_access(&user_id, false).await.unwrap();
println!("Unset user {user_id} beta access");
}
Command::RenewCerts => {
let res = client.renew_old_certificates().await.unwrap();
println!("{res}");
}
};
}

0 comments on commit 05372f0

Please sign in to comment.