Skip to content

Commit 566feb0

Browse files
Fix amqp10.js suite when using mtls
1 parent 72ef308 commit 566feb0

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

selenium/suites/authnz-messaging/auth-http-backend-with-mtls.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44

55
TEST_CASES_PATH=/authnz-msg-protocols
66
PROFILES="internal-user auth-http auth_backends-http auth-mtls"
7+
# internal-user profile is used because the client certificates to
8+
# access rabbitmq are issued with the alt_name = internal-user
79

810
source $SCRIPT/../../bin/suite_template
911
runWith mock-auth-backend-http

selenium/test/amqp.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function getAmqpsConnectionOptions() {
2828
}
2929
function getConnectionOptions() {
3030
let scheme = process.env.RABBITMQ_AMQP_SCHEME || 'amqp'
31+
console.log("Using AMQP protocol: " + scheme)
3132
switch(scheme){
3233
case "amqp":
3334
return getAmqpConnectionOptions()

selenium/test/authnz-msg-protocols/amqp10.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ describe('Having AMQP 1.0 protocol enabled and the following auth_backends: ' +
2929
let expectations = []
3030
let username = process.env.RABBITMQ_AMQP_USERNAME
3131
let password = process.env.RABBITMQ_AMQP_PASSWORD
32+
let usemtls = process.env.AMQP_USE_MTLS
3233
let amqp;
3334

34-
before(function () {
35-
if (backends.includes("http") && username.includes("http")) {
35+
before(function () {
36+
if (backends.includes("http") && (username.includes("http") || usemtls)) {
3637
reset()
37-
expectations.push(expectUser({ "username": username, "password": password}, "allow"))
38+
if (!usemtls) {
39+
expectations.push(expectUser({ "username": username, "password": password}, "allow"))
40+
} else {
41+
expectations.push(expectUser({ "username": username}, "allow"))
42+
}
3843
expectations.push(expectVhost({ "username": username, "vhost": "/"}, "allow"))
3944
expectations.push(expectResource({ "username": username, "vhost": "/", "resource": "queue", "name": "my-queue", "permission":"configure", "tags":""}, "allow"))
4045
expectations.push(expectResource({ "username": username, "vhost": "/", "resource": "queue", "name": "my-queue", "permission":"read", "tags":""}, "allow"))

selenium/test/authnz-msg-protocols/mqtt.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ describe('Having MQTT protocol enbled and the following auth_backends: ' + backe
2727
if (backends.includes("http") && (username.includes("http") || usemtls)) {
2828
reset()
2929
if (!usemtls) {
30-
console.log("Expect %s %s %s", username, password, client_id)
3130
expectations.push(expectUser({
3231
"username": username,
3332
"password": password,
3433
"client_id": client_id,
3534
"vhost": "/" }, "allow"))
3635
} else {
37-
console.log("Expect (mtls) %s %s", username, client_id)
3836
expectations.push(expectUser({
3937
"username": username,
4038
"client_id": client_id,

0 commit comments

Comments
 (0)