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