#access-control #expressions #parser #api #evaluating #authorization #accumulo

accumulo-access

Rust API for parsing and evaluating Accumulo Access Expressions

3 releases

0.1.4 Jan 9, 2024
0.1.3 Jan 8, 2024
0.1.2 Jan 5, 2024
0.1.1 Jan 4, 2024
0.1.0 Jan 3, 2024

#230 in Authentication

Download history 48/week @ 2024-01-03 3/week @ 2024-01-10 5/week @ 2024-02-14 15/week @ 2024-02-21

53 downloads per month
Used in accumulo_access_pg

MIT/Apache

25KB
486 lines

Accumulo Access for Rust

Introduction

This crate provides a Rust API for parsing and evaluating Accumulo Access Expressions, based on the AccessExpression specification.

Usage

Add the following to your Cargo.toml:

[dependencies]
accumulo-access = "0.1"

Example

use accumulo_access::check_authorization;

fn main() {
    let expr = "A&B&(C|D)";
    let auths = vec!["A", "B", "C"];
    let result = check_authorization(expr, auths);
    assert!(result.is_ok());
}

Limitations

  • It doesn't limit the unicode ranges in quoted access tokens (ref. the specification).
  • It doesn't have functionality for normalizing expressions (ref. the Java-based accumulo-access project).
  • It doesn't have functionality for serializing expression trees to a string representation.

Known usages

Maintainers

License

Licensed under both the the Apache License, Version 2.0 (LICENSE_APACHE or http://www.apache.org/licenses/LICENSE-2.0) and the MIT License LICENSE_MIT.

Dependencies

~0.3–1MB
~22K SLoC