Commit Graph

1309 Commits

Author SHA1 Message Date
Ivan Kozlovic
22cff99e58 [Fixed] Profiling and Monitoring timeout issues
The http servers for those two were recently modified to set
a ReadTimeout and WriteTimeout. The WriteTimeout specifically
caused issues for Profiling since it is common to ask sampling
of several seconds. Pprof code would reject the request if it
detected that http server's WriteTimeout was more than sampling
in request.
For monitoring, any situation that would cause the monitoring code
to take more than 2 seconds to gather information (could be due
to locking, amount of objects to return, time required for sorting,
etc..) would also cause cURL to return empty response or WebBrowser
to fail to display the page.

Resolves #600
2017-11-08 14:58:10 -07:00
Ivan Kozlovic
92c4481d1b Merge pull request #601 from nats-io/update_go_version
Update Go version to 1.9.2
2017-11-08 10:16:39 -07:00
Ivan Kozlovic
24a422470a Update Go version to 1.9.2
Updated travis to use 1.8.5 and 1.9.2 and build/push release
for 1.9.2 release.
Updated Docker files too.
2017-11-08 10:06:44 -07:00
Ivan Kozlovic
c19527c03f Merge pull request #585 from wallyqs/process-pub-args-crlf
Remove check for '\r\n' when processing pub args
2017-10-17 08:59:43 -06:00
Ivan Kozlovic
a2d2327975 Merge pull request #580 from wallyqs/goto-parsesize
Remove for loop in parseSize to enable inlining
2017-10-17 08:57:44 -06:00
Ivan Kozlovic
12a5ced612 Merge pull request #593 from nats-io/prepare_for_next_release
Update README and version number for next release
v1.0.4
2017-09-27 11:11:30 -06:00
Ivan Kozlovic
d90dc55879 Update README and version number for next release 2017-09-25 13:14:48 -06:00
Ivan Kozlovic
b83c9d1ca4 Merge pull request #592 from nats-io/fix_unknown_cipher_name
[FIXED] Name of selected new cipher suites
2017-09-25 13:01:43 -06:00
Ivan Kozlovic
d4695d5e99 [FIXED] Name of selected new cipher suites
Use a map by id to return name of all supported ciphers. Use that
name to display the cipher name on handshake completion.

