Add optional JetStream domain config to the natsstore plugin (PER-13735) - #5
Merged
Merged
Conversation
Adds a `domain` plugin option; when set, the JetStream context is created with nats.Domain so API calls are scoped to $JS.<domain>.API. Empty preserves the default domain-less prefix, so existing deployments are unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds support for an optional JetStream domain in the natsstore plugin configuration, enabling domain-scoped JetStream API calls when required (e.g., across leafnode boundaries) while preserving existing behavior by default.
Changes:
- Add
domainto plugin config (Config) and document it in the README configuration table. - Create JetStream context with
nats.Domain(domain)when configured. - Extend JSON marshal/unmarshal test coverage to include the new
domainfield.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents the new domain configuration option and its effect on JetStream API prefixing. |
| pkg/natsstore/nats_client.go | Passes optional nats.Domain(...) when creating the JetStream context. |
| pkg/natsstore/config.go | Adds Domain field to the plugin configuration struct with explanatory comments. |
| pkg/natsstore/config_test.go | Updates JSON marshaling test to assert Domain round-trips correctly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… JetStream init succeeds Addresses review comments: - #5 (comment) (@copilot-pull-request-reviewer) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
zeevmoney
reviewed
Jun 11, 2026
zeevmoney
left a comment
There was a problem hiding this comment.
Automated Review - the PR looks clean, found nothing.
zeevmoney
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an optional
domainkey to the plugin config. When set, the JetStream context is created withnats.Domain(domain), scoping JetStream API calls to$JS.<domain>.APIinstead of the default$JS.API. Documented in the README config table and covered in the JSON-marshaling test.Why
The cloud NATS cluster is activating a JetStream domain (
cloud, permitio/cloud-pdp#50). Edge/leafnode-connected OPA instances must address the cloud JetStream through the domain-scoped prefix; direct connections are unaffected either way. Empty (the default) preserves current behavior.Follow-ups
domaininto the permit-opa chart's plugin configTesting
go build ./...,gofmt,go vet— cleango test ./pkg/natsstore/— 123 passed; the 2 failures (TestPluginFactory_Validate/_New) need a live NATS server and fail identically on clean main🤖 Generated with Claude Code