fix: format the code to remove extra spaces
This commit is contained in:
parent
e6997dc1ce
commit
8207090419
|
@ -50,14 +50,12 @@ roots() ->
|
|||
].
|
||||
|
||||
fields(get) ->
|
||||
[ {method, #{type => get,
|
||||
default => post}}
|
||||
[ {method, #{type => get, default => post}}
|
||||
, {headers, fun headers_no_content_type/1}
|
||||
] ++ common_fields();
|
||||
|
||||
fields(post) ->
|
||||
[ {method, #{type => post,
|
||||
default => post}}
|
||||
[ {method, #{type => post, default => post}}
|
||||
, {headers, fun headers/1}
|
||||
] ++ common_fields().
|
||||
|
||||
|
|
|
@ -64,8 +64,7 @@ fields('jwks') ->
|
|||
[ {use_jwks, {enum, [true]}}
|
||||
, {endpoint, fun endpoint/1}
|
||||
, {refresh_interval, fun refresh_interval/1}
|
||||
, {ssl, #{type => hoconsc:union(
|
||||
[ hoconsc:ref(?MODULE, ssl_enable)
|
||||
, {ssl, #{type => hoconsc:union([ hoconsc:ref(?MODULE, ssl_enable)
|
||||
, hoconsc:ref(?MODULE, ssl_disable)
|
||||
]),
|
||||
default => #{<<"enable">> => false}}}
|
||||
|
|
|
@ -222,24 +222,36 @@ schema("/authorization/sources/built-in-database/purge-all") ->
|
|||
}.
|
||||
|
||||
fields(rule_item) ->
|
||||
[ {topic, hoconsc:mk( string()
|
||||
, #{ required => true
|
||||
[ {topic, hoconsc:mk(string(),
|
||||
#{ required => true
|
||||
, desc => <<"Rule on specific topic">>
|
||||
, example => <<"test/topic/1">>})}
|
||||
, {permission, hoconsc:mk( hoconsc:enum([allow, deny])
|
||||
, #{desc => <<"Permission">>, required => true, example => allow})}
|
||||
, {action, hoconsc:mk( hoconsc:enum([publish, subscribe, all])
|
||||
, #{ required => true, example => publish
|
||||
, desc => <<"Authorized action">> })} ];
|
||||
, example => <<"test/topic/1">>
|
||||
})}
|
||||
, {permission, hoconsc:mk(hoconsc:enum([allow, deny]),
|
||||
#{ desc => <<"Permission">>
|
||||
, required => true
|
||||
, example => allow
|
||||
})}
|
||||
, {action, hoconsc:mk(hoconsc:enum([publish, subscribe, all]),
|
||||
#{ required => true
|
||||
, example => publish
|
||||
, desc => <<"Authorized action">>
|
||||
})}
|
||||
];
|
||||
fields(clientid) ->
|
||||
[ {clientid, hoconsc:mk( binary()
|
||||
, #{ in => path, required => true
|
||||
, desc => <<"ClientID">>, example => <<"client1">>})}
|
||||
[ {clientid, hoconsc:mk(binary(),
|
||||
#{ in => path
|
||||
, required => true
|
||||
, desc => <<"ClientID">>
|
||||
, example => <<"client1">>
|
||||
})}
|
||||
];
|
||||
fields(username) ->
|
||||
[ {username, hoconsc:mk( binary()
|
||||
, #{ in => path, required => true
|
||||
, desc => <<"Username">>, example => <<"user1">>})}
|
||||
[ {username, hoconsc:mk(binary(),
|
||||
#{ in => path
|
||||
, required => true
|
||||
, desc => <<"Username">>
|
||||
, example => <<"user1">>})}
|
||||
];
|
||||
fields(rules_for_username) ->
|
||||
[ {rules, hoconsc:mk(hoconsc:array(hoconsc:ref(rule_item)), #{})}
|
||||
|
|
|
@ -32,20 +32,9 @@
|
|||
start_link() ->
|
||||
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
|
||||
|
||||
%% sup_flags() = #{strategy => strategy(), % optional
|
||||
%% intensity => non_neg_integer(), % optional
|
||||
%% period => pos_integer()} % optional
|
||||
%% child_spec() = #{id => child_id(), % mandatory
|
||||
%% start => mfargs(), % mandatory
|
||||
%% restart => restart(), % optional
|
||||
%% shutdown => shutdown(), % optional
|
||||
%% type => worker(), % optional
|
||||
%% modules => modules()} % optional
|
||||
init([]) ->
|
||||
SupFlags = #{strategy => one_for_all,
|
||||
intensity => 0,
|
||||
period => 1},
|
||||
ChildSpecs = [],
|
||||
{ok, {SupFlags, ChildSpecs}}.
|
||||
|
||||
%% internal functions
|
||||
|
|
Loading…
Reference in New Issue