Function build_state

Source
pub async fn build_state(
    store_root: PathBuf,
    audit_log: Option<PathBuf>,
    chain_secret: Option<Vec<u8>>,
    auth: AuthLayer,
) -> Result<AppState, String>
Expand description

Build an AppState from a policy store on disk + an optional audit log. If chain_secret is Some, the audit log is opened in chained (HMAC) mode; otherwise plain JSONL.

§Errors

Returns a String error if the store can’t be opened or the cedar engine can’t be initialized. The error string is suitable for an HTTP 500 response body.