Commit Graph

1905 Commits

Author SHA1 Message Date
Michael Klishin b1d3053692
One more conflict resolution #10647 2024-02-29 16:06:43 -05:00
Michael Klishin 7ec2831983
Manually re-apply #10647 by @johanrhodin 2024-02-29 15:57:55 -05:00
Marcial Rosales c9d7c2449f
Fix test when idp is down 2024-02-29 15:14:49 -05:00
Marcial Rosales 23a024f8c8
Fix issue looking up logout button 2024-02-29 15:14:49 -05:00
Marcial Rosales 5f23a5c458
Warn when some oauth resource is not available 2024-02-29 15:14:46 -05:00
Marcial Rosales 1d2a5e0f1b
Show warning messages and disable resources
which are not available
2024-02-29 15:14:46 -05:00
Marcial Rosales 05dacfacc4
Use resource's id as label
when label is not configured
2024-02-29 15:14:44 -05:00
Marcial Rosales 4d6c808844
Simplify auth_settings
just an array of oauth_resource_servers
regardless whether we have just resource_server_id
or many resource servers
2024-02-29 15:14:39 -05:00
Marcial Rosales 122d4bdaec
Fix issue initialzing logon_type 2024-02-29 15:14:39 -05:00
Marcial Rosales 23557a7706
Configure uaa with Cors and
fix issue initializing client_secret
2024-02-29 15:14:39 -05:00
Marcial Rosales 7b4d663967
Fix schema issue 2024-02-29 15:14:38 -05:00
Marcial Rosales 081335e84c
Add prefix oauth to all resource server settings 2024-02-29 15:14:38 -05:00
Marcial Rosales 98ac1d39d0
Complete coverage of authSettings 2024-02-29 15:14:38 -05:00
Marcial Rosales 26669c1d42
Reimplement how authSettings is calculated
WIP rename and simplify test cases
2024-02-29 15:14:37 -05:00
Marcial Rosales 34b3b1248e
Create Oauth2 client 2024-02-29 15:14:34 -05:00
Karl Nilsson 5b0faf5d8c
Streams: Soft remove policy configuration of max_segment_size_bytes
This configuration is not guaranteed to be safe to change after a stream has bee n
declared and thus we'll remove the ability to change it after the initial
declaration. Users should favour the x- queue arg for this config but it will still
be possible to configure it as a policy but it will only be evaluated at
declara tion time.

This means that if a policy is set for a stream that re-configures the
`stream-m ax-segment-size-bytes` key it will show in the UI as updated but
the pre-existing stream will not use the updated configuration.

The key has been removed from the UI but for backwards compatibility it is still
 settable.

