2022-06-03 18:46:45 +08:00
|
|
|
load("@rules_erlang//:xref2.bzl", "xref")
|
2022-02-24 18:18:41 +08:00
|
|
|
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
|
2021-05-11 16:52:28 +08:00
|
|
|
load(
|
|
|
|
"//:rabbitmq.bzl",
|
2021-06-01 16:19:10 +08:00
|
|
|
"RABBITMQ_DIALYZER_OPTS",
|
2021-07-12 23:54:55 +08:00
|
|
|
"assert_suites",
|
2021-05-11 16:52:28 +08:00
|
|
|
"broker_for_integration_suites",
|
2022-01-06 03:57:48 +08:00
|
|
|
"rabbitmq_app",
|
2021-05-11 16:52:28 +08:00
|
|
|
"rabbitmq_integration_suite",
|
|
|
|
"rabbitmq_suite",
|
2022-05-17 20:07:16 +08:00
|
|
|
"rabbitmq_test_helper",
|
2022-02-24 18:18:41 +08:00
|
|
|
"without",
|
2021-05-11 16:52:28 +08:00
|
|
|
)
|
2021-04-01 01:11:32 +08:00
|
|
|
|
|
|
|
APP_NAME = "rabbitmq_auth_backend_oauth2"
|
|
|
|
|
|
|
|
APP_DESCRIPTION = "OAuth 2 and JWT-based AuthN and AuthZ backend"
|
|
|
|
|
|
|
|
BUILD_DEPS = [
|
2022-01-06 03:57:48 +08:00
|
|
|
"//deps/rabbit_common:erlang_app",
|
2021-04-01 01:11:32 +08:00
|
|
|
"//deps/rabbitmq_cli:rabbitmqctl",
|
|
|
|
]
|
|
|
|
|
|
|
|
DEPS = [
|
2022-01-06 03:57:48 +08:00
|
|
|
"@jose//:erlang_app",
|
2021-04-01 01:11:32 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
RUNTIME_DEPS = [
|
2022-01-06 03:57:48 +08:00
|
|
|
"//deps/rabbit:erlang_app",
|
|
|
|
"@base64url//:erlang_app",
|
|
|
|
"@cowlib//:erlang_app",
|
2021-04-01 01:11:32 +08:00
|
|
|
]
|
|
|
|
|
2022-01-06 03:57:48 +08:00
|
|
|
rabbitmq_app(
|
2021-04-01 01:11:32 +08:00
|
|
|
app_description = APP_DESCRIPTION,
|
|
|
|
app_name = APP_NAME,
|
|
|
|
build_deps = BUILD_DEPS,
|
|
|
|
runtime_deps = RUNTIME_DEPS,
|
|
|
|
deps = DEPS,
|
|
|
|
)
|
|
|
|
|
2022-06-03 18:46:45 +08:00
|
|
|
xref(
|
|
|
|
additional_libs = [
|
|
|
|
"//deps/rabbitmq_cli:rabbitmqctl",
|
|
|
|
],
|
|
|
|
)
|
2021-05-21 18:02:50 +08:00
|
|
|
|
2022-02-24 18:18:41 +08:00
|
|
|
plt(
|
|
|
|
name = "base_plt",
|
|
|
|
deps = without(
|
|
|
|
"//deps/rabbitmq_cli:rabbitmqctl",
|
|
|
|
BUILD_DEPS + DEPS,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2021-06-01 16:19:10 +08:00
|
|
|
dialyze(
|
2022-02-26 01:13:08 +08:00
|
|
|
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_undefined_callbacks"],
|
2022-02-24 18:18:41 +08:00
|
|
|
plt = ":base_plt",
|
2022-02-21 16:19:56 +08:00
|
|
|
warnings_as_errors = False,
|
2021-06-01 16:19:10 +08:00
|
|
|
)
|
|
|
|
|
2021-05-11 16:52:28 +08:00
|
|
|
broker_for_integration_suites()
|
2021-04-01 01:11:32 +08:00
|
|
|
|
2022-05-17 20:07:16 +08:00
|
|
|
rabbitmq_test_helper(
|
2021-04-01 01:11:32 +08:00
|
|
|
name = "rabbit_auth_backend_oauth2_test_util",
|
|
|
|
srcs = [
|
|
|
|
"test/rabbit_auth_backend_oauth2_test_util.erl",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2021-05-11 16:52:28 +08:00
|
|
|
PACKAGE = "deps/rabbitmq_auth_backend_oauth2"
|
|
|
|
|
2022-11-24 22:46:08 +08:00
|
|
|
rabbitmq_integration_suite(
|
|
|
|
PACKAGE,
|
|
|
|
name = "add_uaa_key_command_SUITE",
|
|
|
|
size = "small",
|
|
|
|
)
|
|
|
|
|
|
|
|
rabbitmq_integration_suite(
|
|
|
|
PACKAGE,
|
|
|
|
name = "config_schema_SUITE",
|
|
|
|
)
|
|
|
|
|
|
|
|
rabbitmq_integration_suite(
|
|
|
|
PACKAGE,
|
|
|
|
name = "jwks_SUITE",
|
|
|
|
additional_beam = [
|
|
|
|
":rabbit_auth_backend_oauth2_test_util",
|
|
|
|
],
|
|
|
|
additional_srcs = [
|
|
|
|
"test/jwks_http_app.erl",
|
|
|
|
"test/jwks_http_handler.erl",
|
|
|
|
"test/jwks_http_sup.erl",
|
|
|
|
],
|
|
|
|
runtime_deps = [
|
|
|
|
"@cowboy//:erlang_app",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
rabbitmq_suite(
|
|
|
|
name = "scope_SUITE",
|
|
|
|
size = "medium",
|
|
|
|
deps = [
|
|
|
|
"//deps/rabbit_common:erlang_app",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
rabbitmq_integration_suite(
|
|
|
|
PACKAGE,
|
|
|
|
name = "system_SUITE",
|
|
|
|
size = "medium",
|
|
|
|
additional_beam = [
|
|
|
|
":rabbit_auth_backend_oauth2_test_util",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
rabbitmq_integration_suite(
|
|
|
|
PACKAGE,
|
|
|
|
name = "unit_SUITE",
|
|
|
|
size = "medium",
|
|
|
|
additional_beam = [
|
|
|
|
":rabbit_auth_backend_oauth2_test_util",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
rabbitmq_suite(
|
|
|
|
name = "wildcard_match_SUITE",
|
|
|
|
size = "small",
|
|
|
|
)
|
|
|
|
|
|
|
|
assert_suites()
|
2021-04-01 01:11:32 +08:00
|
|
|
|
2022-11-24 22:46:08 +08:00
|
|
|
alias(
|
|
|
|
name = "rabbitmq_auth_backend_oauth2",
|
|
|
|
actual = ":erlang_app",
|
|
|
|
visibility = ["//visibility:public"],
|
2021-04-01 01:11:32 +08:00
|
|
|
)
|