Skip to main content

MAX_BACKUP_RECIPIENTS

Constant MAX_BACKUP_RECIPIENTS 

Source
pub const MAX_BACKUP_RECIPIENTS: usize = 32;
Expand description

The largest number of entries backup.age_recipients may hold.

A Stratum node encrypts its keystore to every listed recipient in each backup and refuses to write a backup to more than 32 of them, so a longer list is rejected here, when the configuration is validated, rather than at backup time. The field’s FieldDescriptor::description states the same limit.

§Examples

use stratum_node_config::{schema, Value, MAX_BACKUP_RECIPIENTS};

let field = schema().field("backup.age_recipients").expect("field exists");
let too_many = vec!["age1pq1…".to_owned(); MAX_BACKUP_RECIPIENTS + 1];
let err = field.validate(&Value::from(too_many)).unwrap_err();
assert_eq!(err.message(), "must hold at most 32 recipients, found 33");