Test single value for locations and actions

This commit is contained in:
Marcial Rosales 2022-07-27 11:04:31 +02:00 committed by Michael Klishin
parent 9562ea53bc
commit 29b97e085b
No known key found for this signature in database
GPG Key ID: E80EDCFA0CDB21EE
1 changed files with 16 additions and 1 deletions

View File

@ -417,7 +417,22 @@ test_post_process_payload_rich_auth_request(_) ->
],
[<<"rabbitmq.read:^finance-*/*/*">> ]
},
{ "can use single string value for location",
[ #{<<"type">> => ?RESOURCE_SERVER_TYPE,
<<"locations">> => <<"cluster:rabbitmq/vhost:^finance-*">>,
<<"actions">> => [<<"read">>]
}
],
[<<"rabbitmq.read:^finance-*/*/*">> ]
},
{ "can use single string value for action",
[ #{<<"type">> => ?RESOURCE_SERVER_TYPE,
<<"locations">> => <<"cluster:rabbitmq/vhost:^finance-*">>,
<<"actions">> => <<"read">>
}
],
[<<"rabbitmq.read:^finance-*/*/*">> ]
},
{ "should ignore permissions which are empty",
[],
[]