Function brane_ctl::policies::add

source ·
pub async fn add(
    node_config_path: PathBuf,
    input: String,
    language: Option<PolicyInputLanguage>,
    address: AddressOpt,
    token: Option<String>,
) -> Result<(), Error>
Expand description

Adds the given policy to the checker defined in the given node config file.

§Arguments

  • node_config_path: The path to the node configuration file that determines which node we’re working for.
  • input: The policy (or rather, a path thereto) to submit.
  • language: The language of the input.
  • address: The address on which to reach the checker. May be missing a port, to be resolved in the node.yml.
  • token: A token used for authentication with the remote checker. If omitted, will attempt to generate one based on the secret file in the node.yml file.

§Errors

This function may error if we failed to read configs, read the input, contact the checker of if the checker errored.