Commit Graph

2294 Commits

Author SHA1 Message Date
Ivan Kozlovic
d20f76cbaa Merge pull request #1166 from nats-io/add_servername_to_routestat
[ADDED] Server name in the RouteStat for statsz
2019-10-28 13:19:53 -06:00
Ivan Kozlovic
6fe6b14a04 Merge pull request #1167 from nats-io/route_proto_for_tests
Changes on how tests can override route protocol
2019-10-26 12:16:23 -06:00
Ivan Kozlovic
5a44e3b4c6 Changes on how tests can override route protocol
I may need to introduce a new route protocol version for an upcoming
PR and realized that this needed some cleaning.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-10-26 10:12:30 -06:00
Ivan Kozlovic
12eb1f5b00 [ADDED] Server name in the RouteStat for statsz
Add the remote server name for a route in the statsz event

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-10-25 16:34:07 -06:00
Ivan Kozlovic
22c927a409 Merge pull request #1165 from nats-io/fix_gw_not_using_new_urls
[FIXED] Explicit gateway not using discovered URLs
2019-10-24 17:10:53 -06:00
Ivan Kozlovic
75ec78c232 [FIXED] Explicit gateway not using discovered URLs
If cluster A configures a gateway to cluster B, the server on A
tries to connect to that server URL. If there is no server on B
at that address, but a server on B with different address connects
to server on cluster A, that server should be able to create its
outbound connection in response.
That was not the case because the configured URLs were snapshot
before the loop of trying to connect. When accepting an inbound
connection and updating the array, this new URL was not being used.

The issue is only if the server on A had no outbound connection
at that time.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-10-24 16:40:38 -06:00
Ivan Kozlovic
d304c9b1e8 Merge pull request #1164 from nats-io/fix_account_nil_dereference
Fixed nil dereference reported by staticcheck
2019-10-24 16:17:42 -06:00
Ivan Kozlovic
27ee8b80e3 Fixed nil dereference reported by staticcheck
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-10-24 15:07:06 -06:00
Derek Collison
daabd4dfde Merge pull request #1158 from ripienaar/1153.hostname
Allows a descriptive server_name to be set
2019-10-17 10:31:41 -07:00
R.I.Pienaar
bcf96fa1de Allows a descriptive server_name to be set
This adds a new config option server_name that
when set will be exposed in varz, events and more
as a descriptive name for the server.

If unset though the server_name will default to the pk

Signed-off-by: R.I.Pienaar <rip@devco.net>
2019-10-17 18:51:19 +02:00
Derek Collison
1e78d91c62 Merge pull request #1161 from nats-io/certs
Update the test CA and certs.
2019-10-17 08:33:45 -07:00
Derek Collison
35758ef7d4 Update the test CA and certs.
Expiration is now Oct 14 14:30:41 2029 GMT

Signed-off-by: Derek Collison <derek@nats.io>
2019-10-17 07:33:08 -07:00
Derek Collison
9ec4efa12b Merge pull request #1160 from nats-io/bug
Fix for panic on #1159, do not allow wildcards in stream import prefix
2019-10-16 10:48:10 -07:00
Derek Collison
9192a1f43c Fix for panic on #1159, do not allow wildcards in stream import prefix
Signed-off-by: Derek Collison <derek@nats.io>
2019-10-16 10:29:13 -07:00
Derek Collison
116ae2a9c2 Merge pull request #1157 from beautytiger/dev-191015-trim
fix string trim func usage in pse
2019-10-15 09:11:29 -07:00
Guangming Wang
9a003ba042 fix string trim func usage in pse
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-10-15 23:55:13 +08:00
Ginger Collison
c155be5700 Merge pull request #1156 from nats-io/update_slack_url
update Slack url link
2019-10-14 10:01:28 -05:00
Derek Collison
31590791b6 Merge pull request #1154 from nats-io/mc
Account support for Connz and user or account filtering
2019-10-11 10:55:49 -07:00
Derek Collison
7cb6056a94 Account support for Connz and user or account filtering
1. Accounts will show up in connection info if auth=1.
2. You can filter by user (?auth=1&user=ivan) or account (?auth=1&acc=eng)

Signed-off-by: Derek Collison <derek@nats.io>
2019-10-11 10:22:08 -07:00
Ginger Collison
263610dd3b update Slack url link 2019-10-11 09:33:55 -05:00
Derek Collison
0a0ff2a8ac Merge pull request #1148 from nats-io/add-tilde-support
Add tilde support for leafnode credentials
2019-10-02 14:57:56 -07:00
Jaime Piña
f62f6bda70 Add tilde support for leaf node credentials
Signed-off-by: Jaime Piña <jaime@synadia.com>
2019-10-02 13:30:09 -07:00
Ivan Kozlovic
fac004cfe3 Merge pull request #1147 from nats-io/fix_leafnode_auth
[ADDED] Basic auth for leafnodes
2019-10-01 11:43:08 -06:00
Ivan Kozlovic
18a1702ba2 [ADDED] Basic auth for leafnodes
Added a way to specify which account an accepted leafnode connection
should be bound to when using simple auth (user/password).

Singleton:
```
leafnodes {
  port: ...
  authorization {
    user: leaf
    password: secret
    account: TheAccount
  }
}
```
With above configuration, if a soliciting server creates a LN connection
with url: `nats://leaf:secret@host:port`, then the accepting server
will bind the leafnode connection to the account "TheAccount". This account
need to exist otherwise the connection will be rejected.