NB: this PR adds a new command `update_config` to the stream coordinator state
machine. Strictly speaking this should require a new machine version but we're by
passing that by relying on the feature flag instead which avoids this command
being committed before all nodes have the new code version. A new machine version
can lower the availability properties during a rolling cluster upgrade so in
this case it is preferable to avoid that given the simplicity of the change.
2024-02-29 15:14:33 -05:00
Michael Klishin a68eec6a29
Drive-by change: naming 2024-02-29 15:14:26 -05:00
Diana Parra Corbacho 226c45748a
Allow management users to query feature flags and deprecated features
The new banner to warn about not-enabled feature flags requires access
to this endpoint, and it must be visible for all users.
2024-02-29 15:14:25 -05:00
Michael Klishin 5d41ede8cd
An alternative to #10415, closes #10330
Per discussion in #10415, this introduces a new module,
rabbit_mgmt_nodes, which provides a couple of helpers
that can be used to implement Cowboy REST's
resource_exists/2 in the modules that return
information about cluster members.
2024-02-29 15:14:22 -05:00
Diana Parra Corbacho e0a60c1d3c
Remove FF warning as soon as all features are enabled
The warning in the header needs a full refresh, just updating
the page content will not clear the warning.
2024-02-29 15:14:08 -05:00
Ariel Otilibili 09640e5f4d
Defined "tags" as list
Typo spotted in #4050
2024-02-29 15:13:59 -05:00
Diana Parra Corbacho 3583980643
Management: introduce deprecated features API endpoints, UI page and warnings 2024-02-29 15:13:45 -05:00
Diana Parra Corbacho c418a02591
Add experimental/disabled warning in State column 2024-02-29 15:13:44 -05:00
Diana Parra Corbacho a70a48df52
Add a warning banner if any stable feature flags is not enabled
Add an experimental tag on the description to experimental features
2024-02-29 15:13:44 -05:00
Johan Rhodin 67a0cb465f
Fix wrong link 2024-02-29 15:13:30 -05:00
Johan Rhodin dc5ce8a73a
fix info item, and behavior->behaviour 2024-02-29 15:13:07 -05:00
Michael Klishin d85eadcca0
Management UI: link to GitHub Discussions and not the Google group 2024-02-29 15:03:58 -05:00
Johan Rhodin 331c736128 Fix operator policy separators 2024-02-28 16:01:16 -06:00
Marcial Rosales 31ac7922da Fix test when idp is down 2024-02-12 07:38:25 +01:00
Marcial Rosales e4e0ece31d Fix issue looking up logout button 2024-02-10 20:54:17 +01:00
Marcial Rosales 91089feb7b Warn when some oauth resource is not available 2024-02-10 20:12:18 +01:00
Marcial Rosales ec18b170fc Show warning messages and disable resources
which are not available
2024-02-10 20:12:17 +01:00
Marcial Rosales 06bef0af41 Use resource's id as label
when label is not configured
2024-02-10 20:12:14 +01:00
Marcial Rosales a253a8cc31 Simplify auth_settings
just an array of oauth_resource_servers
regardless whether we have just resource_server_id
or many resource servers
2024-02-10 20:12:09 +01:00
Marcial Rosales fa3653acb1 Fix issue initialzing logon_type 2024-02-10 20:12:08 +01:00
Marcial Rosales aad98037bd Configure uaa with Cors and
fix issue initializing client_secret
2024-02-10 20:12:08 +01:00
Marcial Rosales 89c1bff84b Fix schema issue 2024-02-10 20:12:08 +01:00
Marcial Rosales b6ac76a6f3 Add prefix oauth to all resource server settings 2024-02-10 20:12:08 +01:00
Marcial Rosales c07aa378a6 Complete coverage of authSettings 2024-02-10 20:12:07 +01:00
Marcial Rosales c995fb8867 Reimplement how authSettings is calculated
WIP rename and simplify test cases
2024-02-10 20:12:07 +01:00
Marcial Rosales d827b72ce1 Create Oauth2 client 2024-02-10 20:12:04 +01:00
Karl Nilsson 5317f958fb Streams: Soft remove policy configuration of max_segment_size_bytes
This configuration is not guaranteed to be safe to change after a stream has bee n
declared and thus we'll remove the ability to change it after the initial
declaration. Users should favour the x- queue arg for this config but it will still
be possible to configure it as a policy but it will only be evaluated at
declara tion time.

This means that if a policy is set for a stream that re-configures the
`stream-m ax-segment-size-bytes` key it will show in the UI as updated but
the pre-existing stream will not use the updated configuration.

The key has been removed from the UI but for backwards compatibility it is still
 settable.

NB: this PR adds a new command `update_config` to the stream coordinator state
machine. Strictly speaking this should require a new machine version but we're by
passing that by relying on the feature flag instead which avoids this command
being committed before all nodes have the new code version. A new machine version
can lower the availability properties during a rolling cluster upgrade so in
this case it is preferable to avoid that given the simplicity of the change.
2024-02-07 11:06:10 +00:00
Michael Klishin f8401df53e
Drive-by change: naming 2024-01-29 12:21:45 -05:00
Diana Parra Corbacho dc3b6fb5bc Allow management users to query feature flags and deprecated features
The new banner to warn about not-enabled feature flags requires access
to this endpoint, and it must be visible for all users.
2024-01-29 15:51:21 +01:00
Michael Klishin 0c0e2ca932 An alternative to #10415, closes #10330
Per discussion in #10415, this introduces a new module,
rabbit_mgmt_nodes, which provides a couple of helpers
that can be used to implement Cowboy REST's
resource_exists/2 in the modules that return
information about cluster members.
2024-01-25 18:41:56 -05:00
Diana Parra Corbacho 5a3584beea Remove FF warning as soon as all features are enabled
The warning in the header needs a full refresh, just updating
the page content will not clear the warning.
2024-01-15 08:41:36 +01:00
Ariel Otilibili 0b24d3c0bb Defined "tags" as list
Typo spotted in #4050
2023-12-27 22:47:52 +01:00
Diana Parra Corbacho 5aa35e0570 Management: introduce deprecated features API endpoints, UI page and warnings 2023-12-13 07:39:37 +01:00
Diana Parra Corbacho ee84038ef5 Add experimental/disabled warning in State column 2023-12-12 18:07:36 +01:00
Diana Parra Corbacho ada8083d0d Add a warning banner if any stable feature flags is not enabled
Add an experimental tag on the description to experimental features
2023-12-12 18:07:36 +01:00
Johan Rhodin 8ea1f8fc49
Merge branch 'rabbitmq:main' into FixInfoItems 2023-11-27 15:59:34 -06:00
Michael Klishin 28ad76467e Management UI: link to GitHub Discussions and not the Google group 2023-11-19 19:35:49 -05:00
Johan Rhodin 851fddcad2 Fix wrong link 2023-11-17 16:48:39 -06:00
Johan Rhodin 226e7d138d fix info item, and behavior->behaviour 2023-11-17 11:01:47 -06:00
Karl Nilsson c2cd60b18d Optimise mgmt HTTP API /queues endpoint
Listing queues with the HTTP API when there are many (1000s) of
quorum queues could be excessively slow compared to the same scenario
with classic queues.

