feat(authz): fix typos and style for Retain & QoS authz feature
Co-authored-by: Thales Macedo Garitezi <thalesmg@gmail.com>
This commit is contained in:
parent
6db02d6b49
commit
77895f2555
8
Makefile
8
Makefile
|
@ -130,14 +130,14 @@ $(foreach app,$(APPS),$(eval $(call gen-app-prop-target,$(app))))
|
|||
ct-suite: $(REBAR) merge-config clean-test-cluster-config
|
||||
ifneq ($(TESTCASE),)
|
||||
ifneq ($(GROUP),)
|
||||
$(REBAR) ct -c -v --readable=$(CT_READABLE) --name $(CT_NODE_NAME) --suite $(SUITE) --case $(TESTCASE) --group $(GROUP)
|
||||
$(REBAR) ct -v --readable=$(CT_READABLE) --name $(CT_NODE_NAME) --suite $(SUITE) --case $(TESTCASE) --group $(GROUP)
|
||||
else
|
||||
$(REBAR) ct -c -v --readable=$(CT_READABLE) --name $(CT_NODE_NAME) --suite $(SUITE) --case $(TESTCASE)
|
||||
$(REBAR) ct -v --readable=$(CT_READABLE) --name $(CT_NODE_NAME) --suite $(SUITE) --case $(TESTCASE)
|
||||
endif
|
||||
else ifneq ($(GROUP),)
|
||||
$(REBAR) ct -c -v --readable=$(CT_READABLE) --name $(CT_NODE_NAME) --suite $(SUITE) --group $(GROUP)
|
||||
$(REBAR) ct -v --readable=$(CT_READABLE) --name $(CT_NODE_NAME) --suite $(SUITE) --group $(GROUP)
|
||||
else
|
||||
$(REBAR) ct -c -v --readable=$(CT_READABLE) --name $(CT_NODE_NAME) --suite $(SUITE)
|
||||
$(REBAR) ct -v --readable=$(CT_READABLE) --name $(CT_NODE_NAME) --suite $(SUITE)
|
||||
endif
|
||||
|
||||
.PHONY: cover
|
||||
|
|
|
@ -1840,7 +1840,7 @@ check_pub_alias(_Packet, _Channel) ->
|
|||
ok.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Athorization action
|
||||
%% Authorization action
|
||||
|
||||
authz_action(#mqtt_packet{
|
||||
header = #mqtt_packet_header{qos = QoS, retain = Retain}, variable = #mqtt_packet_publish{}
|
||||
|
|
|
@ -49,12 +49,12 @@
|
|||
username => user1,
|
||||
rules => [
|
||||
#{
|
||||
topic => <<"test/toopic/1">>,
|
||||
topic => <<"test/topic/1">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"publish">>
|
||||
},
|
||||
#{
|
||||
topic => <<"test/toopic/2">>,
|
||||
topic => <<"test/topic/2">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"subscribe">>
|
||||
},
|
||||
|
@ -64,14 +64,14 @@
|
|||
action => <<"all">>
|
||||
},
|
||||
#{
|
||||
topic => <<"test/toopic/3">>,
|
||||
topic => <<"test/topic/3">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"publish">>,
|
||||
qos => [<<"1">>],
|
||||
retain => <<"true">>
|
||||
},
|
||||
#{
|
||||
topic => <<"test/toopic/4">>,
|
||||
topic => <<"test/topic/4">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"publish">>,
|
||||
qos => [<<"0">>, <<"1">>, <<"2">>],
|
||||
|
@ -83,12 +83,12 @@
|
|||
clientid => client1,
|
||||
rules => [
|
||||
#{
|
||||
topic => <<"test/toopic/1">>,
|
||||
topic => <<"test/topic/1">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"publish">>
|
||||
},
|
||||
#{
|
||||
topic => <<"test/toopic/2">>,
|
||||
topic => <<"test/topic/2">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"subscribe">>
|
||||
},
|
||||
|
@ -98,14 +98,14 @@
|
|||
action => <<"all">>
|
||||
},
|
||||
#{
|
||||
topic => <<"test/toopic/3">>,
|
||||
topic => <<"test/topic/3">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"publish">>,
|
||||
qos => [<<"1">>],
|
||||
retain => <<"true">>
|
||||
},
|
||||
#{
|
||||
topic => <<"test/toopic/4">>,
|
||||
topic => <<"test/topic/4">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"publish">>,
|
||||
qos => [<<"0">>, <<"1">>, <<"2">>],
|
||||
|
@ -116,12 +116,12 @@
|
|||
-define(ALL_RULES_EXAMPLE, #{
|
||||
rules => [
|
||||
#{
|
||||
topic => <<"test/toopic/1">>,
|
||||
topic => <<"test/topic/1">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"publish">>
|
||||
},
|
||||
#{
|
||||
topic => <<"test/toopic/2">>,
|
||||
topic => <<"test/topic/2">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"subscribe">>
|
||||
},
|
||||
|
@ -131,14 +131,14 @@
|
|||
action => <<"all">>
|
||||
},
|
||||
#{
|
||||
topic => <<"test/toopic/3">>,
|
||||
topic => <<"test/topic/3">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"publish">>,
|
||||
qos => [<<"1">>],
|
||||
retain => <<"true">>
|
||||
},
|
||||
#{
|
||||
topic => <<"test/toopic/4">>,
|
||||
topic => <<"test/topic/4">>,
|
||||
permission => <<"allow">>,
|
||||
action => <<"publish">>,
|
||||
qos => [<<"0">>, <<"1">>, <<"2">>],
|
||||
|
|
|
@ -525,7 +525,7 @@ read_acl_file(#{<<"path">> := Path} = Source) ->
|
|||
maps:remove(<<"path">>, Source#{<<"rules">> => Rules}).
|
||||
|
||||
%%------------------------------------------------------------------------------
|
||||
%% Extednded Features
|
||||
%% Extended Features
|
||||
%%------------------------------------------------------------------------------
|
||||
|
||||
-define(DEFAULT_RICH_ACTIONS, true).
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
-type rule() :: {permission(), who_condition(), action_condition(), topic_condition()}.
|
||||
|
||||
-type qos() :: 0..2.
|
||||
-type qos() :: emqx_types:qos().
|
||||
-type retain() :: boolean().
|
||||
-type action() ::
|
||||
#{action_type := subscribe, qos := qos()}
|
||||
|
|
Loading…
Reference in New Issue