Multi:
```
leafnodes {
  port: ...
  authorization {
    users = [
      {user: leaf1, password: secret, account: account1}
      {user: leaf2, password: secret, account: account2}
    ]
  }
}
```
With the above, if a server connects using `leaf1:secret@host:port`, then
the accepting server will bind the connection to account `account1`.

If user/password (either singleton or multi) is defined, then the connecting
server MUST provide the proper credentials otherwise the connection will
be rejected.

If no user/password info is provided, it is still possible to provide the
account the connection should be associated with:
```
leafnodes {
  port: ...
  authorization {
    account: TheAccount
  }
}
```
With the above, a connection without credentials will be bound to the
account "TheAccount".

If credentials are used (jwt, nkey or other), then the server will attempt
to authenticate and if successful associate to the account for that specific
user. If the user authentication fails (wrong password, no such user, etc..)
the connection will be also rejected.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-09-30 19:42:11 -06:00
Ivan Kozlovic
4a9040e8eb Merge pull request #1143 from nats-io/q-sub-perms
Add QueueSubscribe permissions
2019-09-27 17:46:37 -06:00
Jaime Piña
78966fbfa4 Reduce 2019-09-27 16:38:43 -07:00
Jaime Piña
64664946e7 Add QueueSubscribe permissions.
```
users = [
  {
    user: "foo", permissions: {
      sub: {
        # Allow plain subscription foo, but only v1 groups or *.dev queue groups
        allow: ["foo", "foo v1", "foo v1.>", "foo *.dev"]

        # Prevent queue subscriptions on prod groups
        deny: ["> *.prod"]
     }
  }
]
```

Signed-off-by: Jaime Piña <jaime@synadia.com>
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-09-27 16:08:24 -07:00
Ivan Kozlovic
8fe2479740 Merge pull request #1140 from nats-io/detect_duplicate_service_import_to_subject
[FIXED] Reject duplicate service import "to" subject
2019-09-23 08:52:38 -06:00
Ivan Kozlovic
3600accb79 [FIXED] Reject duplicate service import "to" subject
Report error from configuration parsing, and also return error
in AddServiceImport() (and its variants).

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-09-20 16:30:13 -06:00
Ivan Kozlovic
1cc5ae0eba Merge pull request #1139 from nats-io/release_2_1_0
Release v2.1.0
v2.1.0
2019-09-20 12:33:04 -06:00
Ivan Kozlovic
802074292f Release v2.1.0
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-09-20 12:19:27 -06:00
Derek Collison
3557fd27a8 Merge pull request #1138 from nats-io/jwt
Updated JWT dependency
2019-09-20 10:15:07 -07:00
Derek Collison
fccf147898 Updated JWT dependency
Signed-off-by: Derek Collison <derek@nats.io>
2019-09-20 10:13:09 -07:00
Waldemar Quevedo
d44b0dec51 Merge pull request #1136 from nats-io/svc-latency-values
Adjust to zero negative latency values
2019-09-20 11:39:33 -05:00
Waldemar Quevedo
d0e36f3b88 Adjust to zero negative latency values
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-09-20 09:24:18 -07:00
Derek Collison
ffdbe864a8 Version bump
Signed-off-by: Derek Collison <derek@nats.io>
2019-09-19 19:50:03 -07:00
Derek Collison
37a5612460 Merge pull request #1137 from nats-io/latency_update
Latency tracking updates
2019-09-19 19:48:53 -07:00
Derek Collison
0360f46c2f fixes based on PR updates
Signed-off-by: Derek Collison <derek@nats.io>
2019-09-19 17:16:36 -07:00
Ivan Kozlovic
0419fd5815 Merge pull request #1135 from nats-io/fix_response_perms
Fixed ResponsePermissions
2019-09-19 16:13:41 -06:00
Derek Collison
7fe47ace2b Make sure to turn latency on with a claim update
Signed-off-by: Derek Collison <derek@nats.io>
2019-09-19 14:20:35 -07:00
Ivan Kozlovic
731941a18f Fixed ResponsePermissions
- Ensure that defaults are set when values are 0
- Fixed some tests
- Added some helpers in jwt tests to reduce copy/paste

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-09-19 14:42:38 -06:00
Ivan Kozlovic
256ad4ac15 Bump version to 2.1.0-RC1
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-09-18 14:26:42 -06:00
Derek Collison
adbe569a04 Merge pull request #1130 from nats-io/add-latency-config
Expose service latency info in config file
2019-09-18 13:22:11 -07:00
Jaime Piña
ab24cddc06 Add latency config
Currently, the config file doesn't recognize the latency config block in
account exports. This change exposes those settings in the config file.

Signed-off-by: Jaime Piña <jaime@synadia.com>
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-09-18 13:20:26 -07:00
Ivan Kozlovic
6a70f36e09 Merge pull request #1131 from nats-io/fix_acc_lookup
[FIXED] Locking issue around account lookup/updates
2019-09-18 12:59:28 -06:00
Derek Collison
43324271ca Friendly version 2019-09-18 11:58:36 -07:00
Derek Collison
25c04069fd Merge pull request #1133 from nats-io/http
Use multiple connections to amortize TLS
2019-09-18 11:51:44 -07:00
Ivan Kozlovic
20a925ae86 Updates to registerAccount
Make it a function that grabs server lock/unlock and invokes
registerAccountNoLock(). Use that function when already under
the server's lock.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-09-18 12:45:12 -06:00
Derek Collison
7cf211b056 Use multiple connections to amortize TLS
Signed-off-by: Derek Collison <derek@nats.io>
2019-09-18 11:40:00 -07:00
Derek Collison
fe3c0b03be Update to project ID 2019-09-18 10:50:08 -07:00