-
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
C2s/fix listener access hook #3952
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportBase: 83.52% // Head: 83.52% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## feature/mongoose_c2s #3952 +/- ##
=====================================================
Coverage 83.52% 83.52%
=====================================================
Files 538 538
Lines 33944 33949 +5
=====================================================
+ Hits 28351 28356 +5
Misses 5593 5593
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 was untested, and actually not working with mongoose_c2s. Also: - Do setup/teardown in init/end_per_testcase instead of doing it in the test case. - Do not setup/teardown inside parallel tests.
3df075c
to
5b1a3ae
Compare
Previously the handlers were installed with the access rules themselves, what caused: - Possible duplication of handlers in case of same rules. - Running all handlers sequentially, effectively performing an intersection of all rules instead of applying rules for a given listener. Now the handlers are installed with the listener ID's, and for each new session these ID's are compared with the c2s data, resulting in only the right handler being executed. The access rules can be just extracted from the c2s data itself.
5b1a3ae
to
a1e8803
Compare
small_tests_24 / small_tests / 3df075c small_tests_25 / small_tests / 3df075c dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 3df075c ldap_mnesia_24 / ldap_mnesia / 3df075c ldap_mnesia_25 / ldap_mnesia / 3df075c dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 3df075c inbox_extensions_SUITE:regular:one_to_one:pagination:can_paginate_forwards{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.13055.1>,
[{event_manager,<0.13023.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_can_paginate_forwards_1514">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13023.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_can_paginate_forwards_1514">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"bob_can_paginate_forwards_1514">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"bOb_can_paginate_forwards_1514">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrolika">>},
{stream_id,<<"1cdebfa0070397c8">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
{inbox_extensions_SUITE,'-ca... inbox_extensions_SUITE:regular:one_to_one:pagination:can_paginate_backwards{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.13058.1>,
[{event_manager,<0.13044.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_can_paginate_backwards_1517">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13044.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_can_paginate_backwards_1517">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"bob_can_paginate_backwards_1517">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"bOb_can_paginate_backwards_1517">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrolika">>},
{stream_id,<<"8f76dba8b7428427">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
{inbox_extensions_SUITE... inbox_extensions_SUITE:regular:one_to_one:pagination:max_queries_can_be_limited{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.13060.1>,
[{event_manager,<0.13037.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_max_queries_can_be_limited_1516">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13037.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_max_queries_can_be_limited_1516">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"bob_max_queries_can_be_limited_1516">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"bOb_max_queries_can_be_limited_1516">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrolika">>},
{stream_id,<<"649ec135053abaa3">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
{in... inbox_extensions_SUITE:regular:one_to_one:pagination:pagination_overrides_form{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.13062.1>,
[{event_manager,<0.13009.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_pagination_overrides_form_1512">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13009.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_pagination_overrides_form_1512">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"kate_pagination_overrides_form_1512">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"kate_pagination_overrides_form_1512">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrowe;p">>},
{stream_id,<<"5d39bedd9242b66c">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
{... inbox_extensions_SUITE:regular:one_to_one:pagination:max_queries_can_fetch_ahead{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.13061.1>,
[{event_manager,<0.13030.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_max_queries_can_fetch_ahead_1515">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13030.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_max_queries_can_fetch_ahead_1515">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"kate_max_queries_can_fetch_ahead_1515">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"kate_max_queries_can_fetch_ahead_1515">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrowe;p">>},
{stream_id,<<"8a91546dc9b07083">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl_1,3,[{file,"lists.erl"},{line,1355}... dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 3df075c internal_mnesia_25 / internal_mnesia / 3df075c elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 3df075c dynamic_domains_mysql_redis_25 / mysql_redis / 3df075c pgsql_mnesia_24 / pgsql_mnesia / 3df075c mysql_redis_25 / mysql_redis / 3df075c riak_mnesia_24 / riak_mnesia / 3df075c mssql_mnesia_25 / odbc_mssql_mnesia / 3df075c pgsql_mnesia_25 / pgsql_mnesia / 3df075c |
small_tests_24 / small_tests / 5b1a3ae small_tests_25 / small_tests / 5b1a3ae ldap_mnesia_24 / ldap_mnesia / 5b1a3ae dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 5b1a3ae ldap_mnesia_25 / ldap_mnesia / 5b1a3ae dynamic_domains_mysql_redis_25 / mysql_redis / 5b1a3ae dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 5b1a3ae inbox_extensions_SUITE:regular:one_to_one:pagination:max_queries_can_fetch_ahead{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.13129.1>,
[{event_manager,<0.13110.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_max_queries_can_fetch_ahead_1523">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13110.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_max_queries_can_fetch_ahead_1523">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"bob_max_queries_can_fetch_ahead_1523">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"bOb_max_queries_can_fetch_ahead_1523">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrolika">>},
{stream_id,<<"4fd3f51ff21a112a">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
... inbox_extensions_SUITE:regular:one_to_one:pagination:pagination_overrides_form{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.13127.1>,
[{event_manager,<0.13103.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_pagination_overrides_form_1522">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13103.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_pagination_overrides_form_1522">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"bob_pagination_overrides_form_1522">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"bOb_pagination_overrides_form_1522">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrolika">>},
{stream_id,<<"3dca46440d1047fd">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
{inbox_e... inbox_extensions_SUITE:regular:one_to_one:pagination:max_queries_can_be_limited{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.13125.1>,
[{event_manager,<0.13082.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_max_queries_can_be_limited_1519">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13082.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_max_queries_can_be_limited_1519">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"kate_max_queries_can_be_limited_1519">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"kate_max_queries_can_be_limited_1519">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrowe;p">>},
{stream_id,<<"965aaad485c568c5">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
... inbox_extensions_SUITE:regular:one_to_one:pagination:can_paginate_forwards{error,{{badmatch,0},
[{escalus_story,drop_presences,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,191}]},
{escalus_story,'-start_ready_clients/2-fun-0-',3,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,135}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
{escalus_story,start_ready_clients,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,128}]},
{lists,flatmap_1,2,[{file,"lists.erl"},{line,1335}]},
{lists,flatmap_1,2,[{file,"lists.erl"},{line,1335}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,69}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]}]}} dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 5b1a3ae internal_mnesia_25 / internal_mnesia / 5b1a3ae elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 5b1a3ae pgsql_mnesia_24 / pgsql_mnesia / 5b1a3ae mysql_redis_25 / mysql_redis / 5b1a3ae pgsql_mnesia_25 / pgsql_mnesia / 5b1a3ae riak_mnesia_24 / riak_mnesia / 5b1a3ae mssql_mnesia_25 / odbc_mssql_mnesia / 5b1a3ae muc_SUITE:register:user_unregisters_nick{error,
{{assertion_failed,assert,is_iq_result,
[{xmlel,<<"iq">>,
[{<<"type">>,<<"set">>},
{<<"id">>,<<"7ce32ccbbaef6f18ec2c3720e4d74dc2">>},
{<<"to">>,<<"muc.localhost">>}],
[{xmlel,<<"query">>,
[{<<"xmlns">>,<<"jabber:iq:register">>}],
[{xmlel,<<"x">>,
[{<<"xmlns">>,<<"jabber:x:data">>},
{<<"type">>,<<"submit">>}],
[{xmlel,<<"field">>,
[{<<"type">>,<<"hidden">>},
{<<"var">>,<<"FORM_TYPE">>}],
[{xmlel,<<"value">>,[],
[{xmlcdata,<<"jabber:iq:register">>}]}]},
{xmlel,<<"field">>,
[{<<"type">>,<<"text-single">>},
{<<"var">>,<<"nick">>}],
[{xmlel,<<"value">>,[],
[{xmlcdata,
<<"thirdwitch1room-1ed0b026a9">>}]}]}]}]}]}],
{xmlel,<<"iq">>,
[{<<"from">>,<<"muc.localhost">>},
{<<"to">>,<<"alice_user_unregisters_nick_2529@localhost/res1">>},
{<<"type">>,<<"error">>},
{<<"id">>,<<"7ce32ccbbaef6f18ec2c3720e4d74dc2">>}],
[{xmlel,<<"query">>,
[{<<"xmlns">>,<<"jabber:iq:register">>}],
[{xmlel,<<"x">>,
[{<<"xmlns">>,<<"jabber:x:data">>},
{<<"type">>,<<"submit">>}],
[{xmlel,<<"field">>,
[{<<"type">>,<<"hidden">>},
{<<"var">>,<<"FORM_TYPE">>}],
[{xmlel,<<"value">>,[],
[{xmlcdata... |
small_tests_24 / small_tests / a1e8803 small_tests_25 / small_tests / a1e8803 ldap_mnesia_24 / ldap_mnesia / a1e8803 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / a1e8803 ldap_mnesia_25 / ldap_mnesia / a1e8803 pgsql_mnesia_24 / pgsql_mnesia / a1e8803 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / a1e8803 dynamic_domains_mysql_redis_25 / mysql_redis / a1e8803 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / a1e8803 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / a1e8803 internal_mnesia_25 / internal_mnesia / a1e8803 pgsql_mnesia_25 / pgsql_mnesia / a1e8803 riak_mnesia_24 / riak_mnesia / a1e8803 mysql_redis_25 / mysql_redis / a1e8803 mssql_mnesia_25 / odbc_mssql_mnesia / a1e8803 |
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
Fix a bug in listener access rules - all hooks being executed instead of one.
Test were added to replicate the issue and make sure it is no longer present after the fix.
The main part of the fix is to match on the listener ID.
More details in the commit messages.