-
Notifications
You must be signed in to change notification settings - Fork 429
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% 84.14% -1.07%
==========================================
Files 549 554 +5
Lines 33811 33953 +142
==========================================
- Hits 28812 28571 -241
- Misses 4999 5382 +383
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Rename mod_fast to mod_fast_token_auth
Add connect_and_ask_for_token helper
Pass token_type_used, token_data into mod_fast_auth_token:sasl2_success
mssql_mnesia_27 / odbc_mssql_mnesia / e995f70 dynamic_domains_mssql_mnesia_27 / odbc_mssql_mnesia / e995f70 elasticsearch_and_cassandra_27 / elasticsearch_and_cassandra_mnesia / e995f70 small_tests_26 / small_tests / e995f70 small_tests_27 / small_tests / e995f70 small_tests_27_arm64 / small_tests / e995f70 ldap_mnesia_26 / ldap_mnesia / e995f70 dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / e995f70 fast_auth_token_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_526@domain.example.com">>,
escalus_tcp,<0.5980.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_526">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"9edfe1f8bf6fa543">>}]},
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_auth_token_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,
"/home/circleci/project/big_tests/tests/fast_auth_token_SUITE.erl"},
{line,132}]},
{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}]}]}} ldap_mnesia_27 / ldap_mnesia / e995f70 dynamic_domains_mysql_redis_27 / mysql_redis / e995f70 fast_auth_token_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_407@domain.example.com">>,
escalus_tcp,<0.5970.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_407">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"b093dfb399652663">>}]},
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_auth_token_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,
"/home/circleci/project/big_tests/tests/fast_auth_token_SUITE.erl"},
{line,132}]},
{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}]}]}} dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / e995f70 fast_auth_token_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_413@domain.example.com">>,
escalus_tcp,<0.5963.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_413">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"d259304a9d954deb">>}]},
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_auth_token_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,
"/home/circleci/project/big_tests/tests/fast_auth_token_SUITE.erl"},
{line,132}]},
{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 / e995f70 pubsub_SUITE:dag+basic:discover_nodes_test{error,{{badmatch,false},
[{pubsub_tools,check_response,2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,434}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,424}]},
{pubsub_SUITE,'-discover_nodes_test/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_SUITE.erl"},
{line,292}]},
{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}]}]}} pgsql_mnesia_26 / pgsql_mnesia / e995f70 pgsql_cets_27 / pgsql_cets / e995f70 mysql_redis_27 / mysql_redis / e995f70 fast_auth_token_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.6021.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,<<"050f50c7b53b5641">>}]},
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_auth_token_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,
"/home/circleci/project/big_tests/tests/fast_auth_token_SUITE.erl"},
{line,132}]},
{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 / e995f70 fast_auth_token_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_419@localhost">>,
escalus_tcp,<0.6135.0>,undefined,
[{port,5223},
{tls_module,ssl},
{ssl,true},
{ssl_opts,[{verify,verify_none}]},
{username,
<<"alicE_token_auth_fails_when_token_is_not_found_419">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{host,<<"localhost">>},
{stream_id,<<"f7a254b98f7d6f27">>}]},
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_auth_token_SUITE,token_auth_fails_when_token_is_not_found,1,
[{file,
"/home/circleci/project/big_tests/tests/fast_auth_token_SUITE.erl"},
{line,132}]},
{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}]}]}} |
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