This optimises various aspects of HTTP API queue listings.
For QQs it removes the expensive cluster wide rpcs used to get the
"online" status of each quorum queue. This was previously done _before_
paging and thus would perform a cluster-wide query for _each_ quorum queue in
the vhost/system. This accounted for most of the slowness compared to
classic queues.

Secondly the query to separate the running from the down queues
consisted of two separate queries that later were combined when a single
query would have sufficed.

This commit also includes a variety of other improvements and minor
fixes discovered during testing and optimisation.

MINOR BREAKING CHANGE: quorum queues would previously only display one
of two states: running or down. Now there is a new state called minority
which is emitted when the queue has at least one member running but
cannot commit entries due to lack of quorum.

Also the quorum queue may transiently enter the down state when a node
goes down and before its elected a new leader.
2023-11-06 15:34:26 +00:00
Duke cd680bc568
move store pref to startWithOAuthLogin 2023-10-30 12:02:29 -03:00
Emerson Almeida 7bf452c522 fix pref default 2023-10-29 18:34:42 -03:00
Duke 3e0ca9ede7 add oauth-return-to 2023-10-29 18:34:42 -03:00
Diana Parra Corbacho 07196e297b Reduce the number of metrics served by GET /api/queues
Introduce GET /api/queues/detailed endpoint

Just removed garbage_collection, idle_since and any 'null' value

/api/queues with 10k classic queues returns 7.4MB of data
/api/queues/detailed with 10k classic queues returns 11MB of data

This sits behind a new feature flag, required to collect data from
all nodes: detailed_queues_endpoint
2023-10-23 19:49:37 -04:00
Michael Klishin 6009a4973f
Merge pull request #9708 from rabbitmq/mk-limit-max-http-api-payload-size
Introduce a configurable limit to HTTP API request body size
2023-10-16 21:49:50 -04:00
Michael Klishin c6d0382be4
Reduce default HTTP API request body size limit to 10 MiB
per discussion with the team.

It should be enough to accomodate a definition file with about
100K queues.
2023-10-16 06:48:23 -04:00
Michael Klishin b7b3514bb1
Introduce HTTP request body limit for definition uploads
The default is 20 MiB, which is enough to upload
a definition file with 200K queues, a few virtual host
and a few users. In other words, it should accomodate
a lot of environments.
2023-10-14 06:11:01 -04:00
Michael Klishin 8e7e8f9127
Merge branch 'main' into issue-9437-queue-storage-version 2023-10-10 15:03:50 -04:00
Michael Klishin aa0c52093f Add length limit overflow behavior to supported features in the UI 2023-10-05 21:17:56 -04:00
Diana Parra Corbacho c1a6e5b3e5 Return storage_version as top-level key in queue objects
A previous PR removed backing_queue_status as it is mostly unused,
but classic queue version is still useful. This PR returns version
as a top-level key in queue objects.
2023-10-04 09:29:01 +02:00
Diana Parra Corbacho 5f0981c5a3
Allow to use Khepri database to store metadata instead of Mnesia
[Why]

Mnesia is a very powerful and convenient tool for Erlang applications:
it is a persistent disc-based database, it handles replication accross
multiple Erlang nodes and it is available out-of-the-box from the
Erlang/OTP distribution. RabbitMQ relies on Mnesia to manage all its
metadata:

