From ccb0059cd44e5578de9cd602df6dd456813f62a3 Mon Sep 17 00:00:00 2001 From: Marcial Rosales Date: Wed, 19 Jun 2024 17:04:29 +0200 Subject: [PATCH 1/4] Dynamically load oauth-related libraries --- deps/rabbitmq_management/priv/www/index.html | 47 +----- .../rabbitmq_management/priv/www/js/global.js | 6 +- deps/rabbitmq_management/priv/www/js/main.js | 130 ++++---------- .../priv/www/js/oidc-oauth/helper.js | 158 ++++++++++++++---- .../www/js/oidc-oauth/login-callback.html | 13 +- .../www/js/oidc-oauth/logout-callback.html | 16 +- .../priv/www/js/oidc-oauth/oidc-client-ts.js | 1 + .../selenium/bin/components/devkeycloak | 2 +- .../selenium/bin/components/prodkeycloak | 2 +- .../selenium/full-suite-management-ui | 1 + .../rabbitmq_management/selenium/package.json | 2 +- .../authnz-mgt/basic-auth-with-mgt-prefix.sh | 9 + .../test/basic-auth/imports/users.json | 14 ++ .../selenium/test/basic-auth/rabbitmq.conf | 2 +- .../test/basic-auth/rabbitmq.mgt-prefix.conf | 1 + .../test/basic-auth/session-expired.js | 39 +++++ .../selenium/test/basic-auth/unauthorized.js | 59 +++++++ .../selenium/test/oauth/enabled_plugins | 2 +- .../selenium/test/oauth/imports/users.json | 14 ++ .../oauth/with-basic-auth/unauthorized.js | 59 +++++++ .../oauth/with-sp-initiated/unauthorized.js | 2 +- .../selenium/test/pageobjects/BasePage.js | 32 ++-- .../selenium/test/pageobjects/LoginPage.js | 23 +++ .../src/rabbit_mgmt_oauth_bootstrap.erl | 58 +++++-- .../test/rabbit_mgmt_http_SUITE.erl | 2 +- .../src/rabbit_mgmt_format.erl | 3 +- .../rabbit_web_dispatch_access_control.erl | 14 +- 27 files changed, 482 insertions(+), 229 deletions(-) create mode 100755 deps/rabbitmq_management/selenium/suites/authnz-mgt/basic-auth-with-mgt-prefix.sh create mode 100644 deps/rabbitmq_management/selenium/test/basic-auth/rabbitmq.mgt-prefix.conf create mode 100644 deps/rabbitmq_management/selenium/test/basic-auth/session-expired.js create mode 100644 deps/rabbitmq_management/selenium/test/basic-auth/unauthorized.js create mode 100644 deps/rabbitmq_management/selenium/test/oauth/with-basic-auth/unauthorized.js diff --git a/deps/rabbitmq_management/priv/www/index.html b/deps/rabbitmq_management/priv/www/index.html index a82ec881edd0..659fa9efea05 100644 --- a/deps/rabbitmq_management/priv/www/index.html +++ b/deps/rabbitmq_management/priv/www/index.html @@ -16,47 +16,16 @@ - - - - + + - - - +