Releases: permitio/opa-nats
Releases · permitio/opa-nats
v0.0.6
v0.0.5 — Single muxed KV bucket (BREAKING)
⚠️ Breaking change
This release replaces the bucket-per-tenant model with a single muxed K/V bucket holding every tenant. There is no backward compatibility — deployments must be reconfigured (#4).
bucketis now required config. The plugin reads one configured K/V bucket; setbucket: "<name>"(e.g.POLICY_DATA) in the plugin config. A missing/emptybucketnow fails validation at startup.- Data layout changed. Entries are keyed
<tenant>.<key>within the single bucket (was one bucket per tenant). Data still lands in OPA atdata.nats.kv.<tenant>.<...>, so Rego policies are unchanged. - Builtin argument is now the tenant id.
nats.kv.watch_bucket(<id>)andnats.kv.get_data(<id>, key)take the tenant (the leading key token), not a bucket name. root_bucketconfig renamed toroot_tenant(a tenant whose subtree mounts at the OPA data root with its token stripped).watch_bucketno longer fails open: a missing configured bucket now surfaces an error (previously returnedfalse), consistent withget_data.
Migration
- Set
bucket: "<your-bucket>"in the plugin config (androot_tenantinstead ofroot_bucketif you used it). - Provision the single bucket and have the producer write
<tenant>.<key>entries to it (the data-generator dual-writes during migration). - Scope NATS account permissions to
$KV.<bucket>.>— note$JS.API.>is account-wide JetStream access.
Notable internals
- Per-tenant reads are prefix-filtered (O(tenant), never enumerates the whole bucket); watches are
context-bound and fail closed on early close. - Tenant-id validation (rejects
./*/>/whitespace); failed reads skip the key instead of injectingnull; non-JSON values fall back to a JSON string. - Integration tests are behind a
//go:build integrationtag (excluded from the defaultgo test ./...).
Full changelog: v0.0.4...v0.0.5
v0.0.4
v0.0.3
- Fix a race when stopping a bucket watcher
- improve launch configurations
Full Changelog: v0.0.2...v0.0.3
v0.0.2
What's Changed
- update license copyrights by @omer9564 in #2
- Enhance NATS plugin configuration by adding UserJwt and UserNkeySeed fields. Update connection logic to support JWT authentication. Improve logging during plugin validation and connection attempts.
Full Changelog: v0.0.1...v0.0.2