| Crates.io | scuffle-cedar-policy-codegen |
| lib.rs | scuffle-cedar-policy-codegen |
| version | 0.1.1 |
| created_at | 2025-09-29 18:21:19.794264+00 |
| updated_at | 2025-09-29 18:25:55.611704+00 |
| description | Code generator for scuffle-cedar-policy. |
| homepage | |
| repository | https://github.com/scufflecloud/scuffle |
| max_upload_size | |
| id | 1859980 |
| size | 74,925 |
[!WARNING] This crate is under active development and may not be stable.
Cedar is a policy language used to express permisisons using a relationship model.
This crate extends the cedar-policy crate by adding code generator for cedar schemas.
You can then use this in combo with cedar to have type-safe schema evaluation.
let schema = std::fs::read_to_string("./static.cedarschema").expect("failed to read");
let config = scuffle_cedar_policy_codegen::Config::default()
.generate_from_schema(&schema)
.expect("valid schema");
let output = std::path::PathBuf::from(std::env::var_os("OUT_DIR").expect("no such env")).join("generated.rs");
std::fs::write(output, config.to_string()).expect("failed to write output");
This project is licensed under the MIT or Apache-2.0 license. You can choose between one of them if you use this work.
SPDX-License-Identifier: MIT OR Apache-2.0