canic_core/access/
mod.rs

1//! Access predicate composition and evaluation.
2//!
3//! External semantics:
4//! - Access failures are mapped to `ErrorCode::Unauthorized` at the API boundary.
5//! - Access denial metrics are emitted by the endpoint macro, not by predicate helpers.
6
7/// Access-layer errors returned by user-defined access predicates.
8///
9/// These errors are framework-agnostic and are converted into InternalError
10/// immediately at the framework boundary.
11pub mod app;
12pub mod auth;
13pub mod env;
14#[doc(hidden)]
15pub mod expr;
16pub mod metrics;
17
18use thiserror::Error as ThisError;
19
20///
21/// AccessError
22///
23
24#[derive(Debug, ThisError)]
25pub enum AccessError {
26    #[error("access denied: {0}")]
27    Denied(String),
28}