Skip to main content

ferrohealth_authz/
lib.rs

1// SPDX-FileCopyrightText: Cadasto B.V.
2// SPDX-License-Identifier: BUSL-1.1
3
4//! The policy decision of the FerroHEALTH products: the request a policy
5//! enforcement point puts, the decision it gets, and the engines that decide.
6//!
7//! `ferrohealth-smart` authenticates a caller and says who it is; this crate
8//! decides what that subject may do with an object, in the vocabulary of NIST
9//! SP 800-162 (attribute-based access control: subject, object and
10//! environment attributes, a policy decision point and the enforcement point
11//! that consults it).
12//!
13//! - [`request`]: the [`request::Subject`] read from `ferrohealth-smart`'s
14//!   caller, the [`request::Request`] with its resource attributes (sets fan
15//!   out, every combination must be permitted) and the [`request::Decision`]
16//!   with the policies that made it.
17//! - [`engine`]: the [`engine::PolicyEngine`] trait every engine implements,
18//!   and [`engine::AuthzError`], the answer of an engine that cannot decide,
19//!   which a product never reads as a permit.
20//! - `cedar` (feature `cedar`): the embedded engine over the Cedar policy
21//!   language, its schema written from the product's model and its policies
22//!   validated strictly before they run.
23//! - `remote` (feature `remote`): a remote decision point reached over HTTP,
24//!   authorized with `ferrohealth-smart`'s client credentials token.
25//!
26//! Without a feature the crate holds the request model and the trait alone,
27//! with no policy engine or HTTP client.
28
29#![doc(test(attr(deny(warnings))))]
30
31#[cfg(feature = "cedar")]
32pub mod cedar;
33pub mod engine;
34#[cfg(feature = "remote")]
35pub mod remote;
36pub mod request;