hessra_authz
hessra_authz · Biscuit-token authorization helpers plus key and service-chain management inside PostgreSQL.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100942 | hessra_authz | hessra_authz | 0.3.2 | SEC | Apache-2.0 | Rust |
PostgreSQL · 13, 14, 15, 16, 17
Usage
Sources:
- hessra_authz README at the reviewed commit
- Extension control file
- Cargo package and PostgreSQL feature matrix
- Current SQL API implementation
hessra_authz verifies Biscuit authorization tokens locally inside PostgreSQL. It stores named public keys and service-chain definitions, then checks a token’s subject, resource, and operation without contacting an authorization service at verification time.
Key Management and Verification
Create the extension, register a real PEM public key, and verify a real Biscuit token. The example uses psql variables so credentials are not embedded in SQL history.
Public-key management functions are add_public_key, get_public_key, update_public_key, and delete_public_key. Service-chain management uses add_service_chain, get_service_chain, update_service_chain, and delete_service_chain. Direct verification functions accept a PEM key, while the convenience functions read a named or default key from extension-managed tables.
Caveats
- Current source defines five arguments for
verify_tokenandverify_token_with_stored_key; the reviewed README examples include an obsolete sixthNULLargument. Follow the source/API generated by your installed build. - Verification returns SQL
voidon success and raises an error on denial or malformed input; it does not return a Boolean. An RLS policy using anIS NULLtest therefore aborts denied statements instead of evaluating to false. - The control file marks version
0.3.2as superuser-only to install, untrusted, and non-relocatable. The Cargo build features cover PostgreSQL 13 through 17 even though the README says PostgreSQL 12 or newer. - Key and service-chain management functions mutate shared extension tables, and upstream defines no application-role policy. Review ownership and revoke
EXECUTEor table privileges from roles that must not change authorization configuration.