Commit Graph

3142 Commits

Author SHA1 Message Date
R.I.Pienaar
cd376aa753 Do not ack to AckNxt
This causes nil messages mid content stream and is confusing,
the test for this is amended to test the content received for
validity - where previously the test assumed any content is
good content but in fact it only received half the content.

Removing this behaviour until we can design this properly

Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-09-21 17:28:53 +02: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
Matthias Hanel
40e4659f25 Convert current time into time for locale before usage
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-08-31 18:46:26 -04:00
Ivan Kozlovic
5671e76130 Merge pull request #1575 from nats-io/locale
Support locale for times in user jwt
2020-08-28 14:26:18 -06:00
Matthias Hanel
b02b6215b6 Support locale for times in user jwt
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-08-28 16:01:00 -04:00
Ivan Kozlovic
c76dd8f673 Merge pull request #1573 from nats-io/noopjwt
Discard client provided jwt when not in operator mode
2020-08-28 13:59:35 -06:00
Matthias Hanel
cc14e54179 Discard client provided jwt when not in operator mode
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-08-28 12:31:02 -04:00
Ivan Kozlovic
c10779d2e7 Merge pull request #1574 from nats-io/updatejwt
Update JWT and incorporate change of cidr ranges from string to array
2020-08-28 09:07:13 -06:00
Matthias Hanel
431560b004 Update JWT and incorporate change of cidr ranges from string to array
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-08-27 23:11:54 -04:00
Ivan Kozlovic
6d06e393ee Merge pull request #1570 from nats-io/limits
Adding user jwt payload and subscriber limits
2020-08-25 09:59:51 -06:00
Matthias Hanel
846b2b5ce0 Fix flapping test and limit channel recv when there is an error
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-08-25 00:36:14 -04:00
Matthias Hanel
9d1526cbb8 Adding user jwt payload and subscriber limits
Addresses part of #1552

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-08-24 18:16:25 -04:00
Ivan Kozlovic
8c60b10d5f Merge pull request #1553 from bfoxstudio/feature/monitoring_proxy
fix absolute url in monitoring menu
2020-08-24 13:31:27 -06:00
Ivan Kozlovic
fc35bdded8 Merge pull request #1568 from nats-io/updatejwt
Update jwtv2 and fix test that embedded jwtv2 operators
2020-08-24 13:19:00 -06:00
Matthias Hanel
6bfa25376d Removing blank line from imports 2020-08-24 11:49:50 -04:00