Resolves #591
2017-09-25 10:56:36 -06:00
Ivan Kozlovic
26ff94c21c Merge pull request #587 from RedShift1/master
Add systemd unit file
2017-09-25 09:44:02 -06:00
Glenn Matthys
89cbb9613c Remove PIDFile and implement Reload & Stop commands
Removes PIDFile (gnatsd doesn't create a pid file) and implements the
Reload and Stop service commands
2017-09-20 21:24:51 +02:00
Ivan Kozlovic
347798428d Merge pull request #576 from orus-io/custom_auth
[ADDED] Custom Authorization through Options
2017-09-20 11:40:49 -06:00
Tyler Treat
d19c7d0a7d Merge pull request #588 from nats-io/add-write_deadline
Add write_deadline configuration option [ci skip]
2017-09-18 16:58:22 -05:00
Colin Sullivan
8f3439fb3e Add write_deadline configuration option [ci skip] 2017-09-18 12:39:57 -06:00
Glenn Matthys
1415511cdf Add systemd unit file 2017-09-13 16:45:28 +02:00
Waldemar Quevedo
c8f151ef51 Remove check for '\r\n' when processing pub args
The parser has already dropped CRLF by when `processPub`
is called, so can skip doing the these checks there.
2017-09-11 14:21:58 -07:00
Ivan Kozlovic
c3e09519f9 Merge pull request #584 from nats-io/accept_error_level
[CHANGED] Client Accept error log level
2017-09-11 09:04:08 -06:00
Tyler Treat
4a6fd4317a Change client Accept error log level
This is an error users should know about. Thus, the log level should be
error.

Fixes #583
2017-09-11 09:14:10 -05:00
Waldemar Quevedo
cd86c99144 Remove for loop in parseSize to enable inlining
Using a goto based loop makes it become a leaf function which can be
inlined, making us get a slight performance increase in the fast path.
See: https://github.com/golang/go/issues/14768
2017-09-08 10:17:12 -07:00
Ivan Kozlovic
0c3d4ce7fa Merge pull request #573 from nats-io/fix_sublist_insert_remove
[FIXED] Sublist Insert and Remove with wildcard characters in literals
2017-09-08 10:12:54 -06:00
Ivan Kozlovic
114bd5ee1f Merge pull request #581 from nats-io/update_configure_options
Pass functions to ConfigureOptions to print version, help, tls help
2017-09-08 10:10:36 -06:00
Ivan Kozlovic
8b4a02dd9a Pass functions to ConfigureOptions to print version, help, tls help
This will allow NATS Streaming to provide its own version of what
should be printed when various flags are set.

Related to #578
2017-09-08 09:59:04 -06:00
Christophe de Vienne
28975f67bb Custom auth: Test both auth success & failure 2017-09-08 17:43:32 +02:00
Christophe de Vienne
b743f91107 Use GetOpts in CustomAuth tests
It increses code coverage, and makes sure GetOpts() behaves properly.
2017-09-08 11:29:26 +02:00
Christophe de Vienne
2b7cb173ff Set info.AuthRequired when CustomClientAuthentication is defined 2017-09-08 10:56:21 +02:00
Christophe de Vienne
e556854f54 Rename Custom*Auth to Custom*Authentication
Simplify and complete tests based on Ivan advice.
2017-09-08 10:54:20 +02:00
Tyler Treat
b58178d743 Merge pull request #579 from nats-io/check_parse_returned_error
Added error check for fs.Parse() call
2017-09-07 12:25:30 -05:00
Ivan Kozlovic
6ba9269cda Added error check for fs.Parse() call
This is just for tests since from main.go, the FlagSet is set
with ExitOnError so Parse() would call os.Exit(2).
Regardless, I wanted to add error checking and a test for that.

Related to #578
2017-09-07 10:37:46 -06:00
Christophe de Vienne
e366137b6c Add a test for CustomClientAuth 2017-09-07 17:59:59 +02:00
Ivan Kozlovic
dbe9bc79ee Merge pull request #578 from nats-io/add_configure_options
[FIXED] Override from command line not always working
2017-09-07 09:46:41 -06:00
Christophe de Vienne
b473674907 Add back custom Auth api
The removal of SetClientAuthMethod removed any possibility of providing
a custom auth backend.

This patch add it back as a Option attribute, so we can wait comfortably for #434,
which aims to provide more extensible external Auth.
2017-09-07 17:39:34 +02:00
Ivan Kozlovic
684a2e4173 Update based on code review 2017-09-07 09:06:37 -06:00
Ivan Kozlovic
379a14b8cc [FIXED] Override from command line not always working
There were some cases where override would not work. Any command
line parameter that would be set to the type default value (false
for boolean, "" for string, etc) would not be taken into account.

I moved all the flags parsing and options configuration into
a new function, which may help reduce code duplication in
NATS Streaming.

The other advantage of moving this in a function is that it
can now be unit tested.

I am also removing call to `RemoveSelfReference()` which attempted
to remove a route to self, which has been already solved at runtime
with detecting and ignoring a route to self.

This function would be invoked only when routes were defined in
the configuration file, not in the command line parameter.

Removing this call also solves an user issue (#577)

Resolves #574
Resolves #577
2017-09-06 17:31:53 -06:00
Ivan Kozlovic
8ec1f77ac8 [FIXED] Sublist Insert and Remove with wildcard characters in literals
This is similar to #561 where `*` and `>` characters appear in tokens
as literals, not wilcards.
Both Insert() and Remove() were checking that the first character
was `*` or `>` and consider it a wildcard node. This is wrong. Any
token that is more than 1 character long must be treated as a literal.
Only for token of size one should we check if the character is `*`
or `>`.
Added a test case for Insert and Remove with subject like `foo.*-`
or `foo.>-`.
2017-08-31 18:48:45 -06:00
Tyler Treat
c7fc87659a Merge pull request #572 from nats-io/perms_cache_fix
Fix permissions cache pruning
2017-08-31 15:19:25 -05:00
Tyler Treat
713b1c5722 Fix permissions cache pruning
We were pruning the wrong cache.
2017-08-31 14:00:30 -05:00
Ivan Kozlovic
7bb563df49 Merge pull request #570 from nats-io/update_travis_go_version
Update travis
2017-08-29 11:39:40 -06:00
Ivan Kozlovic
919512f07c Update travis 2017-08-29 11:26:41 -06:00
Sergey Sarbash
1ea25001a2 DOC: added a clarification about a token usage (#563)
* DOC: added a clarification about a token usage

* Minor edits, correction and example

- minor language edits
- corrected name of `util/mkpasswd.go` for all prior references to `util/mkpassword.go`
- gave example output from `util/mkpasswd.go` with comments referencing where to use pass vs bcrypt hash.
2017-08-28 11:13:45 -04:00
Ivan Kozlovic
4246f83c74 Merge pull request #567 from nats-io/add_arm_build
[ADDED] ARM64v8 Build
2017-08-25 14:51:58 -06:00
Ivan Kozlovic
3179575b15 Exclude megacheck for Go 1.9 for now 2017-08-25 09:59:11 -06:00
Ivan Kozlovic
049675088d [ADDED] ARM64v8 Release build
- Add linux/arm64 to cross compile script
- Update .travis.yml to push builds on Go 1.8.x version
- Update Dockerfile to Go 1.8.3
- Change Dockerfile.win64 to actually build all the builds that
  we would want to provide a Docker image for
2017-08-25 09:20:31 -06:00
Peter Miron
f2854ee461 increased tls timeout to get test passing on arm. (#566)
* increased tls timeout to get test passing on arm.

* fixed timeout to appropriate integer.
2017-08-24 19:36:07 -07:00
Ivan Kozlovic
10fd640aa4 Merge pull request #561 from nats-io/fix_issue_558
[FIXED] Use of `*` and `>` in subjects as literals
2017-08-24 20:26:12 -06:00
Ivan Kozlovic
2de6622fd0 Update MIT License Copyright data [ci skip] 2017-08-24 09:23:33 -06:00
Ivan Kozlovic
0cc49ece4a Improve matchLiteral further and add some more tests 2017-08-17 13:00:09 -06:00
Ivan Kozlovic
42b27d2710 Improve matchLiteral performance and simplify if conditions 2017-08-16 17:43:33 -06:00
Ivan Kozlovic
30eeac27e9 add matchLiteral benchmark 2017-08-16 16:28:24 -06:00
Ivan Kozlovic
515779ae0b [FIXED] Use of * and > in subjects as literals
The issue was that a subject such as `foo.bar,*,>` would be
inserted to the cache as is, but when trying to remove from the
cache, calling matchLiteral() with the above subject in the cache
against the same subject would return false. This is because
matchLiteral would treat those characters as wildcards token.

Note that the sublist itself splits subjects on the `.` separator
and seem not bothered by such subject (would have `foo` and `bar,*,>`
tokens). Also, note that IsValidSubject() and IsValidLiteralSubject()
properly checked that the characters `*` and `>` are treated
as wildcards only if they are tokens on their own.

Resolves #558
2017-08-16 12:12:18 -06:00
Peter Miron
050049c2c7 Merge pull request #556 from nats-io/doc-string-escape
Document string escape behavior [ci skip]
2017-08-16 12:16:36 -04:00