Commit Graph

5228 Commits

Author SHA1 Message Date
Ivan Kozlovic
ad4e14ffb0 Merge pull request #2744 from nats-io/fix_no_auth_check
[FIXED] Check for no_auth_user
2021-12-14 16:13:23 -07:00
Ivan Kozlovic
69525f3083 [FIXED] Check for no_auth_user
Check for a no_auth_user should be done only when no authentication
at all is provided by the user. This was not the case. For instance,
if the user provided a token, the server would still check for
no_auth_user if users are defined. It was not really an issue since
the admin cannot configure users AND token, but it is better for
the application to fail if providing a token that is actually not
being used. If the admin configures a no_auth_user, this should
be used only when no authentication is provided.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-12-14 10:00:54 -07:00
R.I.Pienaar
de3e7cab50 Merge pull request #2743 from ripienaar/jsz_panic
fixes a nil panic on jsz
2021-12-13 18:11:41 +01:00
R.I.Pienaar
1146e66f30 fixes a nil panic on jsz
Appears what happens is that the getPublicConsumers()
is called which produces a list of consumers and that
between the time the list is made and the Info() is
called the ephemeral was removed.

Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-12-13 11:51:33 +01:00
Matthias Hanel
628251d11d Merge pull request #2739 from nats-io/list-missing
Adding missing entry to stream/consumer list
2021-12-09 14:35:02 -05:00
Matthias Hanel
0ba2544c5a removed suffix from "missing" list
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-12-08 19:33:35 -05:00
Ivan Kozlovic
be066b7a21 Merge pull request #2738 from nats-io/fix_2720
[FIXED] JetStream: panic "could not decode consumer snapshot"
2021-12-08 17:16:51 -07:00
Matthias Hanel
dd735f4a18 Adding missing entry to stream/consumer list
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-12-08 18:44:40 -05:00
Ivan Kozlovic
1b8878138a [FIXED] JetStream: panic "could not decode consumer snapshot"
Resolves #2720

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-12-08 12:22:03 -07:00
Ivan Kozlovic
f55ee21941 Merge pull request #2735 from nats-io/mqtt_ws
[ADDED] MQTT: Support for Websocket
2021-12-07 09:09:27 -07:00
Ivan Kozlovic
2e07c3f614 [ADDED] MQTT: Support for Websocket
Clients will need to connect to the Websocket port and have `/mqtt`
as the URL path.

Resolves #2433

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-12-06 16:13:13 -07:00
Ivan Kozlovic
67c345270c Merge pull request #2734 from nats-io/fix_2514
[IMPROVED] Websocket: added client IP from X-Forwarded-For header
2021-12-06 16:11:17 -07:00
Ivan Kozlovic
833f823efb [IMPROVED] Websocket: added client IP from X-Forwarded-For header
This is for cases when there is a proxy (Nginx, HAProxy, etc..)
between the client and the NATS Server. If this header is present,
the first IP is the one of the originating client and will be
used as the host/IP in server's representation of the client host.

Resolves #2514

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-12-06 15:00:22 -07:00
Ivan Kozlovic
893b415434 Merge pull request #2727 from nats-io/update_crypto_rev
[UPDATED] golang.org/x/crypto dependency
2021-12-03 12:49:37 -07:00
Ivan Kozlovic
cbfa93e4a8 [UPDATED] golang.org/x/crypto dependency
They just released some fix that is not affecting the NATS Server
but could cause some security vulnerability reports.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-12-02 13:48:21 -07:00
Ivan Kozlovic
878afadcf0 Merge pull request #2726 from nats-io/release_2_6_6
Release v2.6.6
2021-12-02 12:14:53 -07:00
Ivan Kozlovic
f16e2f8f2a Release v2.6.6
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-12-02 11:44:56 -07:00
Matthias Hanel
cd3838aa14 Merge pull request #2725 from nats-io/consumer-list-err
Set incomplete error when cluster list fails
2021-12-02 13:20:41 -05:00
Matthias Hanel
aa25a2f600 Set incomplete error when cluster list fails
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-12-02 12:31:31 -05:00
Ivan Kozlovic
97c8214bbc Merge pull request #2724 from Shoothzj/update-docs-link
Update documentation link
2021-12-02 09:54:47 -07:00
Shoothzj
c585f808ab Update documentation link 2021-12-02 16:16:43 +08:00
Ivan Kozlovic
4464ba9bf3 Merge pull request #2723 from nats-io/early-profile-start
[CHANGED] Profiler: Start profile_port earlier
2021-12-01 15:22:05 -07:00
Ben Werthmann
d7eec1edd4 [CHANGED] Profiler: Start profile_port earlier
Enables use of pprof to investigate server startup.

Co-authored-by: Ivan Kozlovic <ivan@synadia.com>
Signed-off-by: Ben Werthmann <ben@synadia.com>
2021-12-01 16:56:57 -05:00
Ivan Kozlovic
adf974d681 Merge pull request #2721 from nats-io/bad_stream_subjects
There were situations where invalid subjects could be assigned to streams.
2021-12-01 14:19:39 -07:00
Matthias Hanel
0dc695762d Merge pull request #2722 from nats-io/stream-list-to
Aligning timeout to be shorter than 5 second cli default
2021-12-01 16:04:59 -05:00
Derek Collison
6f5263e12d Add in a warning when detecting subjects on a mirror
Signed-off-by: Derek Collison <derek@nats.io>
2021-12-01 14:00:31 -07:00
Derek Collison
ca12a11be3 There were situations where invalid subjects could be assigned to streams.
This will patch them on the fly during recovery. Specifically subjects with leading or trailing spaces and mirror streams with any subjects at all.

