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

C2s/privacy #3747

Merged
merged 3 commits into from
Oct 3, 2022
Merged

C2s/privacy #3747

merged 3 commits into from
Oct 3, 2022

Conversation

NelsonVides
Copy link
Collaborator

This implements privacy and blocking. They require presences.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Sep 3, 2022

Codecov Report

Base: 62.69% // Head: 64.13% // Increases project coverage by +1.43% 🎉

Coverage data is based on head (fadd027) compared to base (1976436).
Patch coverage: 86.25% of modified lines in pull request are covered.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/mongoose_c2s    #3747      +/-   ##
========================================================
+ Coverage                 62.69%   64.13%   +1.43%     
========================================================
  Files                       536      536              
  Lines                     34853    34990     +137     
========================================================
+ Hits                      21852    22441     +589     
+ Misses                    13001    12549     -452     
Impacted Files Coverage Δ
src/mongoose_xmpp_errors.erl 26.26% <ø> (+3.03%) ⬆️
src/mod_presence.erl 85.01% <25.00%> (-1.73%) ⬇️
src/ejabberd_c2s.erl 39.27% <41.17%> (ø)
src/mongoose_privacy.erl 93.33% <50.00%> (ø)
src/privacy/mod_blocking.erl 86.72% <91.66%> (ø)
src/privacy/mod_privacy.erl 88.88% <97.89%> (+69.22%) ⬆️
src/ejabberd_sm.erl 76.87% <100.00%> (ø)
src/mod_last.erl 88.75% <100.00%> (ø)
src/ejabberd.erl 45.00% <0.00%> (-10.00%) ⬇️
src/domain/service_domain_db.erl 75.00% <0.00%> (-8.34%) ⬇️
... and 17 more

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@NelsonVides NelsonVides force-pushed the c2s/presences branch 3 times, most recently from c6105e8 to 7b8e99c Compare September 7, 2022 15:54
@NelsonVides NelsonVides force-pushed the c2s/presences branch 4 times, most recently from 1edaa0f to 4152aa9 Compare September 20, 2022 12:59
Base automatically changed from c2s/presences to feature/mongoose_c2s September 20, 2022 13:51
@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@NelsonVides NelsonVides marked this pull request as ready for review September 20, 2022 14:41
@NelsonVides NelsonVides force-pushed the c2s/privacy branch 2 times, most recently from 5e00370 to a959bce Compare September 23, 2022 13:36
@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

An important note is that privacy checks were most often returning
tuples of {mongoose_acc, decision}, where the decision is actually the
tag of the tuple, so the order was inverted for better pattern-matching.
@mongoose-im
Copy link
Collaborator

mongoose-im commented Sep 23, 2022

ldap_mnesia_24 / ldap_mnesia / fadd027
Reports root/ big
OK: 865 / Failed: 0 / User-skipped: 427 / Auto-skipped: 0


small_tests_24 / small_tests / fadd027
Reports root / small


ldap_mnesia_25 / ldap_mnesia / fadd027
Reports root/ big
OK: 865 / Failed: 0 / User-skipped: 427 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / fadd027
Reports root/ big
OK: 2606 / Failed: 0 / User-skipped: 52 / Auto-skipped: 0


small_tests_25 / small_tests / fadd027
Reports root / small


internal_mnesia_25 / internal_mnesia / fadd027
Reports root/ big
OK: 927 / Failed: 0 / User-skipped: 365 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / fadd027
Reports root/ big
OK: 2674 / Failed: 0 / User-skipped: 61 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / fadd027
Reports root/ big
OK: 1263 / Failed: 0 / User-skipped: 364 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / fadd027
Reports root/ big
OK: 2606 / Failed: 0 / User-skipped: 52 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / fadd027
Reports root/ big
OK: 2589 / Failed: 0 / User-skipped: 69 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / fadd027
Reports root/ big
OK: 2606 / Failed: 0 / User-skipped: 52 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / fadd027
Reports root/ big
OK: 2667 / Failed: 1 / User-skipped: 66 / Auto-skipped: 1

metrics_session_SUITE:session_global:session_global
{error,
  {{totalSessionCount,
     {value,1},
     [{times,25,
        {error,
          {badmatch,{value,0}},
          [{metrics_helper,assert_counter,3,
             [{file,
              "/home/circleci/project/big_tests/tests/metrics_helper.erl"},
            {line,36}]},
           {mongoose_helper,do_wait_until,2,
             [{file,
              "/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
            {line,374}]},
           {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}]}]}}]},
   [{mongoose_helper,do_wait_until,2,
      [{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
       {line,371}]},
    {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}]}]}}

Report log


pgsql_mnesia_25 / pgsql_mnesia / fadd027
Reports root/ big
OK: 2674 / Failed: 0 / User-skipped: 61 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / fadd027
Reports root/ big
OK: 2671 / Failed: 3 / User-skipped: 61 / Auto-skipped: 0

