-
Notifications
You must be signed in to change notification settings - Fork 428
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
Unified REST API: domains #3768
Unified REST API: domains #3768
Conversation
small_tests_24 / small_tests / 05a93cf small_tests_25 / small_tests / 05a93cf dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 05a93cf ldap_mnesia_24 / ldap_mnesia / 05a93cf dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 05a93cf ldap_mnesia_25 / ldap_mnesia / 05a93cf dynamic_domains_mysql_redis_25 / mysql_redis / 05a93cf dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 05a93cf pgsql_mnesia_24 / pgsql_mnesia / 05a93cf internal_mnesia_25 / internal_mnesia / 05a93cf elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 05a93cf pgsql_mnesia_25 / pgsql_mnesia / 05a93cf pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription{error,
{{badmatch,
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_unsubscribe_after_presence_unsubscription_2469@localhost">>},
{<<"to">>,
<<"bob_unsubscribe_after_presence_unsubscription_2469@localhost/res1">>},
{<<"type">>,<<"headline">>}],
[{xmlel,<<"event">>,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub#event">>}],
[{xmlel,<<"items">>,
[{<<"node">>,<<"TcU1T3picnLPjMOUD70PDw==">>}],
[{xmlel,<<"item">>,
[{<<"id">>,<<"salmon">>}],
[{xmlel,<<"entry">>,
[{<<"xmlns">>,
<<"http://www.w3.org/2005/Atom">>}],
[]}]}]}]},
{xmlel,<<"headers">>,
[{<<"xmlns">>,<<"http://jabber.org/protocol/shim">>}],
[]}]}]},
[{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
{line,384}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} mysql_redis_25 / mysql_redis / 05a93cf mssql_mnesia_25 / odbc_mssql_mnesia / 05a93cf inbox_extensions_SUITE:async_pools:one_to_one:mute_muted_entry_gets_unmuted{error,
{{assert,
[{module,inbox_extensions_SUITE},
{line,798},
{expression,"escalus_pred : is_message ( Message )"},
{expected,true},
{value,false}]},
[{inbox_extensions_SUITE,check_message_with_properties,4,
[{file,
"/home/circleci/project/big_tests/tests/inbox_extensions_SUITE.erl"},
{line,798}]},
{inbox_extensions_SUITE,set_inbox_properties,4,
[{file,
"/home/circleci/project/big_tests/tests/inbox_extensions_SUITE.erl"},
{line,792}]},
{inbox_extensions_SUITE,'-mute_muted_entry_gets_unmuted/1-fun-2-',2,
[{file,
"/home/circleci/project/big_tests/tests/inbox_extensions_SUITE.erl"},
{line,568}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} riak_mnesia_24 / riak_mnesia / 05a93cf |
Codecov ReportBase: 82.80% // Head: 82.81% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## feature/unified-rest-api #3768 +/- ##
============================================================
+ Coverage 82.80% 82.81% +0.01%
============================================================
Files 533 533
Lines 33895 33872 -23
============================================================
- Hits 28067 28052 -15
+ Misses 5828 5820 -8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This way we don't give the false impression of a password being checked. It already works like this for mongoose_domain_handler.
Error messages are changed to capitalized strings, because it is the convention used for the whole admin API. Error codes are left as they were except ones that are already provided by mongoose_admin_api itself, e.g. "401 Unauthorized". The error messages should be common for REST and GraphQL, but this unification is left for the future.
05a93cf
to
2e3e234
Compare
small_tests_24 / small_tests / 2e3e234 small_tests_25 / small_tests / 2e3e234 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 2e3e234 ldap_mnesia_24 / ldap_mnesia / 2e3e234 ldap_mnesia_25 / ldap_mnesia / 2e3e234 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 2e3e234 dynamic_domains_mysql_redis_25 / mysql_redis / 2e3e234 internal_mnesia_25 / internal_mnesia / 2e3e234 pgsql_mnesia_24 / pgsql_mnesia / 2e3e234 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 2e3e234 disco_and_caps_SUITE:disco_with_caps:user_cannot_query_friend_resources_with_unknown_node{error,{{assertion_failed,assert_many,false,[is_roster_set],[],[]},
[{escalus_new_assert,assert_true,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{escalus_story,'-make_all_clients_friends/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,112}]},
{escalus_utils,'-each_with_index/3-fun-0-',3,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
{line,87}]},
{lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
{escalus_utils,'-each_with_index/3-fun-0-',3,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
{line,87}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
{escalus_utils,distinct_pairs,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
{line,60}]},
{escalus_story,make_all_clients_friends,1,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,106}]}]}} elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 2e3e234 mysql_redis_25 / mysql_redis / 2e3e234 pgsql_mnesia_25 / pgsql_mnesia / 2e3e234 pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription{error,
{{badmatch,
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_unsubscribe_after_presence_unsubscription_2600@localhost">>},
{<<"to">>,
<<"bob_unsubscribe_after_presence_unsubscription_2600@localhost/res1">>},
{<<"type">>,<<"headline">>}],
[{xmlel,<<"event">>,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub#event">>}],
[{xmlel,<<"items">>,
[{<<"node">>,<<"ZEVA3Gg9Kn7IcrrvSz9yag==">>}],
[{xmlel,<<"item">>,
[{<<"id">>,<<"salmon">>}],
[{xmlel,<<"entry">>,
[{<<"xmlns">>,
<<"http://www.w3.org/2005/Atom">>}],
[]}]}]}]},
{xmlel,<<"headers">>,
[{<<"xmlns">>,<<"http://jabber.org/protocol/shim">>}],
[]}]}]},
[{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
{line,384}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} riak_mnesia_24 / riak_mnesia / 2e3e234 mssql_mnesia_25 / odbc_mssql_mnesia / 2e3e234 |
2e3e234
to
33b5d9c
Compare
small_tests_24 / small_tests / 33b5d9c small_tests_25 / small_tests / 33b5d9c dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 33b5d9c ldap_mnesia_24 / ldap_mnesia / 33b5d9c ldap_mnesia_25 / ldap_mnesia / 33b5d9c dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 33b5d9c dynamic_domains_mysql_redis_25 / mysql_redis / 33b5d9c dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 33b5d9c pgsql_mnesia_24 / pgsql_mnesia / 33b5d9c internal_mnesia_25 / internal_mnesia / 33b5d9c elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 33b5d9c pgsql_mnesia_25 / pgsql_mnesia / 33b5d9c mysql_redis_25 / mysql_redis / 33b5d9c mssql_mnesia_25 / odbc_mssql_mnesia / 33b5d9c riak_mnesia_24 / riak_mnesia / 33b5d9c |
Cover the unlikely case of an invalid domain name.
small_tests_24 / small_tests / 9082e6e small_tests_25 / small_tests / 9082e6e dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 9082e6e ldap_mnesia_24 / ldap_mnesia / 9082e6e dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 9082e6e ldap_mnesia_25 / ldap_mnesia / 9082e6e internal_mnesia_25 / internal_mnesia / 9082e6e pgsql_mnesia_24 / pgsql_mnesia / 9082e6e elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 9082e6e dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 9082e6e dynamic_domains_mysql_redis_25 / mysql_redis / 9082e6e mod_ping_SUITE:server_ping_kill:active_keep_alive{error,{{badrpc,timeout},
[{escalus_rpc,call_with_cookie_match,
[mongooseim@localhost,ejabberd_admin,register,
[<<"alicE_active_keep_alive_2087">>,
<<"domain.example.com">>,<<"matygrysa">>],
3000,ejabberd],
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_rpc.erl"},
{line,34}]},
{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},
{escalus_ejabberd,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_ejabberd.erl"},
{line,211}]},
{escalus_fresh,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,62}]},
{escalus_fresh,story,3,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,27}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} pgsql_mnesia_25 / pgsql_mnesia / 9082e6e mysql_redis_25 / mysql_redis / 9082e6e mod_event_pusher_rabbit_SUITE:group_chat_message_publish:group_chat_message_received_event_properly_formatted{error,
{{assertMatch,
[{module,mod_event_pusher_rabbit_SUITE},
{line,422},
{expression,
"get_decoded_message_from_rabbit ( AliceGroupChatMsgRecvRK )"},
{pattern,
"# { << \"from_user_id\" >> := BobRoomJID , << \"to_user_id\" >> := AliceFullJID , << \"message\" >> := Message }"},
{value,
#{<<"from_user_id">> => <<"muc_publish@muc.localhost">>,
<<"message">> => <<>>,
<<"to_user_id">> =>
<<"alice_unnamed_2058@localhost/res1">>}}]},
[{mod_event_pusher_rabbit_SUITE,
'-group_chat_message_received_event_properly_formatted/1-fun-1-',3,
[{file,
"/home/circleci/project/big_tests/tests/mod_event_pusher_rabbit_SUITE.erl"},
{line,422}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} mssql_mnesia_25 / odbc_mssql_mnesia / 9082e6e push_integration_SUITE:pubsub_ful:pm_notifications_with_inbox:inbox_msg_unread_count_apns{error,
{{assertMatch,
[{module,push_integration_SUITE},
{line,662},
{expression,"Data"},
{pattern,"# { << \"message-count\" >> := ExpectedCount }"},
{value,
#{<<"last-message-body">> => <<"Private message">>,
<<"last-message-sender">> =>
<<"alice_inbox_msg_unread_count_apns_2739@localhost">>,
<<"message-count">> => 1}}]},
[{push_integration_SUITE,check_notification,2,
[{file,
"/home/circleci/project/big_tests/tests/push_integration_SUITE.erl"},
{line,662}]},
{push_integration_SUITE,'-inbox_msg_unread_count/3-fun-0-',6,
[{file,
"/home/circleci/project/big_tests/tests/push_integration_SUITE.erl"},
{line,578}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} rest_client_SUITE:roster:add_contact_and_invite{error,{{badmatch,{{<<"500">>,<<"Internal Server Error">>},<<>>}},
[{rest_client_SUITE,add_contact_check_roster_push,2,
[{file,"/home/circleci/project/big_tests/tests/rest_client_SUITE.erl"},
{line,1304}]},
{rest_client_SUITE,'-add_contact_and_invite/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/rest_client_SUITE.erl"},
{line,1085}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{rest_client_SUITE,add_contact_and_invite,1,
[{file,"/home/circleci/project/big_tests/tests/rest_client_SUITE.erl"},
{line,1074}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} riak_mnesia_24 / riak_mnesia / 9082e6e mssql_mnesia_25 / odbc_mssql_mnesia / 9082e6e pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription{error,
{{badmatch,
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_unsubscribe_after_presence_unsubscription_2492@localhost">>},
{<<"to">>,
<<"bob_unsubscribe_after_presence_unsubscription_2492@localhost/res1">>},
{<<"type">>,<<"headline">>}],
[{xmlel,<<"event">>,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub#event">>}],
[{xmlel,<<"items">>,
[{<<"node">>,<<"jug+UMGS0zuZkupYa7MUZA==">>}],
[{xmlel,<<"item">>,
[{<<"id">>,<<"salmon">>}],
[{xmlel,<<"entry">>,
[{<<"xmlns">>,
<<"http://www.w3.org/2005/Atom">>}],
[]}]}]}]},
{xmlel,<<"headers">>,
[{<<"xmlns">>,<<"http://jabber.org/protocol/shim">>}],
[]}]}]},
[{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
{line,384}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} |
{[{{binary(), binary(), '*'}, atom()}], req(), state()}. | ||
content_types_accepted(Req, State) -> | ||
{[ | ||
{{<<"application">>, <<"json">>, '*'}, from_json} |
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.
Wouldn't it be better to write it in one line?
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 is like this in all API modules, and I think it is more readable this way (multiple nested tuples).
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.
ok
{[{{binary(), binary(), '*'}, atom()}], req(), state()}. | ||
content_types_provided(Req, State) -> | ||
{[ | ||
{{<<"application">>, <<"json">>, '*'}, to_json} |
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.
Wouldn't it be better to write it in one line?
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.
Looks good, I've added some minor suggestions.
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.
ok
Integrate the domain REST handler with
mongoose_admin_api
The domain handler had some custom code:
mongoose_admin_api
.{"what": "message"}
error messages. I decided to use the plain-text ones as inmongoose_admin_api
.mongoose_admin_api
.