Commit Graph

1934 Commits

Author SHA1 Message Date
Derek Collison
bfef3bd5a6 Fix for service import processing across routes for leaf nodes
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-17 14:37:09 -07:00
Ivan Kozlovic
bda267ec2c Add LeafNode import/export test with routes
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-16 19:26:28 -06:00
Derek Collison
a67fd1bc1a Merge pull request #938 from nats-io/gomod
Update to gomod with vendor directory, update vendored pkgs
2019-04-09 18:04:02 -07:00
Derek Collison
0f98b1506f Update to gomod with vendor directory, update vendored pkgs
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-09 17:41:57 -07:00
Ivan Kozlovic
064b3441cc Merge pull request #937 from nats-io/add_warning_if_cluster_insecure
Add a warning if cluster's insecure setting is enabled
2019-04-09 18:18:31 -06:00
Ivan Kozlovic
4dd1b26cc5 Add a warning if cluster's insecure setting is enabled
For cluster, we allow to skip hostname verification from certificate.
We now print a warning when this option is enabled, both on startup
or if the property is enabled on config reload.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-09 17:37:53 -06:00
Ivan Kozlovic
58b21e392c Merge pull request #935 from nats-io/fix-mkpasswd
[FIXED] mkpasswd utility on Windows
2019-04-09 17:24:10 -06:00
Ivan Kozlovic
031267dfd6 Merge pull request #936 from nats-io/leafnode_get_random_ip
LeafNode: do hostname resolution and get random one from result
2019-04-09 17:07:15 -06:00
Colin Sullivan
44fc27f1d0 Fix mkpasswd on windows
Signed-off-by: Colin Sullivan <colin@synadia.com>
2019-04-09 16:41:37 -06:00
Ivan Kozlovic
515ca5e70f LeafNode: do hostname resolution and get random one from result
This is similar to what we do with Gateways.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-09 16:33:19 -06:00
Ivan Kozlovic
98161722dc Merge pull request #930 from nats-io/route_send_subs_go_routine_threshold
Conditional send of routed subs from a go routine
2019-04-08 14:03:41 -06:00
Ivan Kozlovic
a6aeed3a6b Move unlock/gosched/lock in flushOutbound
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-08 13:57:23 -06:00
Ivan Kozlovic
c191eadc41 Merge pull request #932 from nats-io/leafnode_advertise
LeafNode: support for advertise
2019-04-08 11:29:51 -06:00
Ivan Kozlovic
6b1918efb4 LeafNode: support for advertise
A server that creates a LeafNode connection to a remote cluster
will now be notified of all possible LeafNode URLs in that cluster.
The list is updated when nodes in the cluster come and go.

Also support for advertise address, similar to cluster, gateway, etc..

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-08 10:54:39 -06:00
Ivan Kozlovic
2a86112a30 Conditional send of routed subs from a go routine
When a route is established, it is possible that each server sends
its list of subscriptions to each other at the same time. Doing
it in place from the readLoop could then cause problems because
each side could reach a point where the outbound socket buffer
is full and no one is dequeuing data (since readLoop is doing
the send of the subs list).
We changed sending this list from a go routine. However, for small
number of subscriptions, it is not required and was causing some
of the tests to fail because of timing issues.