* virtual hosts' properties
* intenal users
* queue, exchange and binding declarations (not queues data)
* runtime parameters and policies
* ...

Unfortunately Mnesia makes it difficult to handle network partition and,
as a consequence, the merge conflicts between Erlang nodes once the
network partition is resolved. RabbitMQ provides several partition
handling strategies but they are not bullet-proof. Users still hit
situations where it is a pain to repair a cluster following a network
partition.

[How]

@kjnilsson created Ra [1], a Raft consensus library that RabbitMQ
already uses successfully to implement quorum queues and streams for
instance. Those queues do not suffer from network partitions.

We created Khepri [2], a new persistent and replicated database engine
based on Ra and we want to use it in place of Mnesia in RabbitMQ to
solve the problems with network partitions.

This patch integrates Khepri as an experimental feature. When enabled,
RabbitMQ will store all its metadata in Khepri instead of Mnesia.

This change comes with behavior changes. While Khepri remains disabled,
you should see no changes to the behavior of RabbitMQ. If there are
changes, it is a bug. After Khepri is enabled, there are significant
changes of behavior that you should be aware of.

Because it is based on the Raft consensus algorithm, when there is a
network partition, only the cluster members that are in the partition
with at least `(Number of nodes in the cluster ÷ 2) + 1` number of nodes
can "make progress". In other words, only those nodes may write to the
Khepri database and read from the database and expect a consistent
result.

For instance in a cluster of 5 RabbitMQ nodes:
* If there are two partitions, one with 3 nodes, one with 2 nodes, only
  the group of 3 nodes will be able to write to the database.
* If there are three partitions, two with 2 nodes, one with 1 node, none
  of the group can write to the database.

Because the Khepri database will be used for all kind of metadata, it
means that RabbitMQ nodes that can't write to the database will be
unable to perform some operations. A list of operations and what to
expect is documented in the associated pull request and the RabbitMQ
website.

This requirement from Raft also affects the startup of RabbitMQ nodes in
a cluster. Indeed, at least a quorum number of nodes must be started at
once to allow nodes to become ready.

To enable Khepri, you need to enable the `khepri_db` feature flag:

    rabbitmqctl enable_feature_flag khepri_db

When the `khepri_db` feature flag is enabled, the migration code
performs the following two tasks:
1. It synchronizes the Khepri cluster membership from the Mnesia
   cluster. It uses `mnesia_to_khepri:sync_cluster_membership/1` from
   the `khepri_mnesia_migration` application [3].
2. It copies data from relevant Mnesia tables to Khepri, doing some
   conversion if necessary on the way. Again, it uses
   `mnesia_to_khepri:copy_tables/4` from `khepri_mnesia_migration` to do
   it.

This can be performed on a running standalone RabbitMQ node or cluster.
Data will be migrated from Mnesia to Khepri without any service
interruption. Note that during the migration, the performance may
decrease and the memory footprint may go up.

Because this feature flag is considered experimental, it is not enabled
by default even on a brand new RabbitMQ deployment.

More about the implementation details below:

In the past months, all accesses to Mnesia were isolated in a collection
of `rabbit_db*` modules. This is where the integration of Khepri mostly
takes place: we use a function called `rabbit_khepri:handle_fallback/1`
which selects the database and perform the query or the transaction.
Here is an example from `rabbit_db_vhost`:

* Up until RabbitMQ 3.12.x:

        get(VHostName) when is_binary(VHostName) ->
            get_in_mnesia(VHostName).

* Starting with RabbitMQ 3.13.0:

        get(VHostName) when is_binary(VHostName) ->
            rabbit_khepri:handle_fallback(
              #{mnesia => fun() -> get_in_mnesia(VHostName) end,
                khepri => fun() -> get_in_khepri(VHostName) end}).

This `rabbit_khepri:handle_fallback/1` function relies on two things:
1. the fact that the `khepri_db` feature flag is enabled, in which case
   it always executes the Khepri-based variant.
4. the ability or not to read and write to Mnesia tables otherwise.

