-
Notifications
You must be signed in to change notification settings - Fork 426
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
Use maps for mod_keystore config #3599
Conversation
small_tests_24 / small_tests / af191c9 small_tests_23 / small_tests / af191c9 dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / af191c9 dynamic_domains_mysql_redis_24 / mysql_redis / af191c9 dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / af191c9 ldap_mnesia_23 / ldap_mnesia / af191c9 ldap_mnesia_24 / ldap_mnesia / af191c9 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / af191c9 internal_mnesia_24 / internal_mnesia / af191c9 mysql_redis_24 / mysql_redis / af191c9 pgsql_mnesia_24 / pgsql_mnesia / af191c9 pgsql_mnesia_23 / pgsql_mnesia / af191c9 elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / af191c9 mssql_mnesia_24 / odbc_mssql_mnesia / af191c9 riak_mnesia_24 / riak_mnesia / af191c9 |
Codecov Report
@@ Coverage Diff @@
## master #3599 +/- ##
=======================================
Coverage 80.88% 80.89%
=======================================
Files 426 426
Lines 32249 32236 -13
=======================================
- Hits 26086 26077 -9
+ Misses 6163 6159 -4
Continue to review full report at Codecov.
|
Because the validation of different keys has been moved to parsing the config, the test is also moved to the config_parser_SUITE.
af191c9
to
b56b254
Compare
small_tests_24 / small_tests / b56b254 small_tests_23 / small_tests / b56b254 dynamic_domains_mysql_redis_24 / mysql_redis / b56b254 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / b56b254 dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / b56b254 dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / b56b254 ldap_mnesia_23 / ldap_mnesia / b56b254 ldap_mnesia_24 / ldap_mnesia / b56b254 internal_mnesia_24 / internal_mnesia / b56b254 pgsql_mnesia_24 / pgsql_mnesia / b56b254 pgsql_mnesia_23 / pgsql_mnesia / b56b254 mysql_redis_24 / mysql_redis / b56b254 muc_SUITE:hibernation:hibernated_room_can_be_queried_for_archive{error,{{assertion_failed,assert,is_groupchat_message,
[<<"Restorable message">>],
undefined,"undefined"},
[{escalus_new_assert,assert_true,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{muc_SUITE,wait_for_mam_result,3,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4383}]},
{muc_SUITE,'-hibernated_room_can_be_queried_for_archive/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4124}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{muc_SUITE,hibernated_room_can_be_queried_for_archive,1,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4120}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / b56b254 mssql_mnesia_24 / odbc_mssql_mnesia / b56b254 riak_mnesia_24 / riak_mnesia / b56b254 |
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 have a suggestion. What do you think about it?
src/mod_keystore.erl
Outdated
@@ -84,7 +78,11 @@ config_spec() -> | |||
items = #{<<"ram_key_size">> => #option{type = integer, | |||
validate = non_negative}, | |||
<<"keys">> => #list{items = keys_spec()} |
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.
We could validate the keys here by just adding format_items = map
and thus checking the uniqueness without the need for the whole validate_key_ids
function.
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.
Would this fail, or just take the last key? I assumed it would work without failure (while we would like an error to be thrown).
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.
The keys would be validated for uniqueness, see https://github.com/esl/MongooseIM/blob/master/src/config/mongoose_config_parser_toml.erl#L190
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.
OK, thanks for the clarification - done.
This comment was marked as outdated.
This comment was marked as outdated.
8aaec66
to
40a2e23
Compare
This comment was marked as outdated.
This comment was marked as outdated.
40a2e23
to
d6b2f35
Compare
small_tests_23 / small_tests / d6b2f35 small_tests_24 / small_tests / d6b2f35 dynamic_domains_mysql_redis_24 / mysql_redis / d6b2f35 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / d6b2f35 dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / d6b2f35 dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / d6b2f35 ldap_mnesia_23 / ldap_mnesia / d6b2f35 ldap_mnesia_24 / ldap_mnesia / d6b2f35 internal_mnesia_24 / internal_mnesia / d6b2f35 pgsql_mnesia_24 / pgsql_mnesia / d6b2f35 pgsql_mnesia_23 / pgsql_mnesia / d6b2f35 elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / d6b2f35 mysql_redis_24 / mysql_redis / d6b2f35 mssql_mnesia_24 / odbc_mssql_mnesia / d6b2f35 riak_mnesia_24 / riak_mnesia / d6b2f35 |
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 👍
The validation of different keys has been moved to parsing the config. Thus, the test is also moved to the config_parser_SUITE.