feat: add authz skipped trace
This commit is contained in:
parent
2d6b2bff8e
commit
d7cac74bed
|
@ -477,9 +477,14 @@ authorize_deny(
|
||||||
sources()
|
sources()
|
||||||
) ->
|
) ->
|
||||||
authz_result().
|
authz_result().
|
||||||
authorize(Client, PubSub, Topic, _DefaultResult, Sources) ->
|
authorize(#{username := Username} = Client, PubSub, Topic, _DefaultResult, Sources) ->
|
||||||
case maps:get(is_superuser, Client, false) of
|
case maps:get(is_superuser, Client, false) of
|
||||||
true ->
|
true ->
|
||||||
|
?TRACE("AUTHZ", "authorization_skipped_as_superuser", #{
|
||||||
|
username => Username,
|
||||||
|
topic => Topic,
|
||||||
|
action => emqx_access_control:format_action(PubSub)
|
||||||
|
}),
|
||||||
emqx_metrics:inc(?METRIC_SUPERUSER),
|
emqx_metrics:inc(?METRIC_SUPERUSER),
|
||||||
{stop, #{result => allow, from => superuser}};
|
{stop, #{result => allow, from => superuser}};
|
||||||
false ->
|
false ->
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Add trace logging when superuser skipped authz check.
|
Loading…
Reference in New Issue