Skip to content

Commit

Permalink
chore: update change
Browse files Browse the repository at this point in the history
  • Loading branch information
lafirest committed May 9, 2024
1 parent f641d0b commit d2ca4e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/emqx_rule_engine/src/emqx_rule_api_schema.erl
Expand Up @@ -289,7 +289,7 @@ fields("ctx_check_authn_complete") ->
{"event", event_sc(Event)},
{"clientid", sc(binary(), #{desc => ?DESC("event_clientid")})},
{"username", sc(binary(), #{desc => ?DESC("event_username")})},
{"peerhost", sc(binary(), #{desc => ?DESC("event_peerhost")})},
{"peername", sc(binary(), #{desc => ?DESC("event_peername")})},
{"is_anonymous", sc(boolean(), #{desc => ?DESC("event_is_anonymous")})},
{"is_superuser", sc(boolean(), #{desc => ?DESC("event_is_superuser")})}
];
Expand Down
7 changes: 4 additions & 3 deletions apps/emqx_rule_engine/src/emqx_rule_events.erl
Expand Up @@ -455,7 +455,8 @@ eventmsg_check_authn_complete(
_ClientInfo = #{
clientid := ClientId,
username := Username,
peerhost := PeerHost
peerhost := PeerHost,
peerport := PeerPort
},
#{is_anonymous := IsAnonymous} = Result
) ->
Expand All @@ -465,7 +466,7 @@ eventmsg_check_authn_complete(
#{
clientid => ClientId,
username => Username,
peerhost => ntoa(PeerHost),
peername => ntoa({PeerHost, PeerPort}),
is_anonymous => IsAnonymous,
is_superuser => IsSuperuser
},
Expand Down Expand Up @@ -1077,7 +1078,7 @@ columns_with_exam('client.check_authn_complete') ->
{<<"event">>, 'client.check_authz_complete'},
{<<"clientid">>, <<"c_emqx">>},
{<<"username">>, <<"u_emqx">>},
{<<"peerhost">>, <<"192.168.0.10">>},
{<<"peername">>, <<"192.168.0.10:56431">>},
{<<"is_superuser">>, true},
{<<"is_anonymous">>, false},
{<<"timestamp">>, erlang:system_time(millisecond)},
Expand Down
1 change: 1 addition & 0 deletions changes/ce/feat-12983.en.md
@@ -0,0 +1 @@
Add new rule engine event `$events/client_check_authn_complete` for authentication completion event.

0 comments on commit d2ca4e9

Please sign in to comment.