22 stable releases

new 3.1.3 Apr 15, 2024
3.1.2 Mar 29, 2024
3.0.1 Dec 21, 2023
2.4.5 Apr 1, 2024
2.3.1 Jul 20, 2023

#228 in Configuration

Download history 4/week @ 2023-12-23 2/week @ 2023-12-30 26/week @ 2024-01-27 10/week @ 2024-02-03 1/week @ 2024-02-10 31/week @ 2024-02-17 129/week @ 2024-02-24 181/week @ 2024-03-02 316/week @ 2024-03-09 98/week @ 2024-03-16 144/week @ 2024-03-23 251/week @ 2024-03-30 102/week @ 2024-04-06

655 downloads per month
Used in 3 crates

Apache-2.0

1.5MB
35K SLoC

Cedar Policy Formatter

This package contains a simple formatter library for Cedar policies based on the pretty crate. We integrate it into Cedar CLI so that you can format your Cedar policies directly. You can also use it as a library in your Cedar applications.

Please share your opinions about the format using a feature request. And report any bugs you find using a bug report.

Quick Start

The easiest way to format your Cedar policies is via Cedar CLI's format subcommand.

# Default indentation is two spaces.
# Default line width is 80.
cedar format my-policies.cedar
# I want more indentation.
cedar format -i 4 my-policies.cedar
# I like shorter lines.
cedar format -l 40 my-policies.cedar

Usage

Build

To build, simply run cargo build (or cargo build --release).

Run

The formatter is invoked via Cedar CLI's format subcommand. Its options can be found using the following command.

cedar format -h

Documentation

Generated documentation for the latest version can be accessed on docs.rs.

Dependencies

~7–10MB
~153K SLoC