Skip to content
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

Use dynamic aware check for global domains in ACL module #3327

Merged
merged 2 commits into from
Oct 12, 2021

Conversation

arcusfelis
Copy link
Contributor

This PR addresses MIM-1522

Proposed changes include:

  • Use dynamic aware check for global domains in ACL module
  • Add dynamic domain testing for ACL
  • Add mongoose_domain_api:stop/0 function

Does not add support to allow to do ACL per host-type. I think a separate PR is needed for that ;)

Add dynamic domain testing for ACL
Add mongoose_domain_api:stop/0 function
@mongoose-im
Copy link
Collaborator

mongoose-im commented Oct 8, 2021

small_tests_24 / small_tests / 2da2c7e
Reports root / small


internal_mnesia_24 / internal_mnesia / 2da2c7e
Reports root/ big
OK: 1589 / Failed: 0 / User-skipped: 297 / Auto-skipped: 0


small_tests_23 / small_tests / 2da2c7e
Reports root / small


dynamic_domains_mysql_redis_24 / mysql_redis / 2da2c7e
Reports root/ big
OK: 2684 / Failed: 1 / User-skipped: 201 / Auto-skipped: 0

dynamic_domains_SUITE:with_mod_dynamic_domains_test:packet_handling_for_subdomain
{error,
  {{badrpc,
     {'EXIT',
       {timeout,
         [{meck_proc,wait,6,
            [{file,
               "/home/circleci/app/_build/default/lib/meck/src/meck_proc.erl"},
             {line,171}]},
          {meck,wait,5,[]}]}}},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},
       meck,wait,
       [3,mod_dynamic_domains_test,process_packet,5,500]],
      [{file,"/home/circleci/app/big_tests/tests/distributed_helper.erl"},
       {line,117}]},
    {dynamic_domains_SUITE,'-packet_handling_for_subdomain/1-fun-3-',1,
      [{file,
         "/home/circleci/app/big_tests/tests/dynamic_domains_SUITE.erl"},
       {line,113}]},
    {escalus_story,story,4,
      [{file,
         "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
       {line,72}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1292}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1224}]}]}}

Report log


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 2da2c7e
Reports root/ big
OK: 2702 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 2da2c7e
Reports root/ big
OK: 2702 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 2da2c7e
Reports root/ big
OK: 1486 / Failed: 0 / User-skipped: 400 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 2da2c7e
Reports root/ big
OK: 1486 / Failed: 0 / User-skipped: 400 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 2da2c7e
Reports root/ big
OK: 2702 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 2da2c7e
Reports root/ big
OK: 3107 / Failed: 2 / User-skipped: 211 / Auto-skipped: 0

