accumulo_access_pg
accumulo_access_pg · PostgreSQL extension for parsing and evaluating Accumulo Access Expressions.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100826 | accumulo_access_pg | accumulo_access_pg | 0.3.0 | SEC | MIT | Rust |
PostgreSQL · 15, 16, 17, 18, 19
Usage
Sources:
- Official README
- Official extension control file
- Official Rust implementation
- Official package metadata
- Apache-2.0 license
- MIT license
accumulo_access_pg 0.3.0 parses and evaluates Apache Accumulo-style authorization expressions inside PostgreSQL. Its main use is applying expressions such as label1 & (label2 | label3) in a row-level security policy. The extension evaluates labels supplied by the caller; it does not authenticate users or obtain trusted authorization claims by itself.
Core Workflow
Store an authorization expression with each protected row and pass a trusted comma-separated label set to sec_authz_check. A policy can reject rows when the expression or token list is null or empty.
Do not let an untrusted database user freely set the value used by the policy. The upstream example uses a session GUC for illustration, but a user who can choose app.authorizations can grant themselves labels. Derive claims through a controlled login/session setup path or a security-reviewed helper.
Functions
sec_authz_check(expression, tokens)evaluates one expression against comma-separated tokens; malformed expressions raise an error.sec_expr_as_json(expression)andsec_expr_as_json_string(expression)expose the parsed expression for inspection.sec_authz_cache_stats()returns thehits,misses, andsizefields of the parser/evaluation cache.sec_authz_clear_cache()clears that cache and returns success as boolean.
Expression syntax and escaping follow the upstream accumulo-access Rust library. Test quoted labels, Unicode, whitespace, invalid syntax, and the exact semantics required by the application.
Installation and Security Boundaries
Release 0.3.0 builds and tests PostgreSQL 15–18 and a PostgreSQL 19 beta; PostgreSQL 13–14 are pgrx-supported but not built or tested. Its control file remains superuser-only and non-relocatable. Invalid quoted tokens are rejected, including an empty quoted token, parentheses may nest at most 256 levels, and quoted tokens may contain control characters.
Row-level security depends on every participating role, policy, bypass privilege, and claim source—not only on sec_authz_check. Validate behavior for table owners, superusers, roles with BYPASSRLS, pooled connections, reset/reuse of session state, and malformed claims. Cache statistics are operational aids, not an authorization audit trail.