Signed-off-by: Derek Collison <derek@nats.io>
2021-12-01 14:00:23 -07:00
Matthias Hanel
39a710780e Aligning timeout to be shorter than 5 second cli default
Also align stream and consumer timeouts

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-12-01 15:44:06 -05:00
Ivan Kozlovic
1cf8b40304 Merge pull request #2719 from nats-io/js_mem_corruption
[FIXED] Corrupted headers receiving from consumer with meta-only
2021-12-01 13:42:47 -07:00
Ivan Kozlovic
9f30bf00e0 [FIXED] Corrupted headers receiving from consumer with meta-only
When a consumer is configured with "meta-only" option, and the
stream was backed by a memory store, a memory corruption could
happen causing the application to receive corrupted headers.

Also replaced most of usage of `append(a[:0:0], a...)` to make
copies. This was based on this wiki:
https://github.com/go101/go101/wiki/How-to-efficiently-clone-a-slice%3F

But since Go 1.15, it is actually faster to call make+copy instead.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-12-01 10:50:15 -07:00
R.I.Pienaar
dc2ac71246 Merge pull request #2718 from ripienaar/mirror_update_with_subjects
prevent stream update to add subjects to mirrors
2021-12-01 18:29:58 +01:00
R.I.Pienaar
c025d25899 prevent stream update to add subjects to mirrors
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-12-01 18:12:49 +01:00
R.I.Pienaar
cf097bfab4 Merge pull request #2717 from ripienaar/stream_valid_subjects
Stream valid subjects
2021-12-01 17:43:41 +01:00
R.I.Pienaar
4f1bfa969f ensure streams have only valid interest subjects
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-12-01 17:03:28 +01:00
Matthias Hanel
581dfb27d0 hitting an account limit left an outgoing leaf node conn in bad state (#2715)
since no error was traced or the connection closed, subscriptions where
not forwarded

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-11-30 17:48:07 -05:00
Ivan Kozlovic
4f37cbdd8a Merge pull request #2714 from nats-io/fix_2713
[FIXED] Monitoring: tls configuration not updated on reload
2021-11-30 12:56:56 -07:00
Ivan Kozlovic
40c0f03153 [FIXED] Monitoring: tls configuration not updated on reload
When creating the http server, we need to provide a TLS configuration.
After a config reload, the new TLS config would not be reflected.

We had the same issue with Websocket and was fixed with the use
of tls.Config.GetConfigForClient API, which makes the TLS handshake
to ask for a TLS config. That fix for websocket was simply not applied
to the HTTPs monitoring case.

I have also fixed some flappers due to the use of localhost instead
of 127.0.0.1 (connections possibly would resolve to some IPv6 address
that the server would not accept, etc..)

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-11-30 10:18:46 -07:00
Derek Collison
df581337ea Merge pull request #2712 from nats-io/issue-2708
[FIXED #2708] Removing a source depending on timing could cause a server panic.
2021-11-29 13:26:18 -08:00
Derek Collison
529095be40 [FIXED #2708] Removing a source depending on timing could cause a server panic.
Signed-off-by: Derek Collison <derek@nats.io>
2021-11-29 12:48:08 -08:00
Derek Collison
d3125c5a3c Merge pull request #2711 from nats-io/issue-2706
[FIXED #2706] - Only utilize full state with deleted details when necessary.
2021-11-29 11:32:44 -08:00
Derek Collison
e65f3d4a30 [FIXED #2706] - Only utilize full state with deleted details when really needed. Otherwise fast state will suffice.
Signed-off-by: Derek Collison <derek@nats.io>
2021-11-29 10:50:28 -08:00
Ivan Kozlovic
f094918f35 Merge pull request #2707 from nats-io/leafnode_ws_allowed_conn
[FIXED/CHANGED] Add leafnode websocket connection type
2021-11-22 14:39:26 -07:00
Ivan Kozlovic
ede8124fb2 [FIXED/CHANGED] Add leafnode websocket connection type
This was missing since WEBSOCKET allowed connection type is really
used for client connections.
If one wants to limit a configured user to leafnode connections,
including if the connection is over websocket, but does not
want an application to connect over websocket using this user,
this would have been impossible to configure.

The JWT library has been updated to add LEAFNODE_WS and MQTT_WS for
future work.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-11-22 10:32:58 -07:00
Ivan Kozlovic
ea48105526 Merge pull request #2705 from nats-io/release_2_6_5
Release v2.6.5
2021-11-19 10:58:19 -07:00
Ivan Kozlovic
6fc4c76ed1 Release v2.6.5
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-11-19 10:39:58 -07:00
Derek Collison
7aec33e6de Merge pull request #2704 from nats-io/memstore-bug
[FIXED] Bug in memstore when setting max msgs per subject to 1.
2021-11-19 09:21:52 -08:00
Derek Collison
72ad68fada [FIXED] Bug in memstore that when setting max msgs per subject to 1 would not work properly.
Signed-off-by: Derek Collison <derek@nats.io>
2021-11-19 09:13:43 -08:00
Derek Collison
60c48356e9 Bump version
Signed-off-by: Derek Collison <derek@nats.io>
2021-11-18 15:10:59 -08:00
Derek Collison
35ee1e2be4 Merge pull request #2702 from nats-io/mismatch
Better handling for stream mismatch scenarios.
2021-11-18 15:10:00 -08:00
Derek Collison
98757253f9 Recreate client in case shutdown server was the one we were connected to
Signed-off-by: Derek Collison <derek@nats.io>
2021-11-18 14:50:22 -08:00