25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

Merge pull request #3486 from comradekingu/patch-2

ejabberd_oauth language reworked
This commit is contained in:
badlop 2021-01-15 17:52:33 +01:00 committed by GitHub
commit 9b1da6f5f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,19 +80,19 @@
get_commands_spec() -> get_commands_spec() ->
[ [
#ejabberd_commands{name = oauth_issue_token, tags = [oauth], #ejabberd_commands{name = oauth_issue_token, tags = [oauth],
desc = "Issue an oauth token for the given jid", desc = "Issue an OAuth token for the given JID",
module = ?MODULE, function = oauth_issue_token, module = ?MODULE, function = oauth_issue_token,
args = [{jid, string},{ttl, integer}, {scopes, string}], args = [{jid, string},{ttl, integer}, {scopes, string}],
policy = restricted, policy = restricted,
args_example = ["user@server.com", 3600, "connected_users_number;muc_online_rooms"], args_example = ["user@server.com", 3600, "connected_users_number;muc_online_rooms"],
args_desc = ["Jid for which issue token", args_desc = ["JID for which issue token",
"Time to live of generated token in seconds", "Time to live of generated token in seconds",
"List of scopes to allow, separated by ';'"], "List of scopes to allow, separated by ';'"],
result = {result, {tuple, [{token, string}, {scopes, string}, {expires_in, string}]}} result = {result, {tuple, [{token, string}, {scopes, string}, {expires_in, string}]}}
}, },
#ejabberd_commands{name = oauth_list_tokens, tags = [oauth], #ejabberd_commands{name = oauth_list_tokens, tags = [oauth],
desc = "List oauth tokens, user, scope, and seconds to expire (only Mnesia)", desc = "List OAuth tokens, user, scope, and seconds to expire (only Mnesia)",
longdesc = "List oauth tokens, their user and scope, and how many seconds remain until expirity", longdesc = "List OAuth tokens, their user and scope, and how many seconds remain until expirity",
module = ?MODULE, function = oauth_list_tokens, module = ?MODULE, function = oauth_list_tokens,
args = [], args = [],
policy = restricted, policy = restricted,
@ -107,7 +107,7 @@ get_commands_spec() ->
result_desc = "List of remaining tokens" result_desc = "List of remaining tokens"
}, },
#ejabberd_commands{name = oauth_add_client_password, tags = [oauth], #ejabberd_commands{name = oauth_add_client_password, tags = [oauth],
desc = "Add OAUTH client_id with password grant type", desc = "Add OAuth client_id with password grant type",
module = ?MODULE, function = oauth_add_client_password, module = ?MODULE, function = oauth_add_client_password,
args = [{client_id, binary}, args = [{client_id, binary},
{client_name, binary}, {client_name, binary},
@ -116,7 +116,7 @@ get_commands_spec() ->
result = {res, restuple} result = {res, restuple}
}, },
#ejabberd_commands{name = oauth_add_client_implicit, tags = [oauth], #ejabberd_commands{name = oauth_add_client_implicit, tags = [oauth],
desc = "Add OAUTH client_id with implicit grant type", desc = "Add OAuth client_id with implicit grant type",
module = ?MODULE, function = oauth_add_client_implicit, module = ?MODULE, function = oauth_add_client_implicit,
args = [{client_id, binary}, args = [{client_id, binary},
{client_name, binary}, {client_name, binary},
@ -125,7 +125,7 @@ get_commands_spec() ->
result = {res, restuple} result = {res, restuple}
}, },
#ejabberd_commands{name = oauth_remove_client, tags = [oauth], #ejabberd_commands{name = oauth_remove_client, tags = [oauth],
desc = "Remove OAUTH client_id", desc = "Remove OAuth client_id",
module = ?MODULE, function = oauth_remove_client, module = ?MODULE, function = oauth_remove_client,
args = [{client_id, binary}], args = [{client_id, binary}],
policy = restricted, policy = restricted,
@ -496,7 +496,7 @@ process(_Handlers,
?XAE(<<"form">>, ?XAE(<<"form">>,
[{<<"action">>, <<"authorization_token">>}, [{<<"action">>, <<"authorization_token">>},
{<<"method">>, <<"post">>}], {<<"method">>, <<"post">>}],
[?LABEL(<<"username">>, [?CT(?T("User (jid)")), ?C(<<": ">>)]), [?LABEL(<<"username">>, [?CT(?T("User (JID)")), ?C(<<": ">>)]),
?INPUTID(<<"email">>, <<"username">>, <<"">>), ?INPUTID(<<"email">>, <<"username">>, <<"">>),
?BR, ?BR,
?LABEL(<<"password">>, [?CT(?T("Password")), ?C(<<": ">>)]), ?LABEL(<<"password">>, [?CT(?T("Password")), ?C(<<": ">>)]),
@ -547,7 +547,7 @@ process(_Handlers,
?C(<<" is maintained by ">>), ?C(<<" is maintained by ">>),
?XAC(<<"a">>, ?XAC(<<"a">>,
[{<<"href">>, <<"https://www.process-one.net">>}, [{<<"href">>, <<"https://www.process-one.net">>},
{<<"title">>, <<"ProcessOne - Leader in Instant Messaging and Push Solutions">>}], {<<"title">>, <<"ProcessOneLeader in Instant Messaging and Push Solutions">>}],
<<"ProcessOne">>) <<"ProcessOne">>)
])]), ])]),
Body = ?DIV(<<"container">>, [Top, Middle, Bottom]), Body = ?DIV(<<"container">>, [Top, Middle, Bottom]),