We will now send in place if the estimated size of all protocols
is below a give threshold (1MB).

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-03-26 17:21:33 -06:00
Derek Collison
9daf6427ea Merge pull request #928 from nats-io/leafnodes
Basic Leafnode support.
2019-03-26 10:18:31 -07:00
Derek Collison
25f51884a2 add route map updates back in
Signed-off-by: Derek Collison <derek@nats.io>
2019-03-26 09:50:53 -07:00
Derek Collison
19c4ccecb8 Better handling of inline info, bug fix for gw and leafnode interest ref count
Signed-off-by: Derek Collison <derek@nats.io>
2019-03-25 15:15:11 -07:00
Ivan Kozlovic
81eb065391 Ensure leafnode listen port set to -1 does not prevent config reload
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-03-25 15:04:52 -06:00
Ivan Kozlovic
540b9be8e5 Reworked gateway processing of RS+ and RS-
Invoke updateInterestForAccountOnGateway() as a defer after all
locks have been released.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-03-25 14:04:34 -06:00
Derek Collison
499f67ff28 Remove defaultPerms processing per PR comment
Signed-off-by: Derek Collison <derek@nats.io>
2019-03-25 12:10:17 -07:00
Derek Collison
92f9f7ed56 Fixes for comments
Signed-off-by: Derek Collison <derek@nats.io>
2019-03-25 11:48:22 -07:00
Derek Collison
bacb73a403 First pass at leaf nodes. Basic functionality working, including gateways.
What is not completed:
1. TLS
2. config to bind local account.
3. Info updates for solicitor to track topology changes like a client.
4. CONNECT sent after INFO for nonce authroization.
5. Authorization
6. Services and Streams tests.
7. config file parsing.

Signed-off-by: Derek Collison <derek@nats.io>
2019-03-25 08:54:47 -07:00
Derek Collison
2ea470a963 Merge pull request #925 from nats-io/add_oleg_maintainer
Add Oleg Shaldibin as maintainer [ci-skip]
2019-03-22 08:14:19 -07:00
ainsley
394bddb6f4 Add Oleg Shaldibin as maintainer 2019-03-22 09:39:43 -05:00
Ivan Kozlovic
b804870e12 Merge pull request #924 from nats-io/ignore_custom_auth_in_relaod
[FIXED] Allow use of custom auth with config reload
2019-03-21 10:46:01 -06:00
Ivan Kozlovic
65cc218cba [FIXED] Allow use of custom auth with config reload
Resolves #923

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-03-20 15:45:17 -06:00
Ivan Kozlovic
04deabf27d Merge pull request #921 from nats-io/cluster_tls_insecure
[ADDED] Cluster tls insecure configuration
2019-03-11 15:25:18 -06:00
Alexei Volkov
83aefdc714 [ADDED] Cluster tls insecure configuration
Based on @softkbot PR #913.
Removed the command line parameter, which then removes the need for Options.Cluster.TLSInsecure.
Added a test with config reload.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-03-11 14:48:22 -06:00
Waldemar Quevedo
c625970909 Merge pull request #919 from nats-io/travis-updates
Add Go 1.12 to Travis
2019-03-06 20:37:46 -08:00
Waldemar Quevedo
7da8861e49 Add Go 1.12 to the build
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-03-06 16:05:49 -08:00
Ivan Kozlovic
0255390f80 Merge pull request #918 from nats-io/gw_updates
Gateways: some optimizations
2019-02-28 14:14:09 -07:00
Ivan Kozlovic
3e24d70ea4 Revert moving e.Lock()/e.Unlock()
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-02-28 14:01:53 -07:00
Ivan Kozlovic
ba748302c4 Gateways: some optimizations
Check sublist only when required.
Send the subs list in place instead of go routine (gateways have
different outbound/inbound connections so they don't suffer same
issue than routes)
Bump the default array size when collecting gateway connections

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-02-28 11:16:05 -07:00
Ivan Kozlovic
02d6d9f512 Merge pull request #916 from nats-io/gw_acc_sub_unsub
Gateways: Rework Account Sub/Unsub
2019-02-26 19:09:49 -07:00
Ivan Kozlovic
18399a3808 Gateways: Rework Account Sub/Unsub
We now send A- if an account does not exists, or if there is no
interest on a given subject and no existing subscription.
An A+ is sent if an A- was previously sent and a subscription
for this account is registered.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-02-26 18:34:30 -07:00
Derek Collison
f68f9b1060 Merge pull request #915 from huynq0911/fix_some_typos
Fix some typos
2019-02-24 22:20:07 -08:00
Derek Collison
c783d56c48 Merge pull request #914 from huynq0911/fix_http_https
Change http to https for security links
2019-02-24 22:19:23 -08:00
Nguyen Quang Huy
566d29d01e Fix some typos
Correct some words spelling for reading more easily.
2019-02-25 12:56:38 +07:00
Nguyen Quang Huy
d26323cb0f Change http to https for security links
For security, we should change http into https links.
Co-Authored-By: Nguyen Van Trung [trungnv@vn.fujitsu.com](mailto:trungnv@vn.fujitsu.com)
Signed-off-by: Nguyen Quang Huy [huynq@vn.fujitsu.com](mailto:huynq@vn.fujitsu.com)
2019-02-25 12:50:03 +07:00
Derek Collison
8362bda0bd Bump version [ci skip]
Signed-off-by: Derek Collison <derek@nats.io>
2019-02-20 18:04:07 -08:00
Derek Collison
28f14e5c97 Merge pull request #912 from nats-io/test_for_route_send_subs
Routes sending large subs and fan-in slow consumer fixes.
2019-02-20 13:27:16 -08:00
Derek Collison
69cdc02ebb Const for maxFlushPending
Signed-off-by: Derek Collison <derek@nats.io>
2019-02-20 13:13:29 -08:00
Derek Collison
0696d5a431 New fan-in logic
Reworked fan in logic. We do not hold locks during IO, either read or write.
On scenarios where we can get behind mostly due to fan-in from fast producers
we detect and create a stall channel. Once we catch up we close the stall channel
to release all blocked producers. Producers have an upper bound on how long
they will be stalled.

