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

Function allow_def_to_proto

crates/openshell-policy/src/lib.rs:499–518  ·  view source on GitHub ↗
(_protocol: &str, allow: L7AllowDef)

Source from the content-addressed store, hash-verified

497}
498
499fn allow_def_to_proto(_protocol: &str, allow: L7AllowDef) -> L7Allow {
500 let params = flatten_param_matchers(params_with_tool(allow.params, allow.tool));
501 L7Allow {
502 method: allow.method,
503 path: allow.path,
504 command: allow.command,
505 operation_type: allow.operation_type,
506 operation_name: allow.operation_name,
507 fields: allow.fields,
508 query: allow
509 .query
510 .into_iter()
511 .map(|(key, matcher)| (key, matcher_def_to_proto(matcher)))
512 .collect(),
513 params: params
514 .into_iter()
515 .map(|(key, matcher)| (key, matcher_def_to_proto(matcher)))
516 .collect(),
517 }
518}
519
520fn deny_def_to_proto(_protocol: &str, deny: L7DenyRuleDef) -> L7DenyRule {
521 let params = flatten_param_matchers(params_with_tool(deny.params, deny.tool));

Callers 1

to_protoFunction · 0.85

Calls 3

flatten_param_matchersFunction · 0.85
params_with_toolFunction · 0.85
matcher_def_to_protoFunction · 0.85

Tested by

no test coverage detected