scuffle-cedar-policy-codegen

Crates.ioscuffle-cedar-policy-codegen
lib.rsscuffle-cedar-policy-codegen
version0.1.1
created_at2025-09-29 18:21:19.794264+00
updated_at2025-09-29 18:25:55.611704+00
descriptionCode generator for scuffle-cedar-policy.
homepage
repositoryhttps://github.com/scufflecloud/scuffle
max_upload_size
id1859980
size74,925
Troy Benson (TroyKomodo)

documentation

https://docs.rs/scuffle-cedar-policy-codegen

README

scuffle-cedar-policy-codegen

[!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.

Example

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");

License

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

Commit count: 1522

cargo fmt