Skip to content

Commit 799556e

Browse files
HTTP API: format user tags the same way 'rabbitmqctl export_definitions' now does
1 parent 4ea9ce1 commit 799556e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

deps/rabbitmq_management_agent/src/rabbit_mgmt_format.erl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
-export([args_hash/1]).
3131

3232
-import(rabbit_misc, [pget/2, pget/3, pset/3]).
33+
-import(rabbit_data_coercion, [to_binary/1]).
3334

3435
-include_lib("rabbit_common/include/rabbit.hrl").
3536
-include_lib("rabbit_common/include/rabbit_framing.hrl").
@@ -215,15 +216,16 @@ internal_user(User) ->
215216
{password_hash, base64:encode(internal_user:get_password_hash(User))},
216217
{hashing_algorithm, rabbit_auth_backend_internal:hashing_module_for_user(
217218
User)},
218-
{tags, tags(internal_user:get_tags(User))},
219+
{tags, tags_as_binaries(internal_user:get_tags(User))},
219220
{limits, internal_user:get_limits(User)}].
220221

221222
user(User) ->
222223
[{name, User#user.username},
223-
{tags, tags(User#user.tags)}].
224+
{tags, tags_as_binaries(User#user.tags)}].
225+
226+
tags_as_binaries(Tags) ->
227+
[to_binary(T) || T <- Tags].
224228

225-
tags(Tags) ->
226-
list_to_binary(string:join([atom_to_list(T) || T <- Tags], ",")).
227229

228230
listener(#listener{node = Node, protocol = Protocol,
229231
ip_address = IPAddress, port = Port, opts=Opts}) ->

0 commit comments

Comments
 (0)