MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / parse_policy

Function parse_policy

crates/openshell-prover/src/policy.rs:340–345  ·  view source on GitHub ↗

Parse an `OpenShell` policy YAML file into a [`PolicyModel`].

(path: &Path)

Source from the content-addressed store, hash-verified

338
339/// Parse an `OpenShell` policy YAML file into a [`PolicyModel`].
340pub fn parse_policy(path: &Path) -> Result<PolicyModel> {
341 let contents = std::fs::read_to_string(path)
342 .into_diagnostic()
343 .wrap_err_with(|| format!("reading policy file {}", path.display()))?;
344 parse_policy_str(&contents)
345}
346
347/// Parse a policy YAML string into a [`PolicyModel`].
348pub fn parse_policy_str(yaml: &str) -> Result<PolicyModel> {

Callers 5

proveFunction · 0.85
test_parse_policyFunction · 0.85
test_filesystem_policyFunction · 0.85

Calls 1

parse_policy_strFunction · 0.85

Tested by 4

test_parse_policyFunction · 0.68
test_filesystem_policyFunction · 0.68