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

Xeps/bind2 #4113

Merged
merged 2 commits into from
Sep 5, 2023
Merged

Xeps/bind2 #4113

merged 2 commits into from
Sep 5, 2023

Conversation

NelsonVides
Copy link
Collaborator

@NelsonVides NelsonVides commented Sep 4, 2023

Implements partial support for bind2. Here we can already bind a resource and start a session directly after authentication, saving one more round-trip.

Support for carbons and csi on the same roundtrip coming in the next PR #4114

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Patch coverage: 97.01% and no project coverage change.

Comparison is base (b45636c) 84.01% compared to head (c460ef3) 84.02%.
Report is 2 commits behind head on feature/sasl2.

Additional details and impacted files
@@              Coverage Diff               @@
##           feature/sasl2    #4113   +/-   ##
==============================================
  Coverage          84.01%   84.02%           
==============================================
  Files                553      554    +1     
  Lines              33818    33875   +57     
==============================================
+ Hits               28411    28462   +51     
- Misses              5407     5413    +6     
Files Changed Coverage Δ
src/mod_bind2.erl 95.65% <95.65%> (ø)
src/c2s/mongoose_c2s.erl 87.76% <100.00%> (+0.13%) ⬆️
src/hooks/mongoose_hooks.erl 95.11% <100.00%> (+0.07%) ⬆️
src/stream_management/mod_stream_management.erl 91.11% <100.00%> (+0.05%) ⬆️

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@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 5, 2023 12:29
Copy link
Contributor

@arcusfelis arcusfelis 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

big_tests/tests/bind2_SUITE.erl Outdated Show resolved Hide resolved
big_tests/tests/bind2_SUITE.erl Outdated Show resolved Hide resolved
@mongoose-im
Copy link
Collaborator

mongoose-im commented Sep 5, 2023

elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / c460ef3
Reports root/ big
OK: 369 / Failed: 0 / User-skipped: 38 / Auto-skipped: 0


small_tests_24 / small_tests / c460ef3
Reports root / small


small_tests_25 / small_tests / c460ef3
Reports root / small


small_tests_25_arm64 / small_tests / c460ef3
Reports root / small


ldap_mnesia_24 / ldap_mnesia / c460ef3
Reports root/ big
OK: 2295 / Failed: 0 / User-skipped: 835 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / c460ef3
Reports root/ big
OK: 4226 / Failed: 0 / User-skipped: 116 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / c460ef3
Reports root/ big
OK: 4258 / Failed: 0 / User-skipped: 84 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / c460ef3
Reports root/ big
OK: 2295 / Failed: 0 / User-skipped: 835 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / c460ef3
Reports root/ big
OK: 4258 / Failed: 0 / User-skipped: 84 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / c460ef3
Reports root/ big
OK: 2445 / Failed: 0 / User-skipped: 685 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / c460ef3
Reports root/ big
OK: 4255 / Failed: 0 / User-skipped: 87 / Auto-skipped: 0


pgsql_cets_25 / pgsql_cets / c460ef3
Reports root/ big
OK: 4617 / Failed: 0 / User-skipped: 121 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / c460ef3
Reports root/ big
OK: 4627 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / c460ef3
Reports root/ big
OK: 4643 / Failed: 1 / User-skipped: 94 / Auto-skipped: 0

muc_SUITE:register:user_changes_nick
{error,
  {{assertion_failed,assert,is_iq_result,
     [{xmlel,<<"iq">>,
        [{<<"type">>,<<"set">>},
         {<<"id">>,<<"1b0c2b9d7cf356d3ed809195d9b54f0d">>},
         {<<"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-6483adf6d0">>}]}]}]}]}]}],
     {xmlel,<<"iq">>,
       [{<<"from">>,<<"muc.localhost">>},
        {<<"to">>,<<"alice_user_changes_nick_2677@localhost/res1">>},
        {<<"type">>,<<"error">>},
        {<<"id">>,<<"1b0c2b9d7cf356d3ed809195d9b54f0d">>}],
       [{xmlel,<<"query">>,
          [{<<"xmlns">>,<<"jabber:iq:register">>}],
          [{xmlel,<<"x">>,
             [{<<"xmlns">>,<<"jabber:x:data">>},
            {<<"type">>,<<"submit">>}],
             [{xmlel,<<"field">>,
              [{<<"type">>,<<"hidden">>},
               {<<"var">>,<<"FORM_TYPE">>}],
              [{xmlel,<<"value">>,[],
                 [{xmlcdata,<<"...

Report log


pgsql_mnesia_25 / pgsql_mnesia / c460ef3
Reports root/ big
OK: 4647 / Failed: 0 / User-skipped: 91 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / c460ef3
Reports root/ big
OK: 4647 / Failed: 0 / User-skipped: 91 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / c460ef3
Reports root/ big
OK: 4638 / Failed: 1 / User-skipped: 94 / Auto-skipped: 5

bosh_SUITE:essential:accept_higher_hold_value
{error,
  {{assertEqual,
     [{module,bosh_SUITE},
      {line,260},
      {expression,"get_bosh_sessions ( )"},
      {expected,[]},
      {value,
        [{bosh_session,<<"68d268fa194779b175fb3d3fe51dbc63bdcfd848">>,
           <9327.10216.0>}]}]},
   [{bosh_SUITE,accept_higher_hold_value,1,
      [{file,"/home/circleci/project/big_tests/tests/bosh_SUITE.erl"},
       {line,260}]},
    {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 / c460ef3
Reports root/ big
OK: 4644 / Failed: 0 / User-skipped: 94 / Auto-skipped: 0

%% The XEP does not specify what to do if the resource wasn't bound
%% so we just set failed here and move along with SASL2
Error = #xmlel{name = <<"failed">>, attrs = [?XMLNS_BIND2], children = MaybeSmChild},
{ok, mod_sasl2:update_inline_request(SaslAcc1, ?MODULE, Error, failure)}
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to have a test here (not covered)

Copy link
Contributor

@arcusfelis arcusfelis left a comment

Choose a reason for hiding this comment

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

ok

@arcusfelis arcusfelis merged commit f59f828 into feature/sasl2 Sep 5, 2023
4 checks passed
@arcusfelis arcusfelis deleted the xeps/bind2 branch September 5, 2023 21:43
@Neustradamus
Copy link
Contributor

@NelsonVides: Good job!

@chrzaszcz chrzaszcz added this to the 6.2.0 milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants