DripDrop.TenantScope (DripDrop v0.1.0)

Copy Markdown View Source

Helpers for enforcing explicit tenant scope on query APIs.

DripDrop allows global records with tenant_key: nil, but callers must be explicit when they intend that global scope. Omitting the key entirely is rejected so list/get helpers do not accidentally leak rows across tenants.

Summary

Functions

Fetches tenant_key from a filter map, raising when it is absent.

Raises a consistent tenant-scope error for deprecated unscoped APIs.

Functions

fetch!(filters, context)

@spec fetch!(map(), atom()) :: binary() | nil

Fetches tenant_key from a filter map, raising when it is absent.

raise_missing!(context)

@spec raise_missing!(atom()) :: no_return()

Raises a consistent tenant-scope error for deprecated unscoped APIs.