chore(authz): fix spelling errors
This commit is contained in:
parent
4fa816fa97
commit
c322957257
|
@ -354,7 +354,7 @@ sources(put, #{body := Body}) when is_list(Body) ->
|
||||||
|
|
||||||
source(get, #{bindings := #{type := Type}}) ->
|
source(get, #{bindings := #{type := Type}}) ->
|
||||||
case emqx_authz:lookup(Type) of
|
case emqx_authz:lookup(Type) of
|
||||||
{error, Reason} -> {404, #{messgae => atom_to_binary(Reason)}};
|
{error, Reason} -> {404, #{message => atom_to_binary(Reason)}};
|
||||||
#{type := file, enable := Enable, path := Path}->
|
#{type := file, enable := Enable, path := Path}->
|
||||||
case file:consult(Path) of
|
case file:consult(Path) of
|
||||||
{ok, Rules} ->
|
{ok, Rules} ->
|
||||||
|
@ -366,7 +366,7 @@ source(get, #{bindings := #{type := Type}}) ->
|
||||||
};
|
};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{400, #{code => <<"BAD_REQUEST">>,
|
{400, #{code => <<"BAD_REQUEST">>,
|
||||||
messgae => atom_to_binary(Reason)}}
|
message => atom_to_binary(Reason)}}
|
||||||
end;
|
end;
|
||||||
#{enable := false} = Source -> {200, Source#{annotations => #{status => unhealthy}}};
|
#{enable := false} = Source -> {200, Source#{annotations => #{status => unhealthy}}};
|
||||||
#{annotations := #{id := Id}} = Source ->
|
#{annotations := #{id := Id}} = Source ->
|
||||||
|
@ -394,7 +394,7 @@ source(put, #{bindings := #{type := <<"file">>}, body := #{<<"type">> := <<"file
|
||||||
{ok, _} -> {204};
|
{ok, _} -> {204};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{400, #{code => <<"BAD_REQUEST">>,
|
{400, #{code => <<"BAD_REQUEST">>,
|
||||||
messgae => atom_to_binary(Reason)}}
|
message => atom_to_binary(Reason)}}
|
||||||
end;
|
end;
|
||||||
source(put, #{bindings := #{type := Type}, body := Body}) when is_map(Body) ->
|
source(put, #{bindings := #{type := Type}, body := Body}) when is_map(Body) ->
|
||||||
update_config({replace_once, Type}, write_cert(Body));
|
update_config({replace_once, Type}, write_cert(Body));
|
||||||
|
@ -406,10 +406,10 @@ move_source(post, #{bindings := #{type := Type}, body := #{<<"position">> := Pos
|
||||||
{ok, _} -> {204};
|
{ok, _} -> {204};
|
||||||
{error, not_found_source} ->
|
{error, not_found_source} ->
|
||||||
{404, #{code => <<"NOT_FOUND">>,
|
{404, #{code => <<"NOT_FOUND">>,
|
||||||
messgae => <<"source ", Type/binary, " not found">>}};
|
message => <<"source ", Type/binary, " not found">>}};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{400, #{code => <<"BAD_REQUEST">>,
|
{400, #{code => <<"BAD_REQUEST">>,
|
||||||
messgae => atom_to_binary(Reason)}}
|
message => atom_to_binary(Reason)}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
update_config(Cmd, Sources) ->
|
update_config(Cmd, Sources) ->
|
||||||
|
@ -417,13 +417,13 @@ update_config(Cmd, Sources) ->
|
||||||
{ok, _} -> {204};
|
{ok, _} -> {204};
|
||||||
{error, {pre_config_update, emqx_authz, Reason}} ->
|
{error, {pre_config_update, emqx_authz, Reason}} ->
|
||||||
{400, #{code => <<"BAD_REQUEST">>,
|
{400, #{code => <<"BAD_REQUEST">>,
|
||||||
messgae => atom_to_binary(Reason)}};
|
message => atom_to_binary(Reason)}};
|
||||||
{error, {post_config_update, emqx_authz, Reason}} ->
|
{error, {post_config_update, emqx_authz, Reason}} ->
|
||||||
{400, #{code => <<"BAD_REQUEST">>,
|
{400, #{code => <<"BAD_REQUEST">>,
|
||||||
messgae => atom_to_binary(Reason)}};
|
message => atom_to_binary(Reason)}};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{400, #{code => <<"BAD_REQUEST">>,
|
{400, #{code => <<"BAD_REQUEST">>,
|
||||||
messgae => atom_to_binary(Reason)}}
|
message => atom_to_binary(Reason)}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
read_cert(#{ssl := #{enable := true} = SSL} = Source) ->
|
read_cert(#{ssl := #{enable := true} = SSL} = Source) ->
|
||||||
|
|
Loading…
Reference in New Issue