chore: update changes
This commit is contained in:
parent
5532c7b0a6
commit
3ae26c8a54
|
@ -487,7 +487,7 @@ users(post, #{body := Body}) when is_list(Body) ->
|
||||||
{error, {already_exists, Exists}} ->
|
{error, {already_exists, Exists}} ->
|
||||||
{409, #{
|
{409, #{
|
||||||
code => <<"ALREADY_EXISTS">>,
|
code => <<"ALREADY_EXISTS">>,
|
||||||
message => binfmt("User '~ts' already exist", [binjoin(Exists)])
|
message => binfmt("User '~ts' already exist", [Exists])
|
||||||
}}
|
}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -531,7 +531,7 @@ clients(post, #{body := Body}) when is_list(Body) ->
|
||||||
{error, {already_exists, Exists}} ->
|
{error, {already_exists, Exists}} ->
|
||||||
{409, #{
|
{409, #{
|
||||||
code => <<"ALREADY_EXISTS">>,
|
code => <<"ALREADY_EXISTS">>,
|
||||||
message => binfmt("Client '~ts' already exist", [binjoin(Exists)])
|
message => binfmt("Client '~ts' already exist", [Exists])
|
||||||
}}
|
}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -762,16 +762,4 @@ ensure_rules_is_valid(Key, Type, MaxLen, [Cfg | Cfgs]) ->
|
||||||
ensure_rules_is_valid(_Key, _Type, _MaxLen, []) ->
|
ensure_rules_is_valid(_Key, _Type, _MaxLen, []) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
binjoin([Bin]) ->
|
|
||||||
Bin;
|
|
||||||
binjoin(Bins) when is_list(Bins) ->
|
|
||||||
binjoin(Bins, <<>>);
|
|
||||||
binjoin(Bin) ->
|
|
||||||
Bin.
|
|
||||||
|
|
||||||
binjoin([H | T], Acc) ->
|
|
||||||
binjoin(T, <<H/binary, $,, Acc/binary>>);
|
|
||||||
binjoin([], Acc) ->
|
|
||||||
Acc.
|
|
||||||
|
|
||||||
binfmt(Fmt, Args) -> iolist_to_binary(io_lib:format(Fmt, Args)).
|
binfmt(Fmt, Args) -> iolist_to_binary(io_lib:format(Fmt, Args)).
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
In the built-in database of authorization, added a limit for the length of rules per client/user, and the default values is 100.
|
Loading…
Reference in New Issue