Merge pull request #7918 from lafirest/fix/authz_info

fix(authz): add authz source type into the authorize logger
This commit is contained in:
lafirest 2022-05-12 09:09:58 +08:00 committed by GitHub
commit 941307c101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -308,7 +308,8 @@ authorize(
msg => "authorization_permission_allowed", msg => "authorization_permission_allowed",
username => Username, username => Username,
ipaddr => IpAddress, ipaddr => IpAddress,
topic => Topic topic => Topic,
source => AuthzSource
}), }),
emqx_metrics_worker:inc(authz_metrics, AuthzSource, allow), emqx_metrics_worker:inc(authz_metrics, AuthzSource, allow),
emqx_metrics:inc(?METRIC_ALLOW), emqx_metrics:inc(?METRIC_ALLOW),
@ -322,7 +323,8 @@ authorize(
msg => "authorization_permission_denied", msg => "authorization_permission_denied",
username => Username, username => Username,
ipaddr => IpAddress, ipaddr => IpAddress,
topic => Topic topic => Topic,
source => AuthzSource
}), }),
emqx_metrics_worker:inc(authz_metrics, AuthzSource, deny), emqx_metrics_worker:inc(authz_metrics, AuthzSource, deny),
emqx_metrics:inc(?METRIC_DENY), emqx_metrics:inc(?METRIC_DENY),