Signed-off-by: Derek Collison <derek@nats.io>
2019-02-20 12:09:26 -08:00
Ivan Kozlovic
04d824c4d4 [FIXED] Possible slow consumers when routes exchange sub list
If each server has a long list of subscriptions, when the route
is established, sending this list could result in each server
treating the peer as a slow consumer, resulting in a reconnect,
etc..
Also bumping the fan-in threshold for route connections.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-02-20 12:09:26 -08:00
Waldemar Quevedo
cf3f51f859 Merge pull request #909 from nats-io/verify-and-map-routes
Support for TLS certs based auth for routes/gateways
2019-02-19 14:34:20 -08:00
Waldemar Quevedo
4846b5ad6c Support for TLS certs based auth for gateways
When enabling verify and map as part of its TLS config
a the subject from TLS cert can now be used to confirm
the identity of a gateway.

```
gateway {
  tls {
    cert_file = "./configs/certs/tlsauth/server.pem"
    key_file = "./configs/certs/tlsauth/server-key.pem"
    ca_file = "./configs/certs/tlsauth/ca.pem"
    verify_and_map = true
    timeout = 2
  }

  authorization {
    user = "CN=localhost,OU=NATS.io Operators"
  }
}
```

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-02-18 21:48:06 -08:00
Waldemar Quevedo
01057467cf Support TLS based auth for routes
Similar as with clients, this makes it possible to
use the subject from a TLS certificate to validate
the permissions from a cluster member.

Currently only a single configured user is supported:

```
cluster {
  tls {
    cert_file = "./configs/certs/tlsauth/server.pem"
    key_file = "./configs/certs/tlsauth/server-key.pem"
    ca_file = "./configs/certs/tlsauth/ca.pem"
    verify_and_map = true
    timeout = 2
  }

  permissions {
    publish {
  	allow = ["public.>"]
    }
    subscribe {
  	allow = ["public.>"]
    }
  }

  authorization {
    user = "CN=localhost,OU=NATS.io Operators"
  }
}
```

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-02-18 17:12:09 -08:00
Waldemar Quevedo
fcf691c2dc Merge pull request #899 from wallyqs/verify-and-map-readme
Verify and map readme update
2019-02-18 12:44:09 -08:00
Derek Collison
36aa4a964e Merge pull request #908 from nmiculinic/introduceParserTypeSafety
Added type safety to Parser state
2019-02-18 09:06:51 -08:00