MCPcopy Create free account
hub / github.com/cedar-policy/cedar-java / call_cedar

Function call_cedar

CedarJavaFFI/src/interface.rs:319–336  ·  view source on GitHub ↗
(call: &str, input: &str)

Source from the content-addressed store, hash-verified

317}
318
319pub(crate) fn call_cedar(call: &str, input: &str) -> String {
320 let result = match call {
321 V0_AUTH_OP => is_authorized_json_str(input),
322 #[cfg(feature = "partial-eval")]
323 V0_AUTH_PARTIAL_OP => is_authorized_partial_json_str(input),
324 V0_VALIDATE_OP => validate_json_str(input),
325 V0_VALIDATE_ENTITIES => json_validate_entities(&input),
326 V0_VALIDATE_LEVEL_OP => validate_with_level_json_str(input),
327 V0_STATEFUL_AUTH_OP => json_stateful_is_authorized(input),
328 _ => {
329 let ires = Answer::fail_internally(format!("unsupported operation: {}", call));
330 serde_json::to_string(&ires)
331 }
332 };
333 result.unwrap_or_else(|err| {
334 panic!("failed to handle call {call} with input {input}\nError: {err}")
335 })
336}
337
338#[derive(Deserialize)]
339#[serde(rename_all = "camelCase")]

Calls 3

json_validate_entitiesFunction · 0.85