-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL - Implement account queries #3503
Conversation
Codecov Report
@@ Coverage Diff @@
## feature/graphql #3503 +/- ##
===================================================
+ Coverage 81.12% 81.19% +0.06%
===================================================
Files 439 446 +7
Lines 32660 32774 +114
===================================================
+ Hits 26497 26612 +115
+ Misses 6163 6162 -1
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
3687d8a
to
5b5651c
Compare
This comment has been minimized.
This comment has been minimized.
5b5651c
to
0e97cff
Compare
This comment has been minimized.
This comment has been minimized.
0e97cff
to
9f344ef
Compare
This comment has been minimized.
This comment has been minimized.
9f344ef
to
65f7f6c
Compare
This comment has been minimized.
This comment has been minimized.
65f7f6c
to
af50d41
Compare
This comment has been minimized.
This comment has been minimized.
26fa3ec
to
9c6914c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9c6914c
to
5ed489a
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments, nice progress :)
|
||
-spec set_random_password(JID, Reason) -> Result when | ||
JID :: jid:jid(), | ||
Reason :: binary(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we need to define a type for Reason
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What it should be? -type reason() :: binary().
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes :)
io_lib:format("~4..0w-~2..0w-~2..0wT~2..0w:~2..0w:~2..0wZ", | ||
[Year, Month, Day, Hour, Minute, Second]))), | ||
RandomString = mongoose_bin:gen_from_crypto(), | ||
<<"BANNED_ACCOUNT--", Date/binary, "--", RandomString/binary, "--", Reason/binary>>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is kinda evil way to ban users, lol. Haaack.
That should be documented somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to document it, but I think this falls out of scope of this PR as the code is unchanged here.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
48edd64
to
e0df2b5
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6901485
to
79af246
Compare
This comment has been minimized.
This comment has been minimized.
79af246
to
c1e8dbd
Compare
small_tests_24 / small_tests / c1e8dbd small_tests_23 / small_tests / c1e8dbd dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / c1e8dbd dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / c1e8dbd dynamic_domains_mysql_redis_24 / mysql_redis / c1e8dbd ldap_mnesia_23 / ldap_mnesia / c1e8dbd dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / c1e8dbd ldap_mnesia_24 / ldap_mnesia / c1e8dbd internal_mnesia_24 / internal_mnesia / c1e8dbd pgsql_mnesia_23 / pgsql_mnesia / c1e8dbd pgsql_mnesia_24 / pgsql_mnesia / c1e8dbd mssql_mnesia_24 / odbc_mssql_mnesia / c1e8dbd elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / c1e8dbd riak_mnesia_24 / riak_mnesia / c1e8dbd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of good work done here! I only have very minor remarks.
small_tests_24 / small_tests / f2c450f small_tests_23 / small_tests / f2c450f internal_mnesia_24 / internal_mnesia / f2c450f dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / f2c450f dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / f2c450f dynamic_domains_mysql_redis_24 / mysql_redis / f2c450f dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / f2c450f ldap_mnesia_23 / ldap_mnesia / f2c450f ldap_mnesia_24 / ldap_mnesia / f2c450f pgsql_mnesia_23 / pgsql_mnesia / f2c450f pgsql_mnesia_24 / pgsql_mnesia / f2c450f elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / f2c450f mysql_redis_24 / mysql_redis / f2c450f mssql_mnesia_24 / odbc_mssql_mnesia / f2c450f riak_mnesia_24 / riak_mnesia / f2c450f internal_mnesia_24 / internal_mnesia / f2c450f internal_mnesia_24 / internal_mnesia / f2c450f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's all good for me!
This PR addresses MIM-1580 and adds account API for admin and user.
The old API functions have been extracted from
mod_commands
,ejabberd_admin
andservice_admin_extra_accounts
modules to newmongoose_account_api
module. Now old API modules usemongoose_account_api
what standardized the result. The resulting account API returns a formatted message, so I didn't need to specify pretty error messages especially for GraphQL.Unfortunately, it does not follow the error message formatting convention inmongoose_graphql_errors
.Maybe because of extracting and reusing the old API, everything is more complicated now? Please tell me what do you think about it.