-
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
Register command with automatic jid creation #2262
Conversation
6310.1 / Erlang 19.3 / small_tests / 5cf6b09 6310.5 / Erlang 19.3 / ldap_mnesia / 5cf6b09 sasl_external_SUITE:standard:cert_more_xmpp_addrs_identity_correct{'EXIT',tcp_close_timeout} 6310.6 / Erlang 19.3 / elasticsearch_and_cassandra_mnesia / 5cf6b09 6310.2 / Erlang 19.3 / internal_mnesia / 5cf6b09 6310.3 / Erlang 19.3 / mysql_redis / 5cf6b09 sasl_external_SUITE:use_common_name:cert_with_cn_no_xmpp_addrs_no_identity{'EXIT',tcp_close_timeout} sasl_external_SUITE:use_common_name:cert_with_cn_no_xmpp_addrs_identity_correct{'EXIT',tcp_close_timeout} 6310.4 / Erlang 19.3 / odbc_mssql_mnesia / 5cf6b09 6310.8 / Erlang 20.0 / pgsql_mnesia / 5cf6b09 mod_global_distrib_SUITE:mod_global_distrib:test_pm_with_ungraceful_reconnection_to_different_server{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"eve12.911764@localhost/res1">>,escalus_tcp,
<0.23643.3>,
[{event_manager,<0.23634.3>},
{server,<<"localhost">>},
{username,<<"eve12.911764">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.23634.3>},
{server,<<"localhost">>},
{username,<<"eve12.911764">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"eve12.911764">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"eve12.911764">>},
{server,<<"localhost">>},
{password,<<"password">>},
{port,5222},
{stream_management,true},
{stream_id,<<"1272A667ACAF39A0">>}]},
10000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{mod_global_distrib_SUITE,
'-test_pm_with_ungraceful_reconnection_to_different_server/1-fun-0-',
4,
[{file,"mod_global_distrib_SUITE.erl"},{line,610}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
... mod_global_distrib_SUITE:mod_global_distrib:test_pm_with_ungraceful_reconnection_to_different_server{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"eve44.169169@localhost/res1">>,escalus_tcp,
<0.24234.3>,
[{event_manager,<0.24225.3>},
{server,<<"localhost">>},
{username,<<"eve44.169169">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.24225.3>},
{server,<<"localhost">>},
{username,<<"eve44.169169">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"eve44.169169">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"eve44.169169">>},
{server,<<"localhost">>},
{password,<<"password">>},
{port,5222},
{stream_management,true},
{stream_id,<<"AED4F08C93659153">>}]},
10000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{mod_global_distrib_SUITE,
'-test_pm_with_ungraceful_reconnection_to_different_server/1-fun-0-',
4,
[{file,"mod_global_distrib_SUITE.erl"},{line,610}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
... 6310.9 / Erlang 21.0 / riak_mnesia / 5cf6b09 6310.3 / Erlang 19.3 / mysql_redis / 5cf6b09 6310.5 / Erlang 19.3 / ldap_mnesia / 5cf6b09 sm_SUITE:parallel:subscription_requests_are_buffered_properly{error,{{badmatch,false},
[{escalus_session,stream_management,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_session.erl"},
{line,227}]},
{escalus_connection,connection_step,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
{line,134}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
{escalus_connection,start,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
{line,118}]},
{sm_SUITE,'-subscription_requests_are_buffered_properly/1-fun-3-',6,
[{file,"sm_SUITE.erl"},{line,848}]},
{escalus_story,story,4,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1529}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1045}]}]}} 6310.8 / Erlang 20.0 / pgsql_mnesia / 5cf6b09 sm_SUITE:parallel_manual_ack_freq_1:resume_session_state_stop_c2s{error,{{assertion_failed,assert_many,true,
[is_presence,#Fun<sm_SUITE.16.57904926>],
[{xmlel,<<"presence">>,
[{<<"from">>,
<<"alicE15.697561@localhost/escalus-default-resource">>},
{<<"to">>,
<<"alice15.697561@localhost/escalus-default-resource">>},
{<<"xml:lang">>,<<"en">>}],
[]},
{xmlel,<<"presence">>,
[{<<"from">>,
<<"alicE15.697561@localhost/escalus-default-resource">>},
{<<"to">>,
<<"alice15.697561@localhost/escalus-default-resource">>},
{<<"xml:lang">>,<<"en">>}],
[]}],
" <presence from='alicE15.697561@localhost/escalus-default-resource' to='alice15.697561@localhost/escalus-default-resource' xml:lang='en'/> <presence from='alicE15.697561@localhost/escalus-default-resource' to='alice15.697561@localhost/escalus-default-resource' xml:lang='en'/>"},
[{escalus_new_assert,assert_true,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{sm_SUITE,resume_session_state_stop_c2s,1,
[{file,"sm_SUITE.erl"},{line,581}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1529}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1045}]},
{... sm_SUITE:parallel_manual_ack_freq_1:resume_session_state_stop_c2s{error,{{assertion_failed,assert_many,true,
[is_presence,#Fun<sm_SUITE.16.57904926>],
[{xmlel,<<"presence">>,
[{<<"from">>,
<<"alicE26.12302@localhost/escalus-default-resource">>},
{<<"to">>,
<<"alice26.12302@localhost/escalus-default-resource">>},
{<<"xml:lang">>,<<"en">>}],
[]},
{xmlel,<<"presence">>,
[{<<"from">>,
<<"alicE26.12302@localhost/escalus-default-resource">>},
{<<"to">>,
<<"alice26.12302@localhost/escalus-default-resource">>},
{<<"xml:lang">>,<<"en">>}],
[]}],
" <presence from='alicE26.12302@localhost/escalus-default-resource' to='alice26.12302@localhost/escalus-default-resource' xml:lang='en'/> <presence from='alicE26.12302@localhost/escalus-default-resource' to='alice26.12302@localhost/escalus-default-resource' xml:lang='en'/>"},
[{escalus_new_assert,assert_true,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{sm_SUITE,resume_session_state_stop_c2s,1,
[{file,"sm_SUITE.erl"},{line,581}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1529}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1045}]},
{test_ser... 6310.9 / Erlang 21.0 / riak_mnesia / 5cf6b09 6310.8 / Erlang 20.0 / pgsql_mnesia / 5cf6b09 |
Codecov Report
@@ Coverage Diff @@
## master #2262 +/- ##
===========================================
- Coverage 78.86% 21.09% -57.78%
===========================================
Files 333 332 -1
Lines 28796 28767 -29
===========================================
- Hits 22709 6067 -16642
- Misses 6087 22700 +16613
Continue to review full report at Codecov.
|
@@ -333,6 +346,11 @@ register(User, Host, Password) -> | |||
{ok, io_lib:format("User ~s@~s successfully registered", [User, Host])} | |||
end. | |||
|
|||
generate_user() -> | |||
mongoose_bin:join([mongoose_bin:gen_from_timestamp(), |
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.
How about adding <<"private_jid_">>
at the beginning or/and at the end for easier search??
@mattsaidwhat what do you think?
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.
I would not do that preemptively.
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.
PR looks good 👍
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.
Docs must be updated as well:
$ grep -nr mongooseimctl . | grep register
./authentication-backends/PKI-authentication-module.md:14:| `dirty_get_registered_users`, `get_vh_registered_users`, `get_vh_registered_users_number` | `[]` | Any metrics or statistics (e.g. available via `mongooseimctl`) related to accounts list or numbers, won't display proper values, as this backend cannot possibly "know" how many users there are. |
./user-guide/Getting-started.md:69:You can register a user with the `mongooseimctl` utility.
./user-guide/Getting-started.md:73:mongooseimctl register user domain password
./user-guide/Jingle-SIP-setup.md:115: bin/mongooseimctl register xmpp.user xmpp.example test_pass
./user-guide/Jingle-SIP-setup.md:116: bin/mongooseimctl register sip.user sip.example test_pass
./user-guide/ICE_tutorial.md:81:$REPO/_build/prod/rel/mongooseim/bin/mongooseimctl register phone myxmpp.com xmpp_password
./user-guide/ICE_tutorial.md:82:$REPO/_build/prod/rel/mongooseim/bin/mongooseimctl register movie myxmpp.com xmpp_password
@@ -907,10 +911,17 @@ simple_register(Config) -> | |||
Domain = ct:get_config({hosts, mim, domain}), | |||
{Name, Password} = {<<"tyler">>, <<"durden">>}, | |||
%% when | |||
{_, 0} = ejabberdctl("register", [Name, Domain, Password], Config), | |||
{R1, 0} = ejabberdctl("registered_users", [Domain], Config), | |||
{match, ResList1} = re:run(R1, "(.+)", [global]), |
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.
Isn't it less obscure to just use string:tokens
? :)
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.
Indeed
There is no chance of collision, because MUCs exist in different subdomain. So even if room username is equal to user username, then it's fine. Todos from description are not necessary. |
6346.1 / Erlang 19.3 / small_tests / c622065 6346.5 / Erlang 19.3 / ldap_mnesia / c622065 6346.2 / Erlang 19.3 / internal_mnesia / c622065 pubsub_SUITE:dag+collection:notify_collection_leaf_and_item_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"bOb14.323244@localhost/res1">>,escalus_tcp,
<0.4646.1>,
[{event_manager,<0.4534.1>},
{server,<<"localhost">>},
{username,<<"bOb14.323244">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.4534.1>},
{server,<<"localhost">>},
{username,<<"bOb14.323244">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"bOb14.323244">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"bOb14.323244">>},
{server,<<"localhost">>},
{password,<<"makrolika">>},
{stream_id,<<"123886DF5C0619C3">>}]},
5000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{pubsub_tools,receive_notification,3,
[{file,"pubsub_tools.erl"},{line,480}]},
{pubsub_tools,receive_node_creation_notification,3,
[{file,"pubsub_tools.erl"},{line,304}]},
{pubsub_SUITE,'-notify_collection_leaf_and_item_test/1-fun-0-',2,
[{file,"pubsub_SUITE.erl"},{line,1266}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_bui... sm_SUITE:parallel:subscription_requests_are_buffered_properly{error,{{badmatch,false},
[{escalus_session,stream_management,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_session.erl"},
{line,227}]},
{escalus_connection,connection_step,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
{line,134}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
{escalus_connection,start,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
{line,118}]},
{sm_SUITE,'-subscription_requests_are_buffered_properly/1-fun-3-',6,
[{file,"sm_SUITE.erl"},{line,848}]},
{escalus_story,story,4,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1529}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1045}]}]}} sm_SUITE:parallel:subscription_requests_are_buffered_properly{error,{{badmatch,false},
[{escalus_session,stream_management,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_session.erl"},
{line,227}]},
{escalus_connection,connection_step,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
{line,134}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
{escalus_connection,start,2,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
{line,118}]},
{sm_SUITE,'-subscription_requests_are_buffered_properly/1-fun-3-',6,
[{file,"sm_SUITE.erl"},{line,848}]},
{escalus_story,story,4,
[{file,"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1529}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1045}]}]}} mod_global_distrib_SUITE:mod_global_distrib:test_pm_with_ungraceful_reconnection_to_different_server{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"eve87.731269@localhost/res1">>,escalus_tcp,
<0.18724.1>,
[{event_manager,<0.18715.1>},
{server,<<"localhost">>},
{username,<<"eve87.731269">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.18715.1>},
{server,<<"localhost">>},
{username,<<"eve87.731269">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"eve87.731269">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"eve87.731269">>},
{server,<<"localhost">>},
{password,<<"password">>},
{port,5222},
{stream_management,true},
{stream_id,<<"9F9541B4E054DD11">>}]},
10000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{mod_global_distrib_SUITE,
'-test_pm_with_ungraceful_reconnection_to_different_server/1-fun-0-',
4,
[{file,"mod_global_distrib_SUITE.erl"},{line,610}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
... 6346.3 / Erlang 19.3 / mysql_redis / c622065 6346.6 / Erlang 19.3 / elasticsearch_and_cassandra_mnesia / c622065 6346.4 / Erlang 19.3 / odbc_mssql_mnesia / c622065 6346.8 / Erlang 20.0 / pgsql_mnesia / c622065 6346.9 / Erlang 21.0 / riak_mnesia / c622065 mod_global_distrib_SUITE:mod_global_distrib:test_pm_with_ungraceful_reconnection_to_different_server{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"eve5.507482@localhost/res1">>,escalus_tcp,
<0.25551.1>,
[{event_manager,<0.25542.1>},
{server,<<"localhost">>},
{username,<<"eve5.507482">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.25542.1>},
{server,<<"localhost">>},
{username,<<"eve5.507482">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"eve5.507482">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"eve5.507482">>},
{server,<<"localhost">>},
{password,<<"password">>},
{port,5222},
{stream_management,true},
{stream_id,<<"D9F80A55AF9BFD61">>}]},
10000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{mod_global_distrib_SUITE,
'-test_pm_with_ungraceful_reconnection_to_different_server/1-fun-0-',
4,
[{file,"mod_global_distrib_SUITE.erl"},{line,610}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{tes... |
This PR modifies
register
command in the cli as well as addsregister_identified
command.register
- it no longer accepts username argument and instead generates random and monotonic user uid.register_identified
- it behaves the same way asregister
used to behave.TODO: