Browse Source

Rename post_operation_hook to post_operation_hooks

pull/5/head
Rodolphe Breard 6 years ago
parent
commit
558fd63ab5
  1. 3
      CHANGELOG.md
  2. 2
      acmed/src/acmed.rs
  3. 6
      acmed/src/config.rs

3
CHANGELOG.md

@ -10,3 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- The `kp_reuse` flag allow to reuse a key pair instead of creating a new one at each renewal. - The `kp_reuse` flag allow to reuse a key pair instead of creating a new one at each renewal.
- It is now possible to define hook groups that can reference either hooks or other hook groups. - It is now possible to define hook groups that can reference either hooks or other hook groups.
### Changed
- `post_operation_hook` has been renamed `post_operation_hooks`.

2
acmed/src/acmed.rs

@ -331,7 +331,7 @@ impl Acmed {
remote_url: crt.get_remote_url(&cnf)?, remote_url: crt.get_remote_url(&cnf)?,
challenge: crt.get_challenge()?, challenge: crt.get_challenge()?,
challenge_hooks: crt.get_challenge_hooks(&cnf)?, challenge_hooks: crt.get_challenge_hooks(&cnf)?,
post_operation_hooks: crt.get_post_operation_hook(&cnf)?,
post_operation_hooks: crt.get_post_operation_hooks(&cnf)?,
}; };
certs.push(cert); certs.push(cert);
} }

6
acmed/src/config.rs

@ -136,7 +136,7 @@ pub struct Certificate {
pub domains: Vec<String>, pub domains: Vec<String>,
pub challenge: String, pub challenge: String,
pub challenge_hooks: Vec<String>, pub challenge_hooks: Vec<String>,
pub post_operation_hook: Option<Vec<String>>,
pub post_operation_hooks: Option<Vec<String>>,
pub algorithm: Option<String>, pub algorithm: Option<String>,
pub kp_reuse: Option<bool>, pub kp_reuse: Option<bool>,
pub directory: Option<String>, pub directory: Option<String>,
@ -231,9 +231,9 @@ impl Certificate {
Ok(res) Ok(res)
} }
pub fn get_post_operation_hook(&self, cnf: &Config) -> Result<Vec<Hook>, Error> {
pub fn get_post_operation_hooks(&self, cnf: &Config) -> Result<Vec<Hook>, Error> {
let mut res = vec![]; let mut res = vec![];
match &self.post_operation_hook {
match &self.post_operation_hooks {
Some(po_hooks) => for name in po_hooks.iter() { Some(po_hooks) => for name in po_hooks.iter() {
let mut h = cnf.get_hook(&name)?; let mut h = cnf.get_hook(&name)?;
res.append(&mut h); res.append(&mut h);

Loading…
Cancel
Save