jingle_SUITE:all:resp_4xx_from_sip_proxy_results_in_session_terminate
{error,
  {{assertion_failed,assert,is_iq_result,
     {xmlel,<<"iq">>,
       [{<<"from">>,<<"error.480@localhost">>},
        {<<"to">>,
         <<"alice_resp_4xx_from_sip_proxy_results_in_session_terminate_86.490486@localhost/res1">>},
        {<<"id">>,<<"213f72ae-75b0-4c7a-af34-58454d6a86e3">>},
        {<<"type">>,<<"set">>}],
       [{xmlel,<<"jingle">>,
          [{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
           {<<"action">>,<<"session-terminate">>},
           {<<"sid">>,<<"88e8cd58-6b73-478f-b6d5-2066b7e69399">>}],
          [{xmlel,<<"reason">>,[],
             [{xmlel,<<"general-error">>,[],[]},
            {xmlel,<<"sip-error">>,
              [{<<"code">>,<<"480">>}],
              [{xmlcdata,<<"Temporarily Unavailable">>}]}]}]}]},
     "<iq from='error.480@localhost' to='alice_resp_4xx_from_sip_proxy_results_in_session_terminate_86.490486@localhost/res1' id='213f72ae-75b0-4c7a-af34-58454d6a86e3' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' sid='88e8cd58-6b73-478f-b6d5-2066b7e69399'><reason><general-error/><sip-error code='480'>Temporarily Unavailable</sip-error></reason></jingle></iq>"},
   [{escalus_new_assert,assert_true,2,
      [{file,
         "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
       {line,84}]},
    {jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
      [{file,"/home/circleci/app/big_tests/tests/jingle_SUITE.erl"},
       {line,395}]},
    {jingle_SUITE,
      '-res...

Report log

jingle_SUITE:all:resp_4xx_from_sip_proxy_results_in_session_terminate
{error,
  {{assertion_failed,assert,is_iq_result,
     {xmlel,<<"iq">>,
       [{<<"from">>,<<"error.480@localhost">>},
        {<<"to">>,
         <<"alice_resp_4xx_from_sip_proxy_results_in_session_terminate_96.417289@localhost/res1">>},
        {<<"id">>,<<"178ea6ce-5382-4e12-b4a2-e0bc8278d4ab">>},
        {<<"type">>,<<"set">>}],
       [{xmlel,<<"jingle">>,
          [{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
           {<<"action">>,<<"session-terminate">>},
           {<<"sid">>,<<"2c90ec13-a074-4a0f-8716-d9ce5403237c">>}],
          [{xmlel,<<"reason">>,[],
             [{xmlel,<<"general-error">>,[],[]},
            {xmlel,<<"sip-error">>,
              [{<<"code">>,<<"480">>}],
              [{xmlcdata,<<"Temporarily Unavailable">>}]}]}]}]},
     "<iq from='error.480@localhost' to='alice_resp_4xx_from_sip_proxy_results_in_session_terminate_96.417289@localhost/res1' id='178ea6ce-5382-4e12-b4a2-e0bc8278d4ab' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' sid='2c90ec13-a074-4a0f-8716-d9ce5403237c'><reason><general-error/><sip-error code='480'>Temporarily Unavailable</sip-error></reason></jingle></iq>"},
   [{escalus_new_assert,assert_true,2,
      [{file,
         "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
       {line,84}]},
    {jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
      [{file,"/home/circleci/app/big_tests/tests/jingle_SUITE.erl"},
       {line,395}]},
    {jingle_SUITE,
      '-res...

Report log


mysql_redis_24 / mysql_redis / 2da2c7e
Reports root/ big
OK: 3054 / Failed: 0 / User-skipped: 228 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 2da2c7e
Reports root/ big
OK: 1862 / Failed: 0 / User-skipped: 323 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 2da2c7e
Reports root/ big
OK: 3071 / Failed: 0 / User-skipped: 211 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 2da2c7e
Reports root/ big
OK: 3071 / Failed: 0 / User-skipped: 211 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 2da2c7e
Reports root/ big
OK: 1709 / Failed: 0 / User-skipped: 326 / Auto-skipped: 0

@codecov
Copy link

codecov bot commented Oct 8, 2021

Codecov Report

Merging #3327 (ddd2d8c) into master (ba8bc97) will increase coverage by 0.02%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3327      +/-   ##
==========================================
+ Coverage   80.69%   80.71%   +0.02%     
==========================================
  Files         397      397              
  Lines       32434    32440       +6     
==========================================
+ Hits        26171    26185      +14     
+ Misses       6263     6255       -8     
Impacted Files Coverage Δ
src/acl.erl 92.20% <66.66%> (-1.13%) ⬇️
src/domain/mongoose_domain_api.erl 100.00% <100.00%> (ø)
src/mongoose_tcp_listener.erl 76.59% <0.00%> (-4.26%) ⬇️
src/mam/mod_mam_rdbms_async_pool_writer.erl 66.66% <0.00%> (-3.93%) ⬇️
...c/global_distrib/mod_global_distrib_server_mgr.erl 74.57% <0.00%> (-2.26%) ⬇️
src/mod_muc_log.erl 77.88% <0.00%> (ø)
src/pubsub/mod_pubsub.erl 73.34% <0.00%> (+0.11%) ⬆️
src/mod_roster_riak.erl 96.92% <0.00%> (+15.38%) ⬆️
src/mod_roster_mnesia.erl 93.93% <0.00%> (+21.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba8bc97...ddd2d8c. Read the comment docs.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Oct 11, 2021

small_tests_24 / small_tests / ddd2d8c
Reports root / small


internal_mnesia_24 / internal_mnesia / ddd2d8c
Reports root/ big
OK: 1589 / Failed: 0 / User-skipped: 297 / Auto-skipped: 0


small_tests_23 / small_tests / ddd2d8c
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / ddd2d8c
Reports root/ big
OK: 2702 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / ddd2d8c
Reports root/ big
OK: 1486 / Failed: 0 / User-skipped: 400 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / ddd2d8c
Reports root/ big
OK: 2702 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / ddd2d8c
Reports root/ big
OK: 2685 / Failed: 0 / User-skipped: 201 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / ddd2d8c
Reports root/ big
OK: 2702 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / ddd2d8c
Reports root/ big
OK: 1862 / Failed: 0 / User-skipped: 323 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / ddd2d8c
Reports root/ big
OK: 1486 / Failed: 0 / User-skipped: 400 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / ddd2d8c
Reports root/ big
OK: 3071 / Failed: 0 / User-skipped: 211 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / ddd2d8c
Reports root/ big
OK: 3054 / Failed: 0 / User-skipped: 228 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / ddd2d8c
Reports root/ big
OK: 3071 / Failed: 0 / User-skipped: 211 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / ddd2d8c
Reports root/ big
OK: 3071 / Failed: 0 / User-skipped: 211 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / ddd2d8c
Reports root/ big
OK: 1709 / Failed: 0 / User-skipped: 326 / Auto-skipped: 0

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me.

@@ -37,6 +39,15 @@ init() ->
mongoose_subdomain_core:start(),
mongoose_lazy_routing:start().

%% Stops gen_servers, that are started from init/0
%% Does not fail, even if servers are already stopped
-spec stop() -> ok.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this should be used only in tests because the way catch is used makes it completely ignore any errors.

@chrzaszcz chrzaszcz merged commit 02b7e96 into master Oct 12, 2021
@chrzaszcz chrzaszcz deleted the mu-acl-dynamic-domains-fix branch October 12, 2021 07:07
@Premwoik Premwoik added this to the 5.1.0 milestone May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants