Skip to content

Cherry-picks for v2.12.1-RC.2#7392

Merged
neilalexander merged 15 commits intorelease/v2.12.1from
backports/v2.12.1-RC.2
Oct 3, 2025
Merged

Cherry-picks for v2.12.1-RC.2#7392
neilalexander merged 15 commits intorelease/v2.12.1from
backports/v2.12.1-RC.2

Conversation

neilalexander and others added 14 commits October 2, 2025 17:41
Signed-off-by: Neil Twigg <neil@nats.io>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Neil Twigg <neil@nats.io>
…ling

Signed-off-by: Neil Twigg <neil@nats.io>
[skip ci]

Signed-off-by: Neil Twigg <neil@nats.io>
Signed-off-by: Neil Twigg <neil@nats.io>
…cessing

This commit introduces NewServerFromConfig() function that automatically
processes configuration files for embedded NATS servers, eliminating the
need for manual LoadConfig() calls.

Key changes:
- Add NewServerFromConfig() function in server/server.go
- Function automatically calls opts.ProcessConfigFile() when ConfigFile
  is set and configDigest is empty
- Add comprehensive test coverage in server/opts_test.go:
  * TestNewServerFromConfigFunctionality: tests basic functionality and error handling
  * TestNewServerFromConfigVsLoadConfig: validates equivalence with LoadConfig approach

The new function provides a cleaner API for embedded servers while maintaining
full backward compatibility with existing LoadConfig workflows.

Signed-off-by: orician <lzjzxOYX201905@gmail.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Neil Twigg <neil@nats.io>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@neilalexander neilalexander requested a review from a team as a code owner October 2, 2025 16:44
Copy link
Copy Markdown
Member

@MauriceVanVeen MauriceVanVeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Enables NATS leaf node servers to connect through corporate HTTP proxies to NATS Hub servers.

Configuration options:
- proxy_url: HTTP proxy server URL (http/https schemes only)
- username/password: Optional proxy authentication credentials
- Validates proxy compatibility with WebSocket URLs and TLS requirements

Signed-off-by: Dan Bailey <danbailey1000@msn.com>
@neilalexander neilalexander merged commit 268fd6d into release/v2.12.1 Oct 3, 2025
48 checks passed
@neilalexander neilalexander deleted the backports/v2.12.1-RC.2 branch October 3, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants