Commit Graph

3158 Commits

Author SHA1 Message Date
Matthias Hanel
371861ec59 Holding lock when accessing leaf node account for filtering
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-24 18:57:21 -04:00
Matthias Hanel
d501a811b8 [Added] filtering by account to leafz and exposing this as per acc subj
On the monitoring endpoint /leafz specify ?acc=<account id>

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-24 17:23:36 -04:00
Ivan Kozlovic
63cc9a0936 Merge pull request #1611 from nats-io/sys-evt-cleanup
[Adding] Accountz monitoring endpoint and INFO monitoring req subject
2020-09-24 13:30:45 -06:00
Matthias Hanel
7a8a7a7234 Incorporating review comments 2020-09-23 18:29:44 -04:00
Ivan Kozlovic
12d84c646c Merge pull request #1535 from harrisa1/improveLogging
[CHANGED] add client provided info into server side client logs when available
2020-09-23 14:53:06 -06:00
Matthias Hanel
634ce9f7c8 [Adding] Accountz monitoring endpoint and INFO monitoring req subject
Returned imports/exports are formated like jwt exports imports, even if
they originating account is from config.

Fixes #1604

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-23 16:22:48 -04:00
Andrew Harris
40cacf5e5f updates from PR 2020-09-23 14:02:03 -04:00
Ivan Kozlovic
9b7c472c09 Merge pull request #1607 from nats-io/fix_leafnode_loop_detected
[FIXED] Prevent LeafNode loop detection on early reconnect
2020-09-22 17:27:01 -06:00
Ivan Kozlovic
2605ae71ed [FIXED] Prevent LeafNode loop detection on early reconnect
If the soliciting side detects the disconnect and attempts to
reconnect but the accepting side did not yet close the connection,
a "loop detected" error would be reported and the soliciting server
would not try to reconnect for 30 seconds.

Made a change so that the accepting server checks for existing
leafnode connection for the same server and same account, and if
it is found, close the "old" connection so it is replaced by
the "new" one.

Resolves #1606

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-22 16:58:36 -06:00
Ivan Kozlovic
1dd0c0666f Merge pull request #1605 from nats-io/sys-evt-cleanup
Expose SUBSZ and CONNZ monitoring endpoints for accounts
2020-09-22 14:40:32 -06:00
Andrew Harris
b5197cfc47 updates from PR 2020-09-22 09:05:50 -04:00
Matthias Hanel
0e982b45ea Expose SUBSZ and CONNZ monitoring endpoints for accounts
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-22 00:10:53 -04:00
Ivan Kozlovic
0752d8b8e7 Merge pull request #1602 from nats-io/sys-evt-cleanup
Add $SYS.REQ.ACCOUNT.%s.CLAIMS.UPDATE
2020-09-21 13:46:42 -06:00
Matthias Hanel
5df6cb425c Add $SYS.REQ.ACCOUNT.%s.CLAIMS.UPDATE
Old $SYS.ACCOUNT.%s.CLAIMS.UPDATE is keept for backwards compatibility.
The old name is in the same name space as events.
To be able to abuse this, an attacker needs to be in possession of the
operator key as well.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-21 14:32:17 -04:00
Matthias Hanel
f76d6e38bd Adding new subscription for account conns (#1599)
This fits better with similar events
New subject is $SYS.ACCOUNT.%s.SERVER.CONNS
Old subject remains for backwards compatibiliby

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-18 15:52:23 -06:00
Ivan Kozlovic
a10a2e9612 Merge pull request #1594 from nats-io/fix_websocket_auth
Added an allowed connection type filter for users
2020-09-18 13:56:39 -06:00
Ivan Kozlovic
04f96813a7 Validate options for user embedded NATS Server in their app
We were doing option validation from options parsing, but added
it also for Users/NKeyUsers options.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-18 13:09:52 -06:00
Ivan Kozlovic
e84f1cf52c Added test with unknown JWT allowed connection type
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-17 18:17:19 -06:00
Ivan Kozlovic
648346f857 Add some tests for config parsing
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-16 19:17:12 -06:00
Ivan Kozlovic
7ccbaca782 Added an allowed connection type filter for users
Users and NKey users will now have the option to specify a list
of allowed connection types.

This will allow for instance a certain user to be allowed to
connect as a standard NATS client, but not as Websocket, or
vice-versa.

This also fixes the websocket auth override. Indeed, with
the original behavior, the websocket users would have been bound
to $G, which would not work when there are accounts defined, since
when that is the case, no app can connect/bind to $G account.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-16 18:22:44 -06:00
Ivan Kozlovic
04ec50865d Merge pull request #1598 from nats-io/sys-evt-cleanup
Tie account in system event subject to data and clean up subject names
2020-09-16 15:29:40 -06:00
Matthias Hanel
3c149ea99b Incorporating comments and renaming claims pack as well
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-16 16:04:33 -04:00
Matthias Hanel
a4c069884f Tie account in system event subject to data and clean up subject names
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-16 13:26:06 -04:00
Ivan Kozlovic
b39f0f9069 Merge pull request #1596 from DavidSimner/patch-1
[CHANGED] nats.io resources from HTTP to HTTPS
2020-09-15 09:02:04 -06:00
David Simner
a4b13c0f8b Change nats.io resources from HTTP to HTTPS 2020-09-15 15:23:04 +02:00
Ivan Kozlovic
53ff94c750 Merge pull request #1595 from nats-io/speedup_some_dirstore_tests
Fix dirstore code and speed up some tests
2020-09-11 10:16:27 -06:00
Ivan Kozlovic
bd920c42bc Fix dirstore code and speed up some tests
When using Unix() time, since it is number of seconds, it is better
to round up the time before adding a ttl. Trying to shorten some
of the tests showed that in some cases a file was removed too early.
This was because the computed expiration with ttl fell in the same
second, so the file was removed prematurely.

So anywhere where we used to do: time.Now().Addd(ttl).Unix(), I
changed to time.Now().Round(time.Second).Add(ttl).Unix().

I was able to reduce the time of TestTTL from 21 seconds down to
less than 5. TestExpiration was also shorten.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-10 17:47:33 -06:00
Ivan Kozlovic
540160116e Merge pull request #1587 from nats-io/js-jwt
Updating jetstream account settings from jwt
2020-09-10 12:52:25 -06:00
Waldemar Quevedo
9f41002f2e Merge pull request #1593 from nats-io/go1.15-fixes
Fixes for Go1.15
2020-09-09 12:15:01 -07:00
Waldemar Quevedo
f0c144203b Add Go 1.15 version to CI
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-09-09 07:21:32 -07:00
Waldemar Quevedo
de98a04aa2 Update config check tests
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-09-09 04:46:52 -07:00
Waldemar Quevedo
26f4971827 Fix all certs for Go 1.15 SAN and CN changes
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-09-09 04:43:23 -07:00
Ivan Kozlovic
5cd11bf77d Merge pull request #1590 from nats-io/lookup_host_for_routes
[ADDED] Support for route hostname resolution
2020-09-08 14:55:05 -06:00
Ivan Kozlovic
8fb4d2a0b1 Merge pull request #1589 from nats-io/offer-targz
Offer .tar.gz releases additionally
2020-09-08 14:34:36 -06:00
Ivan Kozlovic
2ad2bed170 [ADDED] Support for route hostname resolution
We previously simply called DialTimeout() on a route's url when
soliciting. If it resolved to the IP of the host, it would create
a route to self, which server detects, but then would not try again
with other IPs that would have allowed to form a cluster with
other servers running on the other IPs.

This PR keeps track of local IPs + cluster port and exclude them
from the list of IPs returned by LookupHost API. This even prevent
solicitation of routes to self. Only non-local IPs will be tried.

Resolves #1586

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-09-08 13:40:17 -06:00
Jaime Piña
0223f381c9 Offer .tar.gz releases
The zip/unzip commands aren't installed by default on most Linux
distros. However, tar is almost always installed. Additionally, users
may get confused when they try to uncompress an archive with
gzip/gunzip, only for it to fail because gunzip is for .gz files, not
.zip.

This change makes it a little easier to grab a copy of a nats-server
release binary.
2020-09-08 12:05:12 -07:00
Alberto Ricart
92e00f2a40 Header ADR clarifications (#1528)
* clarifications on the ADR. Go is non-standard, and it's formatting
rules, create formatting dependencies that are not part of the spec.
Also added simplified guidance of allowed characters to help those
having to implement it.

* clarified that http.Header in go internally uses textproto.MIMEHeader.

[ci skip]
2020-09-05 19:06:55 -05:00
Matthias Hanel
d6ab6799b4 Fixing unit test
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-04 17:14:51 -04:00
Matthias Hanel
a3c5fd4575 Updating jetstream account settings from jwt
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-04 16:07:38 -04:00
Waldemar Quevedo
9c210284a4 Merge pull request #1584 from wallyqs/leaf-remote-conf-check
Add more config checks for leafnode remotes
2020-09-04 08:35:19 -07:00
Waldemar Quevedo
3161cb1693 Add more config checks for leafnode remotes
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-09-04 00:34:40 -07:00
Matthias Hanel
3954030abf [FIXED] Error when importing an account results in an error, retry later (#1578)
* [FIXED] Error when importing an account results in an error

When the account that could not be imported is updated, update the
original account as well.

Fixes #1582

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-09-03 13:57:06 -06:00
Derek Collison
959b35a775 Merge pull request #1581 from nats-io/js_interest_only
JetStream fixes for InterestPolicy retention
2020-09-03 12:19:40 -07:00
Derek Collison
bcbf28fb3a Make sure to clear messages from stream when consumer deleted
Signed-off-by: Derek Collison <derek@nats.io>
2020-09-03 11:41:14 -07:00
Ivan Kozlovic
da546c2dce Merge pull request #1577 from nats-io/dn-match
[FIXED] Better support for distinguishedNameMatch in TLS Auth
2020-09-03 09:57:28 -06:00
Derek Collison
2ba9c97f3d Fix test flapper
Signed-off-by: Derek Collison <derek@nats.io>
2020-09-03 07:54:07 -07:00
Waldemar Quevedo
57f2c74d62 Better support for distinguishedNameMatch in TLS Auth
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-09-03 00:52:50 -07:00
Derek Collison
3faa2e7637 Fix for #1580
Signed-off-by: Derek Collison <derek@nats.io>
2020-09-02 17:18:28 -07:00
Derek Collison
cdbea93a87 Interest based retention should not store if no consumers present.
Fix for https://github.com/nats-io/jetstream/issues/314

Signed-off-by: Derek Collison <derek@nats.io>
2020-09-02 16:04:38 -07:00
Derek Collison
d794616945 Merge pull request #1576 from nats-io/timezone
Convert current time into time for locale before usage
2020-08-31 17:59:47 -05:00