Skip to main content

acl_render

Function acl_render 

Source
pub(crate) fn acl_render(api: &str, auth: AuthOptions<'_>, acl_file: &str) -> !
Expand description

Rewrites an ACL file’s trailing comments from the node’s roster (D46).

The decisions all live in choir_cli::acl::render; this is the IO around it. Three things it deliberately does:

  • Reads the roster before touching the file. A failed fetch must leave the ACL exactly as it was, because the failure mode of the alternative is an authorization file emptied of its names by a network error.
  • Writes only on a change, so a re-run on a current file produces no churn and no new mtime for the node’s hot-reload to notice.
  • Prints the counts. A file that renders no comments at all looks exactly like a file whose handles are all unnamed, and the second is the one worth knowing about.