-
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
Treat privacy IQs send to users as regular stanzas #4361
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4361 +/- ##
==========================================
- Coverage 84.96% 84.94% -0.02%
==========================================
Files 552 552
Lines 33697 33703 +6
==========================================
Hits 28630 28630
- Misses 5067 5073 +6 ☔ View full report in Codecov by Sentry. |
3610a38
to
09ba2fc
Compare
elasticsearch_and_cassandra_27 / elasticsearch_and_cassandra_mnesia / 09ba2fc small_tests_27 / small_tests / 09ba2fc small_tests_26 / small_tests / 09ba2fc small_tests_27_arm64 / small_tests / 09ba2fc ldap_mnesia_26 / ldap_mnesia / 09ba2fc ldap_mnesia_27 / ldap_mnesia / 09ba2fc dynamic_domains_mysql_redis_27 / mysql_redis / 09ba2fc dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 09ba2fc internal_mnesia_27 / internal_mnesia / 09ba2fc dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / 09ba2fc pgsql_cets_27 / pgsql_cets / 09ba2fc dynamic_domains_mssql_mnesia_27 / odbc_mssql_mnesia / 09ba2fc mysql_redis_27 / mysql_redis / 09ba2fc pgsql_mnesia_26 / pgsql_mnesia / 09ba2fc pgsql_mnesia_27 / pgsql_mnesia / 09ba2fc mssql_mnesia_27 / odbc_mssql_mnesia / 09ba2fc service_domain_db_SUITE:db:rest_without_auth:rest_without_auth_parallel:rest_delete_domain_cleans_data_from_mam{error,
{{badrpc,timeout},
[{distributed_helper,rpc,
[#{node => mongooseim@localhost},service_domain_db,sync_local,[]],
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,140}]},
{service_domain_db_SUITE,sync_local,1,
[{file,
"/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
{line,1212}]},
{service_domain_db_SUITE,sync,0,
[{file,
"/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
{line,1191}]},
{service_domain_db_SUITE,
'-rest_delete_domain_cleans_data_from_mam/1-fun-0-',5,
[{file,
"/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
{line,963}]},
{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,1794}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1303}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1235}]}]}} mssql_mnesia_27 / odbc_mssql_mnesia / 09ba2fc |
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.
Thanks for the changes, they do fix the problem of MIM "impersonating" somebody.
As a note, I think that the issue and test is a bit weird, as it happens when a user sends a blocking/privacy IQ to another user, which is not really something they should do according to the XEPs. It's unclear what would the other client do, probably drop the stanza, or return an error.
However, according to https://www.rfc-editor.org/rfc/rfc6120.html#section-10.5.4, the tested behaviour of MIM passing the stanza to the recipient is indeed correct, when the stanza is sent to a full JID - it is in the test. Maybe a note in the testcase pointing out that this is an edge case, that shouldn't really happen could be useful? Especially since, if I'm not mistaken, if Alice didn't sent to Bob's full JID, MIM should handle the IQ directly, so there is some nuance there (see the third dot of https://www.rfc-editor.org/rfc/rfc6120.html#section-10.5.3.2). But I'm fine with merging this as it is now as well, let me know if you'd like to add a note to the testcases or not.
Thanks for the feedback! I agree this is an unusual case, and adding a note to the test about it being an edge case makes sense. I'll add that note to make it clear why this scenario is being tested. |
elasticsearch_and_cassandra_27 / elasticsearch_and_cassandra_mnesia / 5d2244a small_tests_27 / small_tests / 5d2244a small_tests_26 / small_tests / 5d2244a small_tests_27_arm64 / small_tests / 5d2244a ldap_mnesia_26 / ldap_mnesia / 5d2244a ldap_mnesia_27 / ldap_mnesia / 5d2244a dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 5d2244a dynamic_domains_mysql_redis_27 / mysql_redis / 5d2244a dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / 5d2244a pgsql_cets_27 / pgsql_cets / 5d2244a dynamic_domains_mssql_mnesia_27 / odbc_mssql_mnesia / 5d2244a internal_mnesia_27 / internal_mnesia / 5d2244a service_mongoose_system_metrics_SUITE:all_clustered_mongooses_report_the_same_client_id{skip,
{failed,
{service_mongoose_system_metrics_SUITE,init_per_testcase,
{{badrpc,timeout},
[{distributed_helper,rpc,
[#{timeout => 30000,node => mongooseim2@localhost},
mongoose_cluster,join,
[mongooseim@localhost]],
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,140}]},
{distributed_helper,add_node_to_mnesia_cluster,2,
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,44}]},
{distributed_helper,add_node_to_cluster,2,
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,36}]},
{service_mongoose_system_metrics_SUITE,init_per_testcase,2,
[{file,
"/home/circleci/project/big_tests/tests/service_mongoose_system_metrics_SUITE.erl"},
{line,113}]},
{test_server,do_init_per_testcase,2,
[{file,"test_server.erl"},{line,1564}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1265}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1235}]}]}}}} service_domain_db_SUITE:no_db:init_per_group{'EXIT',
{{badrpc,
{'EXIT',
{noproc,
{gen_server,call,
[mongoose_domain_sup,
{terminate_child,mongoose_domain_core},
infinity]}}}},
[{distributed_helper,rpc,
[#{node => mongooseim2@localhost},
mongoose_domain_sup,restart_core,
[[[],
[<<"mim2only">>,<<"type1">>,<<"type2">>,<<"dummy auth">>,
<<"dbgroup">>,<<"dbgroup2">>,<<"cfggroup">>]]]],
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,140}]},
{domain_helper,restart_domain_core,3,
[{file,"/home/circleci/project/big_tests/tests/domain_helper.erl"},
{line,33}]},
{service_domain_db_SUITE,setup_service,2,
[{file,
"/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
{line,317}]},
{service_domain_db_SUITE,init_per_group,2,
[{file,
"/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
{line,240}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1794}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1391}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1235}]}]}} service_domain_db_SUITE:end_per_suite{error,
{{badrpc,
{'EXIT',
{noproc,
{gen_server,call,
[mongoose_domain_sup,
{terminate_child,mongoose_domain_core},
infinity]}}}},
[{distributed_helper,rpc,
[#{node => mongooseim2@localhost},
mongoose_domain_sup,restart_core,
[[]]],
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,140}]},
{domain_helper,restart_domain_core,1,
[{file,"/home/circleci/project/big_tests/tests/domain_helper.erl"},
{line,30}]},
{service_domain_db_SUITE,'-end_per_suite/1-lc$^0/1-0-',1,
[{file,
"/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
{line,212}]},
{service_domain_db_SUITE,end_per_suite,1,
[{file,
"/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
{line,212}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1794}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1391}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1235}]}]}} dynamic_domains_SUITE:init_per_suite{'EXIT',
{{badrpc,timeout},
[{distributed_helper,rpc,
[#{timeout => 30000,node => mongooseim2@localhost},
mongoose_cluster,join,
[mongooseim@localhost]],
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,140}]},
{distributed_helper,add_node_to_mnesia_cluster,2,
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,44}]},
{distributed_helper,add_node_to_cluster,2,
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,36}]},
{dynamic_domains_SUITE,cluster_nodes,2,
[{file,
"/home/circleci/project/big_tests/tests/dynamic_domains_SUITE.erl"},
{line,210}]},
{dynamic_domains_SUITE,init_per_suite,1,
[{file,
"/home/circleci/project/big_tests/tests/dynamic_domains_SUITE.erl"},
{line,32}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1794}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1391}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1235}]}]}} local_iq_SUITE:init_per_suite{'EXIT',{{badrpc,timeout},
[{distributed_helper,rpc,
[#{timeout => 30000,
node => mongooseim2@localhost},
mongoose_cluster,join,
[mongooseim@localhost]],
[{file,"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,140}]},
{distributed_helper,add_node_to_mnesia_cluster,2,
[{file,"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,44}]},
{distributed_helper,add_node_to_cluster,2,
[{file,"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,36}]},
{local_iq_SUITE,init_per_suite,1,
[{file,"/home/circleci/project/big_tests/tests/local_iq_SUITE.erl"},
{line,29}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1794}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1391}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1235}]}]}} pgsql_mnesia_27 / pgsql_mnesia / 5d2244a mysql_redis_27 / mysql_redis / 5d2244a pgsql_mnesia_26 / pgsql_mnesia / 5d2244a mssql_mnesia_27 / odbc_mssql_mnesia / 5d2244a internal_mnesia_27 / internal_mnesia / 5d2244a |
This PR changes how privacy and blocking IQs sent to other users are handled. They are now treated like regular stanzas. The logic in
mod_privacy
andmod_blocking
has been modified to support this change.