Validation code in place, how to display?
Take existing queue count into consideration
Server-side validation takes existing queue count into consideration. Improve error message sent back to web application.
Improve messaging, remove unused template
Take existing queues into account when importing definitions for all vhosts. Fix test suite.
... instead of polling it once after 200 ms. This was failing from time
to time because of that timer:sleep() was sometimes too short.
Signed-off-by: Karl Nilsson <knilsson@pivotal.io>
This header is required for its `amqp_msg` record.
rabbit_framing.hrl should be included too, for all the AMQP method
records, but it is already included from amqp_client.hrl and
rabbit_framing.hrl doesn't protect itself against multiple inclusions.
This commit fixes the build of the testsuite after the move of
rabbit_mgmt_test.hrl to rabbitmq-ct-helpers.
Reversing initial fix in 47a5ea7b1c
Usages of `with_decode` closed over the ReqData and returned the
instance before the bode decode. This had the effect of causing an error
after a POST or PUT request had been issues on the same keep-alive
connection.
Samples didn't match averages as were reporting total times. Also,
rates do not make sense on time per operation so are all replaced
by the average.
rabbitmq-management#384
[#144393857]
One of the low-hanging fruits in HTTP API optimization.
E.g. serializing information about 10000 queues:
- For JSON it takes 2 seconds on my machine and more than 1GB of RAM
- For BERT it takes 0.2 seconds and negligible amount of RAM
... instead of using binary_to_list() on <<<"ööö"/utf8>>.
Erlang R16B03 took the "ö" individual bytes (from the two-byte encoded
UTF-8 character) and converted them to UTF-8. The queue was created with
the correct name because the correct UTF-8 string was passed to Python
and later to the management API. But because of the wrong conversion of
the expected queue name, the verification failed.
`>` is unallowed in URI path segments according to RFC 3986. This
character must be percent-encoded.
Newer versions of Cowboy are stricter about this.
[#136779967]
(cherry picked from commit 85128761eb)
We must use `-include().` for a local file, not `-include_lib().`. Also,
fix the path to the header itself.
Reported by Syntastic.
(cherry picked from commit e09f94efc9)
`>` is unallowed in URI path segments according to RFC 3986. This
character must be percent-encoded.
Newer versions of Cowboy are stricter about this.
[#136779967]
Previously when no password or password hash were provided, a user with
generated credentials was created with the intent to later update
the user's credentials. Should anything fail after that, the user record
would be "leaked." The tests we had turned a blind eye on that scenario.
Credentials are never sent with preflight requests, and preflight
requests are only accepted if they return successfully (eg 200).
We returned a 401 when credentials were missing so browsers rejected
the response.
Credentials are never sent with preflight requests, and preflight
requests are only accepted if they return successfully (eg 200).
We returned a 401 when credentials were missing so browsers rejected
the response.
Two new options: cors_allow_origins and cors_max_age.
* cors_allow_origins: list of origins allowed, for example
["http://rabbitmq.com", "http://pivotal.com"];
or ["*"] to allow everything.
* cors_max_age: time in seconds that clients may cache
preflight requests. It defaults to 30 minutes.
This also fixes an issue with compressed replies where
"accept-encoding" was not added to the "vary" header.
(cherry picked from commit d10ed61736)
As part of a push to reduce the number of dependencies from the
RabbitMQ project, the management plugin needed to be converted
from Webmachine to Cowboy REST.
Most of this commit is about the conversion from Webmachine to
Cowboy. The main differences are in the POST handling where Cowboy
and Webmachine differ, but also in the conversion from string to
binary as Webmachine uses the former and Cowboy the latter.
The logging mechanism has been moved to the Web Dispatch plugin.
The mochiweb_util has been added for now, as it is currently still
required for some functionality missing from Cowboy. It can be
refactored out in the future.
The responses to POST and PUT requests may give a different result
under Cowboy compared to Webmachine. In particular, where Webmachine
used to return 204 No Content for all PUT requests, Cowboy may
return either 201 Created or 204 No Content. The test suite had to
be heavily updated to take this into account, but most clients will
have no problem with it since they only check for 2xx. And more
information can be considered a definite improvement.
(cherry picked from commit 242843ac9c)
Squashed commit of the following:
commit b104a7f84474e247dfef27cd389d6fac554ab634
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Thu Jun 23 18:14:28 2016 +0300
Finish migration to CT
Note: this intentionally deletes several tests that depend on ETS
table state and clash with "real" stats GC processes running in parallel.
Some of them are covered in other test suites, e.g. rabbit-hole, others
can only really be tested with a separate simulation test suite.
Per discussion with the team.
commit 7585883e0f9432fd3360d18d340bcf599ad8d51f
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Thu Jun 23 15:50:53 2016 +0300
Down to 3 failing tests
commit 3243f0efed7033229803404a431c1c6404c25677
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Tue Jun 21 01:02:42 2016 +0300
Attempts to simplify a few tests for CT
commit 997c2b3782b4ce38708658dc90883980a267a461
Merge: 122c7b7 0ce4f6b
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Fri Jun 17 14:45:06 2016 +0300
Merge branch 'stable' into common_test
commit 122c7b7116778e9aff244822933eaf95567dc59d
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Thu Jun 16 18:19:28 2016 +0300
Begin porting test_db_SUITE
commit 872f3e82966999cebd8ba966daac9410badaca09
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Thu Jun 16 13:54:34 2016 +0300
Makes clustering_SUITE pass
commit c8d6c89bda6e7571877221ed6b2513e53b1ebc46
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Thu Jun 16 03:48:54 2016 +0300
Towards clustering_SUITE
commit 7fcb6c834039d6cdf15371ce8640f6dfd9bdf939
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Thu Jun 16 02:59:24 2016 +0300
Initial clustering_SUITE test passes
commit 11205579e86bad4563e027d025b94f0e57ee8386
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Thu Jun 16 02:59:12 2016 +0300
Add mochiweb to test dependencies
commit 895ff82e6e6567336c2ac56532f82427a2c4f705
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Thu Jun 16 01:09:46 2016 +0300
Refactor
commit 6d9200cc8516ee5ea0676fbb0e9b3c88fb2a40a7
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Thu Jun 16 00:55:08 2016 +0300
open_unmanaged_connection/1 is now available in rabbit_ct_client_helpers
commit 40d03cd2fa2a6bc1d4c7c4a1eeb332c5182e1317
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Wed Jun 15 23:51:31 2016 +0300
All http_SUITE tests now pass
commit 81e08ef36a08884c02fabd51662018751035b5b6
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Wed Jun 15 17:12:27 2016 +0300
More tests pass with Common Test
commit aaea771db14624df0db944b4c4d0eb42191fb961
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Tue Jun 14 17:41:09 2016 +0300
Continue adapting to Common Test
commit 0a57f3256a828a835ce44ef02b2e93a3cfe34ccf
Author: Michael Klishin <michael@clojurewerkz.org>
Date: Tue Jun 14 15:28:19 2016 +0300
Begin moving test suite to Common Test
Two new options: cors_allow_origins and cors_max_age.
* cors_allow_origins: list of origins allowed, for example
["http://rabbitmq.com", "http://pivotal.com"];
or ["*"] to allow everything.
* cors_max_age: time in seconds that clients may cache
preflight requests. It defaults to 30 minutes.
This also fixes an issue with compressed replies where
"accept-encoding" was not added to the "vary" header.
Two new options: cors_allow_origins and cors_max_age.
* cors_allow_origins: list of origins allowed, for example
["http://rabbitmq.com", "http://pivotal.com"];
or ["*"] to allow everything.
* cors_max_age: time in seconds that clients may cache
preflight requests. It defaults to 30 minutes.
The querying of the metrics from the UI uses a 5 sec windows to return
the rate, stats older than that are considered old and the instant rate
returned as 0.0. It could be the case that on very slow queries, many
thousands of items (over 50k queues in a new 2015 MacBook), the response
time is over 5 seconds and thus some rates could be reported as 0.0 if the
Now timestamp is collected in advance. Note that this behaviour hasn't been
confirmed.
As part of a push to reduce the number of dependencies from the
RabbitMQ project, the management plugin needed to be converted
from Webmachine to Cowboy REST.
Most of this commit is about the conversion from Webmachine to
Cowboy. The main differences are in the POST handling where Cowboy
and Webmachine differ, but also in the conversion from string to
binary as Webmachine uses the former and Cowboy the latter.
The logging mechanism has been moved to the Web Dispatch plugin.
The mochiweb_util has been added for now, as it is currently still
required for some functionality missing from Cowboy. It can be
refactored out in the future.
The responses to POST and PUT requests may give a different result
under Cowboy compared to Webmachine. In particular, where Webmachine
used to return 204 No Content for all PUT requests, Cowboy may
return either 201 Created or 204 No Content. The test suite had to
be heavily updated to take this into account, but most clients will
have no problem with it since they only check for 2xx. And more
information can be considered a definite improvement.