service_domain_db_SUITE:db:db_could_sync_between_nodes
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},service_domain_db,sync_local,[]],
      [{file,
         "/home/circleci/project/big_tests/tests/distributed_helper.erl"},
       {line,117}]},
    {service_domain_db_SUITE,sync_local,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1205}]},
    {service_domain_db_SUITE,sync,0,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1184}]},
    {service_domain_db_SUITE,db_could_sync_between_nodes,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,568}]},
    {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}]}]}}

Report log

service_domain_db_SUITE:db:db_deleted_from_one_node_while_service_disabled_on_another
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},service_domain_db,sync_local,[]],
      [{file,
         "/home/circleci/project/big_tests/tests/distributed_helper.erl"},
       {line,117}]},
    {service_domain_db_SUITE,sync_local,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1205}]},
    {service_domain_db_SUITE,
      db_deleted_from_one_node_while_service_disabled_on_another,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,579}]},
    {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}]}]}}

Report log

service_domain_db_SUITE:db:db_reinserted_from_one_node_while_service_disabled_on_another
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},service_domain_db,sync_local,[]],
      [{file,
         "/home/circleci/project/big_tests/tests/distributed_helper.erl"},
       {line,117}]},
    {service_domain_db_SUITE,sync_local,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1205}]},
    {service_domain_db_SUITE,sync,0,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1184}]},
    {service_domain_db_SUITE,
      db_reinserted_from_one_node_while_service_disabled_on_another,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,616}]},
    {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}]}]}}

Report log


riak_mnesia_24 / riak_mnesia / fadd027
Reports root/ big
OK: 1108 / Failed: 0 / User-skipped: 351 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / fadd027
Reports root/ big
OK: 2667 / Failed: 1 / User-skipped: 66 / Auto-skipped: 1

metrics_session_SUITE:session_global:session_global
{error,
  {{totalSessionCount,
     {value,1},
     [{times,25,
        {error,
          {badmatch,{value,0}},
          [{metrics_helper,assert_counter,3,
             [{file,
              "/home/circleci/project/big_tests/tests/metrics_helper.erl"},
            {line,36}]},
           {mongoose_helper,do_wait_until,2,
             [{file,
              "/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
            {line,374}]},
           {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}]}]}}]},
   [{mongoose_helper,do_wait_until,2,
      [{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
       {line,371}]},
    {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}]}]}}

Report log


mssql_mnesia_25 / odbc_mssql_mnesia / fadd027
Reports root/ big
OK: 2674 / Failed: 0 / User-skipped: 61 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / fadd027
Reports root/ big
OK: 2666 / Failed: 2 / User-skipped: 66 / Auto-skipped: 1

inbox_SUITE:async_pools:one_to_one:msg_sent_to_offline_user
{error,
  {{assertion_failed,assert,is_iq_result,
     {xmlel,<<"message">>,
       [{<<"from">>,
         <<"alice_msg_sent_to_offline_user_684@localhost/res1">>},
        {<<"to">>,<<"bob_msg_sent_to_offline_user_684@localhost/res1">>},
        {<<"type">>,<<"chat">>}],
       [{xmlel,<<"body">>,[],[{xmlcdata,<<"test">>}]},
        {xmlel,<<"stanza-id">>,
          [{<<"by">>,<<"bob_msg_sent_to_offline_user_684@localhost">>},
           {<<"id">>,<<"BQDQ95EVBK81">>},
           {<<"xmlns">>,<<"urn:xmpp:sid:0">>}],
          []}]},
     "<message from='alice_msg_sent_to_offline_user_684@localhost/res1' to='bob_msg_sent_to_offline_user_684@localhost/res1' type='chat'><body>test</body><stanza-id by='bob_msg_sent_to_offline_user_684@localhost' id='BQDQ95EVBK81' xmlns='urn:xmpp:sid:0'/></message>"},
   [{escalus_new_assert,assert_true,2,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
       {line,84}]},
    {escalus_session,session,1,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_session.erl"},
       {line,131}]},
    {escalus_session,session,2,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_session.erl"},
       {line,273}]},
    {escalus_connection,connection_step,2,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
       {line,160}]},
    {lists,fo...

Report log

metrics_session_SUITE:session_global:session_global
{error,
  {{totalSessionCount,
     {value,1},
     [{times,25,
        {error,
          {badmatch,{value,0}},
          [{metrics_helper,assert_counter,3,
             [{file,
              "/home/circleci/project/big_tests/tests/metrics_helper.erl"},
            {line,36}]},
           {mongoose_helper,do_wait_until,2,
             [{file,
              "/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
            {line,374}]},
           {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}]}]}}]},
   [{mongoose_helper,do_wait_until,2,
      [{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
       {line,371}]},
    {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}]}]}}

Report log

Copy link

@kamilwaz kamilwaz left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@kamilwaz kamilwaz merged commit 1608c49 into feature/mongoose_c2s Oct 3, 2022
@kamilwaz kamilwaz deleted the c2s/privacy branch October 3, 2022 12:15
@jacekwegr jacekwegr added this to the 6.1.0 milestone Apr 27, 2023
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.

4 participants