Commit Graph

45 Commits

Author SHA1 Message Date
GitHub 5ae16631e9 bazel run gazelle 2024-10-09 04:02:38 +00:00
Marcial Rosales 743f663520 Fix bazel configuration 2024-10-08 08:17:48 +02:00
Marcial Rosales 0ec415a419 Fix bazel misconfiguration 2024-10-08 08:17:48 +02:00
Marcial Rosales 66d9323148 Simplify module names 2024-10-08 08:17:47 +02:00
Marcial Rosales 9984eef2d1 WIP Fix compilation errors 2024-10-08 08:17:47 +02:00
Marcial Rosales 7064969ca5 WIP More refactoring
split rabbit_oauth2_config into
- rabbit_oauth2_resource_server
- rabbit_oauth2_oauth_provider

and their respective test modules

Signing keys is an oauth provider
concern hence it stays with the
oauth_provider module.
2024-10-08 08:17:47 +02:00
GitHub ef1ca774ff bazel run gazelle 2024-08-30 04:02:30 +00:00
Marcial Rosales 77e8172009 Support tokens without kid when using multiple resources 2024-08-29 12:44:49 +01:00
David Ansari 0397035669 Add test for AMQP 1.0 clients using OAuth token 2024-07-31 12:05:22 +02:00
David Ansari 7fb78338c6 Disconnect MQTT client when its credential expires
Fixes https://github.com/rabbitmq/rabbitmq-server/discussions/11854
Fixes https://github.com/rabbitmq/rabbitmq-server/issues/11862

This commit uses the same approach as implemented for AMQP 1.0 and
Streams: When a token expires, RabbitMQ will close the connection.
2024-07-30 19:55:46 +02:00
Rin Kuryloski 5debebfaf3 Use rules_elixir to build the cli without mix
Certain elixir-native deps are still build with mix, but this can be
corrected later
2024-06-18 14:50:34 +02:00
Rin Kuryloski d5624ab5dc Add gazelle directive to stabilize bazel run gazelle
rabbit_common is indirectly included via rabbit_stream_reader.hrl, and
the rules_erlang gazelle extension does not yet know how to detect
this, therefore the directive manually declares it
2024-02-19 12:53:58 +01:00
Marcial Rosales 41237fbb3b Fix gaxelle issues around oauth2 dependencies 2024-02-14 18:55:39 +01:00
Marcial Rosales dbbab67a87 Fix issue setting up mock http server 2024-02-10 20:12:05 +01:00
Marcial Rosales daebd5fd7a Fix issue building openid connect url
And add more tests
2024-02-10 20:12:05 +01:00
Marcial Rosales f6ce99ef72 Add failing test 2024-02-10 20:12:05 +01:00
Marcial Rosales d827b72ce1 Create Oauth2 client 2024-02-10 20:12:04 +01:00
Rin Kuryloski 8de8f59d47 Use gazelle generated bazel files
Bazel build files are now maintained primarily with `bazel run
gazelle`. This will analyze and merge changes into the build files as
necessitated by certain code changes (e.g. the introduction of new
modules).

In some cases there hints to gazelle in the build files, such as `#
gazelle:erlang...` or `# keep` comments. xref checks on plugins that
depend on the cli are a good example.
2023-04-17 18:13:18 +02:00
Rin Kuryloski 933d6a586c Ignore warnings when building plt for rabbitmq_auth_backend_oauth2
The plugin itself still dialyzes cleanly, these warnings just mean
that the limited set of dependencies needed for the plugin are
incomplete with respect to each other (Or at least that is how I'm
intrepreting the results at this time).
2023-04-14 12:41:39 +02:00
David Ansari 2d0826c335 Add OAuth 2.0 MQTT system test
Add a test that rabbitmq_auth_backend_oauth2 works with MQTT.

See https://github.com/rabbitmq/rabbitmq-oauth2-tutorial#mqtt-protocol
2023-02-03 14:08:51 +00:00
Rin Kuryloski b84e746ee9 Rework plt/dialyze for rabbitmqctl and plugins that depend on it
This allows us to stop ignorning undefined callback warnings

