14 Commits

Author SHA1 Message Date
Ivan Kozlovic
91bdcc30cc [FIXED] Server version check
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-03-25 12:11:55 -06:00
Phil Pennock
fc6df0fbbc Redact URLs before logging or returning in error (#2643)
* Redact URLs before logging or returning in error

This does not affect strings which failed to parse, and in such a scenario
there's a mix of "which evil" to accept; we can't sanely find what should be
redacted in those cases, so we leave them alone for debugging.

The JWT library returns some errors for Operator URLs, but it rejects URLs
which contain userinfo, so there can't be passwords in those and they're safe.

Fixes #2597

* Test the URL redaction auxiliary functions

* End-to-end tests for secrets in debug/trace

Create internal/testhelper and move DummyLogger there, so it can be used from
the test/ sub-dir too.

Let DummyLogger optionally accumulate all log messages, not just retain the
last-seen message.

Confirm no passwords logged by TestLeafNodeBasicAuthFailover.

Change TestNoPasswordsFromConnectTrace to check all trace messages, not just the
most recent.

Validate existing trace redaction in TestRouteToSelf.

* Test for password in solicited route reconnect debug
2021-10-27 12:44:59 -04:00
R.I.Pienaar
1d4f6402ba unexported import of Comma function from humanize 2020-05-19 14:16:03 -07:00
Andy Xie
79c6f9e884 enhance ut for server 2019-01-18 10:54:04 +08:00
Ivan Kozlovic
b1bb181f3d Ensure URLs are compared using reflect.DeepEqual
I don't think it is a good thing to compare the pointers and we
should use the DeepEqual instead.
When comparing a solicited route's URL to the URL that was created
during the parsing of the configuration, the pointers maybe the
same and so u1 == u2 would work. However, there are cases where
the URL is built on the fly based on the received route INFO protocol
so I think it is safer to use a function that does a reflect.DeepEqual
instead.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-16 09:48:32 -06:00
Derek Collison
00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Ivan Kozlovic
acf4a31e4b Major updates + support for config reload of client/cluster advertise 2018-02-05 20:15:36 -07:00
Colin Sullivan
6281894cc5 Add staticcheck static analyzer to travis.
Included are small fixes to address warnings found in test code.  No functional changes.
2016-10-27 09:51:15 -06:00
Derek Collison
0a02aab703 simplify and test for non-optimization 2016-03-07 06:58:48 +00:00
Derek Collison
d09b6bdcf7 Optimize last activity and revert queue performance to alleviate normal sub performance hit 2016-03-07 06:24:23 +00:00
Derek Collison
19f2427c10 additional test coverage 2015-06-16 09:08:03 -07:00
Derek Collison
cd56514808 pass by address 2014-04-25 13:18:50 -06:00
Derek Collison
2141cc7381 bad copy of file 2014-04-25 13:11:58 -06:00
Derek Collison
de4e748b2e Added perf test for defers and parseInt 2014-04-25 11:26:07 -07:00