-
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
XEP-0484 Fast Token Auth [WIP] #4379
base: master
Are you sure you want to change the base?
Conversation
Do not announce mod_fast mechanisms
TODO DB backend, more logic cases
It is always exported
Add logic for TTL config
mssql_mnesia_27 / odbc_mssql_mnesia / 15e855a dynamic_domains_mssql_mnesia_27 / odbc_mssql_mnesia / 15e855a elasticsearch_and_cassandra_27 / elasticsearch_and_cassandra_mnesia / 15e855a small_tests_27 / small_tests / 15e855a small_tests_26 / small_tests / 15e855a small_tests_27_arm64 / small_tests / 15e855a ldap_mnesia_27 / ldap_mnesia / 15e855a dynamic_domains_mysql_redis_27 / mysql_redis / 15e855a fast_SUITE:basic:token_auth_fails_when_token_is_not_found{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alicE_token_auth_fails_when_token_is_not_found_402@domain.example.com">>,
escalus_tcp,<0.5914.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_402">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"23d7475f56c1d0a6">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{sasl2_helper,receive_features,3,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,229}]},
{sasl2_helper,apply_steps,4,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,47}]},
{fast_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,"/home/circleci/project/big_tests/tests/fast_SUITE.erl"},
{line,122}]},
{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}]}]}} internal_mnesia_27 / internal_mnesia / 15e855a ldap_mnesia_26 / ldap_mnesia / 15e855a dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 15e855a fast_SUITE:basic:token_auth_fails_when_token_is_not_found{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alicE_token_auth_fails_when_token_is_not_found_409@domain.example.com">>,
escalus_tcp,<0.5931.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_409">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"45902ed28c219274">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{sasl2_helper,receive_features,3,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,229}]},
{sasl2_helper,apply_steps,4,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,47}]},
{fast_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,"/home/circleci/project/big_tests/tests/fast_SUITE.erl"},
{line,122}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1302}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1234}]}]}} dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / 15e855a pgsql_cets_27 / pgsql_cets / 15e855a fast_SUITE:basic:token_auth_fails_when_token_is_not_found{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alicE_token_auth_fails_when_token_is_not_found_402@localhost">>,
escalus_tcp,<0.6202.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_402">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{host,<<"localhost">>},
{stream_id,<<"efd90e726e72e24c">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{sasl2_helper,receive_features,3,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,229}]},
{sasl2_helper,apply_steps,4,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,47}]},
{fast_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,"/home/circleci/project/big_tests/tests/fast_SUITE.erl"},
{line,122}]},
{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}]}]}} pgsql_mnesia_27 / pgsql_mnesia / 15e855a fast_SUITE:basic:token_auth_fails_when_token_is_not_found{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alicE_token_auth_fails_when_token_is_not_found_421@localhost">>,
escalus_tcp,<0.6065.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_421">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{host,<<"localhost">>},
{stream_id,<<"9ed74180901fcff7">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{sasl2_helper,receive_features,3,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,229}]},
{sasl2_helper,apply_steps,4,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,47}]},
{fast_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,"/home/circleci/project/big_tests/tests/fast_SUITE.erl"},
{line,122}]},
{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}]}]}} pgsql_mnesia_26 / pgsql_mnesia / 15e855a fast_SUITE:basic:token_auth_fails_when_token_is_not_found{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alicE_token_auth_fails_when_token_is_not_found_405@localhost">>,
escalus_tcp,<0.6013.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_405">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{host,<<"localhost">>},
{stream_id,<<"121cf141537fd603">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{sasl2_helper,receive_features,3,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,229}]},
{sasl2_helper,apply_steps,4,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,47}]},
{fast_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,"/home/circleci/project/big_tests/tests/fast_SUITE.erl"},
{line,122}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1302}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1234}]}]}} mysql_redis_27 / mysql_redis / 15e855a fast_SUITE:basic:token_auth_fails_when_token_is_not_found{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alicE_token_auth_fails_when_token_is_not_found_403@localhost">>,
escalus_tcp,<0.6005.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_403">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{host,<<"localhost">>},
{stream_id,<<"ab8b78b47b437ca0">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{sasl2_helper,receive_features,3,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,229}]},
{sasl2_helper,apply_steps,4,
[{file,"/home/circleci/project/big_tests/tests/sasl2_helper.erl"},
{line,47}]},
{fast_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,"/home/circleci/project/big_tests/tests/fast_SUITE.erl"},
{line,122}]},
{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}]}]}} carboncopy_SUITE:one2one:dropped_client_doesnt_create_duplicate_carbons{error,
{{badmatch,
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_dropped_client_doesnt_create_duplicate_carbons_598@localhost">>},
{<<"to">>,
<<"alice_dropped_client_doesnt_create_duplicate_carbons_598@localhost/res2">>},
{<<"xmlns">>,<<"jabber:client">>},
{<<"type">>,<<"chat">>}],
[{xmlel,<<"sent">>,
[{<<"xmlns">>,<<"urn:xmpp:carbons:2">>}],
[{xmlel,<<"forwarded">>,
[{<<"xmlns">>,<<"urn:xmpp:forward:0">>}],
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_dropped_client_doesnt_create_duplicate_carbons_598@localhost/res1">>},
{<<"type">>,<<"chat">>},
{<<"to">>,
<<"bob_dropped_client_doesnt_create_duplicate_carbons_598@localhost/res1">>},
{<<"xmlns">>,<<"jabber:client">>}],
[{xmlel,<<"body">>,[],
[{xmlcdata,
<<"And pious action">>}]}]}]}]}]}]},
[{carboncopy_SUITE,
'-dropped_client_doesnt_create_duplicate_carbons/1-fun-0-',4,
[{file,
"/home/circleci/project/big_tests/tests/carboncopy_SUITE.erl"},
{line,189}]},
{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_serv... |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4379 +/- ##
==========================================
- Coverage 85.21% 82.42% -2.80%
==========================================
Files 549 554 +5
Lines 33811 33949 +138
==========================================
- Hits 28812 27981 -831
- Misses 4999 5968 +969
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This PR addresses MIM-2047.
Proposed changes include:
TODO:
expiration logic and tests
rotate logic (set current token on auth)
counters logic.
Server initiates token rotation
Client requests token invalidation
More HT sasl mechanisms
Channel binding?
TLS 0-RTT? https://www.erlang.org/doc/apps/ssl/using_ssl.html#:~:text=The%20TLS%201.3%20protocol%20does%20not%20provide%20inherent%20protection%20for