| Crates.io | hodei-derive |
| lib.rs | hodei-derive |
| version | 0.1.0 |
| created_at | 2025-10-17 20:56:06.512096+00 |
| updated_at | 2025-10-17 20:56:06.512096+00 |
| description | Derive macros for Hodei authorization framework - auto-generate Cedar schemas |
| homepage | https://github.com/Rubentxu/hodei-policies |
| repository | https://github.com/Rubentxu/hodei-policies |
| max_upload_size | |
| id | 1888414 |
| size | 20,034 |
Derive macros for the Hodei authorization framework.
This crate provides procedural macros to automatically generate Cedar Policy schemas from Rust types:
#[derive(HodeiEntity)] - Generate entity schemas#[derive(HodeiAction)] - Generate action schemasuse hodei_derive::{HodeiEntity, HodeiAction};
use hodei_hrn::Hrn;
#[derive(HodeiEntity)]
#[hodei(entity_type = "MyApp::User")]
struct User {
id: Hrn,
email: String,
role: String,
}
#[derive(HodeiAction)]
#[hodei(namespace = "MyApp")]
enum DocumentAction {
#[hodei(principal = "User", resource = "Document")]
Read,
#[hodei(principal = "User", resource = "Document")]
Update,
}
For more information, see the Hodei documentation.
Licensed under either of:
at your option.