When mix compiles rabbitmqctl, it produces a 'consolidated' directory
alongside the 'ebin' dir. Some of the modules in consolidated are
intended to be used instead of those provided by elixir. We now handle
the conflicts properly in the bazel build.
2023-01-19 17:29:23 +01:00
Alexey Lebedeff 8164df8bb2 Fix all dialyzer warnings in auth backends 2023-01-19 16:01:30 +01:00
Rin Kuryloski 5ef8923462 Avoid the need to pass package name to rabbitmq_integration_suite 2023-01-18 15:25:27 +01:00
Rin Kuryloski a317b30807 Use improved assert_suites2 macro from rules_erlang 3.9.0 2023-01-18 15:07:06 +01:00
Philip Kuryloski 15a79466b1 Use the new xref2 macro from rules_erlang
That adopts the modern erlang.mk xref behaviour
2022-06-09 23:18:28 +02:00
Philip Kuryloski 327f075d57 Make rabbitmq-server work with rules_erlang 3
Also rework elixir dependency handling, so we no longer rely on mix to
fetch the rabbitmq_cli deps

Also:

- Specify ra version with a commit rather than a branch
- Fixup compilation options for erlang 23
- Add missing ra reference in MODULE.bazel
- Add missing flag in oci.yaml
- Reduce bazel rbe jobs to try to save memory
- Use bazel built erlang for erlang git master tests
- Use the same cache for all the workflows but windows
- Avoid using `mix local.hex --force` in elixir rules
  - Fetching seems blocked in CI, and this should reduce hex api usage in
    all builds, which is always nice
- Remove xref and dialyze tags since rules_erlang 3 includes them in
  the defaults
2022-06-08 14:04:53 +02:00
Philip Kuryloski dabf053cf8 Additional dialyzer warning fixes
Currently loading of the rabbitmq_cli defined behaviors compiled with
Elixir does not work, so we ignore the callback definitions contained therein
2022-02-25 18:14:35 +01:00
Philip Kuryloski 226e00fcd2 Tighten up dialyzer usage
now that rules_erlang no longer cascades up dialyzer warnings from deps
2022-02-24 11:18:41 +01:00
Philip Kuryloski d8201726ae Ignore dialyzer warnings for most apps 2022-02-21 09:19:56 +01:00
Philip Kuryloski efcd881658 Use rules_erlang v2
bazel-erlang has been renamed rules_erlang. v2 is a substantial
refactor that brings Windows support. While this alone isn't enough to
run all rabbitmq-server suites on windows, one can at least now start
the broker (bazel run broker) and run the tests that do not start a
background broker process
2022-01-18 13:43:46 +01:00
Philip Kuryloski b8cabfe3dd bump test timeouts 2021-07-28 08:37:40 +02:00
Philip Kuryloski 2a6a9c786b Bazel test timeouts 2021-07-27 10:57:50 +02:00
Philip Kuryloski abc8703fd8 Bump test timeouts in bazel 2021-07-26 11:09:09 +02:00
Philip Kuryloski 8f9de08de7 Also assert no missing suites for all other deps 2021-07-12 18:05:55 +02:00
Philip Kuryloski 8c7e7e0656 Revert "Default all `rabbitmq_integration_suite` to flaky in bazel"
This reverts commit 70cb8147b2.
2021-06-23 20:53:14 +02:00
Philip Kuryloski 70cb8147b2 Default all `rabbitmq_integration_suite` to flaky in bazel
Most tests that can start rabbitmq nodes have some chance of
flaking. Rather than chase individual flakes for now, this commit
changes the default (though it can still be overriden, as is the case
for config_scheme_SUITE in many places, since I have yet to see that
particular suite flake).
2021-06-21 16:10:38 +02:00
Philip Kuryloski 37f5744833 Add rabbitmq_auth_backend_oauth2 system_SUITE to bazel 2021-06-09 17:43:20 +02:00
Philip Kuryloski 30f9a95b9f Add dialyze for remaning tier-1 plugins 2021-06-01 10:19:10 +02:00
Philip Kuryloski 98e71c45d8 Perform xref checks on many tier-1 plugins 2021-05-21 12:03:22 +02:00
Philip Kuryloski c13c2af614 Bazel file refactoring 2021-05-11 12:03:27 +02:00
Philip Kuryloski ec5954fe9c Refactor rabbitmq_auth_backend_oauth2 bazel 2021-05-11 10:52:28 +02:00
Philip Kuryloski 072a1c0462 Refactor and dedupe .bazel file content 2021-04-16 10:22:44 +02:00
Philip Kuryloski 78bb20f0aa Adopt change of suite_name -> name in ct_suite from @bazel-erlang 2021-04-08 14:25:06 +02:00
Philip Kuryloski 2f17113154 Add deps/rabbitmq_auth_mechanism_ssl to bazel build 2021-04-06 14:30:14 +02:00
Philip Kuryloski 64f6c18cb8 Add the rabbitmq_auth_backend_oauth2 suite
requires recent @bazel-erlang updates
2021-03-31 19:11:32 +02:00