Before the feature flag is enabled, or during the migration, the
function will try to execute the Mnesia-based variant. If it succeeds,
then it returns the result. If it fails because one or more Mnesia
tables can't be used, it restarts from scratch: it means the feature
flag is being enabled and depending on the outcome, either the
Mnesia-based variant will succeed (the feature flag couldn't be enabled)
or the feature flag will be marked as enabled and it will call the
Khepri-based variant. The meat of this function really lives in the
`khepri_mnesia_migration` application [3] and
`rabbit_khepri:handle_fallback/1` is a wrapper on top of it that knows
about the feature flag.

However, some calls to the database do not depend on the existence of
Mnesia tables, such as functions where we need to learn about the
members of a cluster. For those, we can't rely on exceptions from
Mnesia. Therefore, we just look at the state of the feature flag to
determine which database to use. There are two situations though:

* Sometimes, we need the feature flag state query to block because the
  function interested in it can't return a valid answer during the
  migration. Here is an example:

        case rabbit_khepri:is_enabled(RemoteNode) of
            true  -> can_join_using_khepri(RemoteNode);
            false -> can_join_using_mnesia(RemoteNode)
        end

* Sometimes, we need the feature flag state query to NOT block (for
  instance because it would cause a deadlock). Here is an example:

        case rabbit_khepri:get_feature_state() of
            enabled -> members_using_khepri();
            _       -> members_using_mnesia()
        end

Direct accesses to Mnesia still exists. They are limited to code that is
specific to Mnesia such as classic queue mirroring or network partitions
handling strategies.

Now, to discover the Mnesia tables to migrate and how to migrate them,
we use an Erlang module attribute called
`rabbit_mnesia_tables_to_khepri_db` which indicates a list of Mnesia
tables and an associated converter module. Here is an example in the
`rabbitmq_recent_history_exchange` plugin:

    -rabbit_mnesia_tables_to_khepri_db(
       [{?RH_TABLE, rabbit_db_rh_exchange_m2k_converter}]).

The converter module  — `rabbit_db_rh_exchange_m2k_converter` in this
example  — is is fact a "sub" converter module called but
`rabbit_db_m2k_converter`. See the documentation of a `mnesia_to_khepri`
converter module to learn more about these modules.

[1] https://github.com/rabbitmq/ra
[2] https://github.com/rabbitmq/khepri
[3] https://github.com/rabbitmq/khepri_mnesia_migration

See #7206.

Co-authored-by: Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com>
Co-authored-by: Diana Parra Corbacho <dparracorbac@vmware.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-09-29 16:00:11 +02:00
Michael Klishin 8ca0200503 HTTP API docs: be more specific 2023-09-28 05:57:50 -04:00
Diana Parra Corbacho 9d8a537073 HTTP API: document disable_stats and enable_queue_totals
Using GET /api/queues?disable_stats=true&enable_queue_totals=true is far more efficient than the standard GET /api/queues and in many cases will suffice for monitoring and operating purposes.
2023-09-28 09:16:08 +02:00
Jean-Sébastien Dominique 8c6ba6daca Add Classic Queue version to operator policies 2023-09-26 20:13:52 -04:00
Diana Parra Corbacho cbf479f1a9 mgmt UI admin page: list all operator policies per queue type 2023-09-22 09:01:27 +02:00
Simon Unge 2d74d24b80 Disable add/delete/shrink/grow QQ operations via HTTP api 2023-08-23 01:03:28 +00:00
Michael Klishin 52d78e018a
Merge pull request #8218 from SimonUnge/eval_membership_stand_alone_process
Reconcile (repair or expand) quorum queue membership periodically
2023-07-13 20:28:34 +04:00
Arnaud Cogoluègnes d0a6efc1c9
Document stream management plugin endpoints
Fixes #8751
2023-07-13 15:41:23 +02:00
Simon Unge 559a83d45f See #7209. Evaluate quorum queue membership periodically. 2023-07-11 13:14:04 -07:00
Karl Nilsson 86479670cf
Make filter size configurable
as a queue arg and policy
2023-07-10 15:21:53 +02:00
antsthebul 4ebc3244f0 Set max height value for popup, as to not conlfict with smaller length popups 2023-06-30 13:40:34 -04:00
antsthebul b8f65083d1 Adjust CSS on Popup box 2023-06-29 14:47:56 -04:00
Michael Klishin 0a00526dba More wording, link to the maintenance mode doc section 2023-06-15 22:48:41 +04:00
Michael Klishin f428af75b7 One more UI wording change 2023-06-15 22:39:03 +04:00
Michael Klishin 46561fc9fe Naming changes #8578 2023-06-15 22:37:36 +04:00
Simon Unge 782830f4bd Show nodes in maintenance mode in UI 2023-06-15 22:37:36 +04:00
Michael Klishin f4aed7a55e Make sure that nav element ids follow a reasonable convention
Instead of using the label, use a snake-case value
without any spaces.

While at it, update Selenium/WebDriver test suites.
2023-06-10 19:38:36 +04:00
Michael Klishin f720338658 Rename a couple of management UI tabs
* Queueus => Queues and Streams
 * Stream => Stream Connections

to better reflect what they display in modern versions.

Per discussion with the team.
2023-06-10 18:57:16 +04:00
Marcial Rosales da43ccf6c7 Fix member variable for datamodel in Display 2023-05-23 17:03:45 +02:00
Marcial Rosales 02fda919a5 Fix #8276 2023-05-23 16:47:11 +02:00
Iliia Khaprov 00b3a895f1 UI bits for consumer timeout 2023-05-22 11:59:30 +02:00
Marcial Rosales 6ca5d026eb Only load users for limits for admin user 2023-05-19 17:24:38 +02:00
Marcial Rosales 67e04259a0 Test various user tags without vhost permissions 2023-05-19 17:01:15 +02:00
Marcial Rosales 1022f7d197 Do not mount route to pages
which require vhost access but the
use has no access to any vhost
2023-05-19 17:01:15 +02:00
Marcial Rosales 24fb9afe16 WIP Fix issue 2023-05-19 17:01:15 +02:00
Michael Klishin 29f9e1ceaf
Merge pull request #8236 from rabbitmq/no-more-lazy
Remove "lazy" from Management and lazy-specific tests
2023-05-19 11:51:22 +04:00
Michael Klishin e60a5409ff
Merge pull request #8241 from cloudamqp/queue_storage_version
Show classic queue storage version on Mgmt UI queue page
2023-05-19 11:09:19 +04:00
Péter Gömöri e0f485b1cc Show classic queue storage version on Mgmt UI queue page 2023-05-19 00:07:22 +02:00
Simon Unge 472496b4a3 Add ha-* operator policies to UI shortcuts 2023-05-18 11:24:04 -07:00
Michal Kuratczyk f8a3643d5d
Remove "lazy" from Management and lazy-specific tests 2023-05-18 13:59:50 +02:00
Michael Klishin 65e59f670b Only validate regular expression when the regex box is checked 2023-04-27 13:43:44 +04:00
Michael Klishin a4386db25d Wording 2023-04-27 12:32:39 +04:00
Michael Klishin fe1fbb8264 Add a warning for invalid regular expressions
Warn the user when filter expression does not compile to a regular
expression.

Part of #8008.
2023-04-27 12:27:19 +04:00
Michael Klishin a93ad3b7f1 First attempt at addressing #8008
When filter exression is not a valid regexp, send
it as a regular text filer.
2023-04-27 12:06:13 +04:00
Marcial Rosales 1c1e4515f7 Deprecate uaa settings from management plugin 2023-04-13 11:22:05 +02:00
Marcial Rosales 829d9d9428 Read JWT token from Authorization Header 2023-04-04 12:00:08 +04:00
Michael Klishin 1a3126d72a Management UI footer link updates 2023-04-03 22:23:06 +04:00
Michael Klishin bfcbef64b4 HTTP API: rename default queue type key
from defaultqueuetype to default_queue_type.
defaultqueuetype is still used as a fallback for backwards
compatibility.

Closes #7734.
2023-03-25 01:33:22 +04:00
Michal Kuratczyk 0a3136a916
Allow applying policies to specific queue types
Rather than relying on queue name conventions, allow applying policies
based on the queue type. For example, this allows multiple policies that
apply to all queue names (".*") that specify different parameters for
different queue types.
2023-03-13 12:36:48 +01:00
Luke Bakken f420487e5e
Add documentation for hashing passwords
Fixes #7432

Adds HTTP API documentation as well as `rabbitmqctl hash_password` docs.

Add `rabbitmqctl` docs
2023-02-26 15:16:38 -08:00
Marcial Rosales 20269bf222 Fix issue #7369
Depending on `disable_stats` value
search for detailed exchange details or
basic details
2023-02-21 13:11:45 +01:00
Marcial Rosales 9ab7dca650 Fix issue 7301 2023-02-15 14:29:55 +01:00
Michael Klishin 6c6f9c49ae
Naming, references #7165 2023-02-06 22:25:09 -05:00
Alex Valiushko db99c252a0 Add setting to disable op policy edit via API 2023-02-06 14:36:10 -08:00
Marcial Rosales 3fca42ed7a Fix issue #7142
The issue is that users retrieved with
the intention to list in the limits view
are not paged hence they are not wrapped
around a paging struct where users would be
under items attribute.

Pending selenium tests
2023-02-01 16:42:33 +01:00
Iliia Khaprov e4f1486d7a Fix Users filtering in Management UI.
close #4908
2023-01-26 16:28:47 +01:00
David Ansari 56e97a9142 Fix MQTT in management plugin
1. Allow to inspect an (web) MQTT connection.
2. Show MQTT client ID on connection page as part of client_properties.
3. Handle force_event_refresh (when management_plugin gets enabled
   after (web) MQTT connections got created).
4. Reduce code duplication between protocol readers.
5. Display '?' instead of 'NaN' in UI for absent queue metrics.
6. Allow an (web) MQTT connection to be closed via management_plugin.

For 6. this commit takes the same approach as already done for the stream
plugin:
The stream plugin registers neither with {type, network} nor {type,
direct}.
We cannot use gen_server:call/3 anymore to close the connection
because the web MQTT connection cannot handle gen_server calls (only
casts).
Strictly speaking, this commit requires a feature flag to allow to force
closing stream connections from the management plugin during a rolling
update. However, given that this is rather an edge case, and there is a
workaround (connect to the node directly hosting the stream connection),
this commit will not introduce a new feature flag.
2023-01-24 17:30:10 +00:00
Marcial Rosales 6a08cd014f
Resolve conflict 2023-01-03 07:09:05 -05:00
Marcial Rosales 07fc6d1313
Validate imported user from file 2023-01-03 07:09:05 -05:00
Marcial Rosales 6e84444059
Test token refresh
And enable hard session timeout which was
disabled by mistake when moved credentials
from cookies to local storage
2023-01-03 07:09:04 -05:00
Marcial Rosales f6fad5c32e
Rename section otherwise
clicking on any area triggered
the download of the definitions
2023-01-03 07:09:04 -05:00
Marcial Rosales 58be01f1d1
Use only token in authorization header to
import and export definitions
2023-01-03 07:09:04 -05:00
Marcial Rosales 36728042ec
Test with selenium export/import definitions 2023-01-03 07:09:03 -05:00
Marcial Rosales bf172af236
Do not use cookies to store basic auth
Use window.localStorage. If it is disabled
Management UI should stop working rather than
falling back to cookies
2023-01-03 07:09:03 -05:00
Marcial Rosales c76e589130
Do not use cookies to store basic auth
Instead use localStorage
2023-01-03 07:09:03 -05:00
Marcial Rosales 9354397cbf
Support Idp initiated logon in mgt ui with Oauth
Configure preferred username from a token
Make client_secret optional
2023-01-03 07:09:00 -05:00
Patrik Ragnarsson 29d3a0e0d4 Escape the user controlled error parameter 2022-12-30 12:48:55 +01:00
Luke Bakken a193f4516b
Use more modern method to download definitions
Does not require sending auth as a query parameter

Ref: https://vmware.slack.com/archives/C0RDGG81Z/p1669827808015729
2022-12-13 17:11:25 -08:00
Alexey Lebedeff 6693af78af Consistently expose default queue functionality in management UI
1. Allow to create queues without `x-queue-type` argument, which give
default queue type logic a chance to run. What's more, those queues
definitions will be exported without `x-queue-type`, so they can be
loaded into another vhost and default queue logic will be applied
again.

2. Show default queue type on the vhost page and the vhosts list pages
2022-12-08 17:39:44 +01:00
Alex Valiushko 0a81a063b5 Add noopener to hrefs in rabbitmq_management 2022-10-20 12:15:32 -07:00
Marcial Rosales edabd8816b Support multiple path segments in management path
Updated selenium tests to tests against 2 path
segments rather than just one
2022-10-04 16:43:18 +02:00
Marcial Rosales d46566099f Support management path prefix when using OAuth2 2022-10-04 09:13:57 +02:00
Marcial Rosales bbc3c75d05 Add missing renamed oauth.enable -> oauth.enabled 2022-09-02 09:33:11 +01:00
Michael Klishin c0a38c6da5 Management plugin: oauth_enable => oauth_enabled in more places 2022-09-02 01:17:58 +04:00
Michael Klishin dca7132dc3 management.oauth_enable => management.oauth_enabled 2022-09-02 00:16:13 +04:00
Marcial Rosales 54464c0498 Logging improvements
Rather than logging directly via console.log
we do it via the Logger library provided by
oidc-client which allows to use logging levels
2022-09-01 13:53:42 +01:00
Marcial Rosales 81f612f8ff Test hard session timeout
When the management ui session times out
the user should be logged out also from
the idp
2022-08-30 17:53:44 +01:00
Marcial Rosales e57b88f2b7 Fix logout workflow
The issue was primarily that UAA was
not properly configured. We had to whitelist
the uri used for logout otherwise UAA redirects
to its login page

WIP verify that logout.js works when running in
headless mode. For that we need a docker image
and at the moment, make docker-image is not
working because it is still using old otp 24.0.2
2022-08-30 17:11:21 +01:00
Marcial Rosales 745ff0b4b2 Fix issue related to refreshing access tokens 2022-08-30 17:11:19 +01:00
Marcial Rosales 316b520b17 Remove dummy state 2022-08-30 17:11:17 +01:00
Marcial Rosales 896e07d4e6 Add audience request parameter to /authorize
Oauth0 requires this parameter in order to
return a proper JWT token and not an opaque JWT
token.
2022-08-30 17:11:16 +01:00
Marcial Rosales 15637ba944 Fix two issues
One in the management ui when the user has
not enough priviledges
And a second one with the api/auth endpoint
which was using a worng json attribute
2022-08-30 17:11:16 +01:00
Marcial Rosales c73f95d3ac Handle not authorized oauth user
When the oauth user has a token without enough
credentials to access the management ui, the
rest request `/api/whoami` returns a 401 with
www-authentication response header which instructs
the browser to show a popup dialog box for basic
auth. With this change, we had to remove the response
header so that we could use the same mechanism we
use to show other oauth errors, i.e. use the login-status
panel instead.
2022-08-30 17:11:16 +01:00
Marcial Rosales 6426d116c0 Handle rabbitmq session timeout 2022-08-30 17:11:16 +01:00
Marcial Rosales 448d8ecb34 Handle scopes
It is important that RabbitMQ specifies which
scopes it has to request. We control that via the
management.oauth_scopes field. If we have enable_uaa = true,
the scopes are automatically configured for us as follows:
"openid profile " + authSettings.oauth_resource_id + ".*"

Else we have to configure oauth_scopes field.
2022-08-30 17:11:16 +01:00
Marcial Rosales 10ccf33d4f WIP login/logout/token-refresh against keycloak 2022-08-30 17:11:16 +01:00
Marcial Rosales 827d0cc4a0 Refresh token 2022-08-30 17:11:16 +01:00
Marcial Rosales 91ba01e7c5 Set cookies expiry from token expiry claim 2022-08-30 17:11:15 +01:00
Marcial Rosales 6218618fbf Replace singular with oidc-client-ts library
Right now only login and logout flows are supported
To be added refresh token
And test all possible failure scenarios
2022-08-30 17:11:15 +01:00
Nuwan Sameera 6eb2630f55
Add delete connection by username feature
Format code

Fix whitespace, fix warning

Update API docs

Remove blank lines

Add get all connections by username

Fix method name issue

Enable GET method to get connections by username

Update API documentation

Modify list all connections of username method

Remove list_by_username method and modify get all connections of user API

Code formatting, break up lines for readability

Refactor code to use pattern matching more effectively

Typo
2022-08-05 13:34:54 -07:00
Michael Klishin 4cacec6bfd
Merge pull request #5305 from rabbitmq/default-queue-type-per-vhost
Configure default queue type by vhost
2022-07-26 01:37:56 +04:00
Karl Nilsson 3c5614f4e2 Add default queue type to Add new virtual host form 2022-07-25 12:34:51 +01:00
Michael Klishin 6feae50b0c
Schema: support for X-Frame-Options
as `management.headers.frame_options`
2022-07-25 13:54:54 +04:00
Michael Klishin 02e1f65d97
Schema: support for X-Content-Type-Options
as `management.headers.content_type_options`
2022-07-25 13:54:53 +04:00
Arnaud Cogoluègnes 827fe6f008
Add active and activity_status in stream consumer UI list
The UI handles the case where the 2 fields are not present.
This can happen in a mixed-version cluster, where a node
of a previous version returns records without the fields.
The UI uses default values (active = true, activity status = up),
which is valid as the consumers of the node are "standalone"
consumers (not part of a group).

References #3753
2022-05-09 10:52:34 +02:00