Skip to content

Commit

Permalink
Merge pull request #271 from esl/deps_upgrades_and_changes
Browse files Browse the repository at this point in the history
Deps upgrades and changes
  • Loading branch information
DenysGonchar authored Jan 8, 2025
2 parents b97ccec + 2850a21 commit adc7f00
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 45 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
name: OTP ${{matrix.otp_vsn}}
strategy:
matrix:
otp_vsn: ['27.0.1', '26.2', '25.3', '24.3']
rebar_vsn: ['3.22.0']
runs-on: 'ubuntu-22.04'
otp_vsn: ['27', '26']
rebar_vsn: ['3.24.0']
runs-on: 'ubuntu-24.04'
env:
OTPVER: ${{ matrix.otp_vsn }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_vsn }}
Expand All @@ -29,4 +29,4 @@ jobs:
- run: make test
- run: make ct
- run: make dialyzer
if: ${{ matrix.otp == '27.0.1' }}
if: ${{ matrix.otp == '27' }}
13 changes: 6 additions & 7 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
{i, [".", "include"]}
]}.

{require_min_otp_vsn, "21"}.
{require_min_otp_vsn, "26"}.

{deps, [
{exml, "3.4.1", {pkg, hexml}},
{base16, "2.0.1"},
{meck, "0.9.2"},
{meck, "1.0.0"},
{bbmustache, "1.12.2"},
{uuid, "2.0.7", {pkg, uuid_erl}},
{gun, "2.0.1"},
{worker_pool, "6.2.1"},
{gun, "2.1.0"},
{worker_pool, "6.4.0"},
{fast_tls, "1.1.21"},
{fast_scram, "0.6.0"}
{fast_scram, "0.6.1"}
]}.

%% To override the plugin as installed by worker_pool
Expand All @@ -25,7 +24,7 @@
{override, worker_pool, [{minimum_otp_vsn, "24"}]}
]}.

{relx, [{release, {escalus, "0.0.1"},
{relx, [{release, {escalus, git},
[escalus]},
{dev_mode, true},
{sys_config, "./sys.config"},
Expand Down
41 changes: 19 additions & 22 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
{"1.2.0",
[{<<"base16">>,{pkg,<<"base16">>,<<"2.0.1">>},0},
{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.12.2">>},0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.12.1">>},1},
[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.12.2">>},0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.13.0">>},1},
{<<"exml">>,{pkg,<<"hexml">>,<<"3.4.1">>},0},
{<<"fast_pbkdf2">>,{pkg,<<"fast_pbkdf2">>,<<"1.0.5">>},1},
{<<"fast_scram">>,{pkg,<<"fast_scram">>,<<"0.6.0">>},0},
{<<"fast_pbkdf2">>,{pkg,<<"fast_pbkdf2">>,<<"1.0.6">>},1},
{<<"fast_scram">>,{pkg,<<"fast_scram">>,<<"0.6.1">>},0},
{<<"fast_tls">>,{pkg,<<"fast_tls">>,<<"1.1.21">>},0},
{<<"gun">>,{pkg,<<"gun">>,<<"2.0.1">>},0},
{<<"meck">>,{pkg,<<"meck">>,<<"0.9.2">>},0},
{<<"gun">>,{pkg,<<"gun">>,<<"2.1.0">>},0},
{<<"meck">>,{pkg,<<"meck">>,<<"1.0.0">>},0},
{<<"p1_utils">>,{pkg,<<"p1_utils">>,<<"1.0.26">>},1},
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.7">>},1},
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.7">>},0},
{<<"worker_pool">>,{pkg,<<"worker_pool">>,<<"6.2.1">>},0}]}.
{<<"worker_pool">>,{pkg,<<"worker_pool">>,<<"6.4.0">>},0}]}.
[
{pkg_hash,[
{<<"base16">>, <<"F0549F732E03BE8124ED0D19FD5EE52146CC8BE24C48CBC3F23AB44B157F11A2">>},
{<<"bbmustache">>, <<"0CABDCE0DB9FE6D3318131174B9F2B351328A4C0AFBEB3E6E99BB0E02E9B621D">>},
{<<"cowlib">>, <<"A9FA9A625F1D2025FE6B462CB865881329B5CAFF8F1854D1CBC9F9533F00E1E1">>},
{<<"cowlib">>, <<"DB8F7505D8332D98EF50A3EF34B34C1AFDDEC7506E4EE4DD4A3A266285D282CA">>},
{<<"exml">>, <<"9581FE6512D9772C61BBE611CD4A8E5BB90B4D4481275325EC520F7A931A9393">>},
{<<"fast_pbkdf2">>, <<"6045138C4C209FC8222A0B18B2CB1D7BD7407EF4ADAD0F14C5E0F7F4726E3E41">>},
{<<"fast_scram">>, <<"70724F584A118DA147A51EE38DEE56203F217D58AD61E0BB2C2EF834C16B35B8">>},
{<<"fast_pbkdf2">>, <<"199BCEC73A1A246941E9465D3DC41052953B638128841ED24B29ED03CF70AF27">>},
{<<"fast_scram">>, <<"BEEADB03D774640F0671681759CE53B2FF33CB58C86FD9BF2A793E2FC1ED0F5D">>},
{<<"fast_tls">>, <<"65D7D547A09EEFB37A1C0D04D8601FAC4F3E6E2C1EDE859A7787081670F9648D">>},
{<<"gun">>, <<"160A9A5394800FCBA41BC7E6D421295CF9A7894C2252C0678244948E3336AD73">>},
{<<"meck">>, <<"85CCBAB053F1DB86C7CA240E9FC718170EE5BDA03810A6292B5306BF31BAE5F5">>},
{<<"gun">>, <<"B4E4CBBF3026D21981C447E9E7CA856766046EFF693720BA43114D7F5DE36E87">>},
{<<"meck">>, <<"24676CB6EE6951530093A93EDCD410CFE4CB59FE89444B875D35C9D3909A15D0">>},
{<<"p1_utils">>, <<"67B0C4AC9FA3BA3EF563B31AA111B0A004439A37FAC85E027F1C3617E1C7EC6C">>},
{<<"quickrand">>, <<"D2BD76676A446E6A058D678444B7FDA1387B813710D1AF6D6E29BB92186C8820">>},
{<<"uuid">>, <<"B2078D2CC814F53AFA52D36C91E08962C7E7373585C623F4C0EA6DFB04B2AF94">>},
{<<"worker_pool">>, <<"BD98A0BE1D20057AE9967CBE73D263AEA5BE14BBE4C73CAFEB1378572FF14561">>}]},
{<<"worker_pool">>, <<"0347B805A8E5804B5676A9885FB3B9B6C1627099C449C3C67C0E8E6AF79E9AA6">>}]},
{pkg_hash_ext,[
{<<"base16">>, <<"06EA2D48343282E712160BA89F692B471DB8B36ABE8394F3445FF9032251D772">>},
{<<"bbmustache">>, <<"688B33A4D5CC2D51F575ADF0B3683FC40A38314A2F150906EDCFC77F5B577B3B">>},
{<<"cowlib">>, <<"163B73F6367A7341B33C794C4E88E7DBFE6498AC42DCD69EF44C5BC5507C8DB0">>},
{<<"cowlib">>, <<"E1E1284DC3FC030A64B1AD0D8382AE7E99DA46C3246B815318A4B848873800A4">>},
{<<"exml">>, <<"D8E7894E2544402B4986EEB2443C15B51B14F686266F091DBF2777D1D99A2FA2">>},
{<<"fast_pbkdf2">>, <<"BC3B5A3CAB47AD114FF8BB815FEDE62A6187ACD14D8B37412F2AF8236A089CEF">>},
{<<"fast_scram">>, <<"771D034341599CFC6A6C5E56CF924B68D2C7478088CAF17419E3147B66914667">>},
{<<"fast_pbkdf2">>, <<"35EEC22629AAA739915843C7B7DE0D84657D1ECE972D8BBC86368747E9C14012">>},
{<<"fast_scram">>, <<"FE0650A309FDF97C75E1EA812CCFB40EB464ECAFD3783E83AA17C7F572EDAB0B">>},
{<<"fast_tls">>, <<"131542913937025E48CD80AA81F00359686D5501B75621E72026A87B5229505B">>},
{<<"gun">>, <<"A10BC8D6096B9502205022334F719CC9A08D9ADCFBFC0DBEE9EF31B56274A20B">>},
{<<"meck">>, <<"81344F561357DC40A8344AFA53767C32669153355B626EA9FCBC8DA6B3045826">>},
{<<"gun">>, <<"52FC7FC246BFC3B00E01AEA1C2854C70A366348574AB50C57DFE796D24A0101D">>},
{<<"meck">>, <<"680A9BCFE52764350BEB9FB0335FB75FEE8E7329821416CEE0A19FEC35433882">>},
{<<"p1_utils">>, <<"D0379E8C1156B98BD64F8129C1DE022FCCA4F2FDB7486CE73BF0ED2C3376B04C">>},
{<<"quickrand">>, <<"B8ACBF89A224BC217C3070CA8BEBC6EB236DBE7F9767993B274084EA044D35F0">>},
{<<"uuid">>, <<"4E4C5CA3461DC47C5E157ED42AA3981A053B7A186792AF972A27B14A9489324E">>},
{<<"worker_pool">>, <<"64E560DE08CA5E7DB8BD4CDCC7B744B0659696194E3BC9E56239BA4A0F7E24F9">>}]}
{<<"worker_pool">>, <<"59946FBCE1D331CDEB153EDD36A823DC1AAB4C2482662582B983C9C90EBC3461">>}]}
].
1 change: 0 additions & 1 deletion src/escalus.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
stdlib,
ssl,
exml,
base16,
gun,
meck,
bbmustache,
Expand Down
6 changes: 3 additions & 3 deletions src/escalus_auth.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
%% Some shorthands
-type client() :: escalus_connection:client().
-type user_spec() :: escalus_users:user_spec().
-type hash_type() :: scram:hash_type().
-type hash_type() :: fast_scram:sha_type().
-type plus_variant() :: none | tls_unique.
-type scram_options() :: #{plus_variant := plus_variant(),
hash_type := hash_type(),
Expand Down Expand Up @@ -191,7 +191,7 @@ md5_digest_response(ChallengeData, Props) ->
Server = get_property(server, Props),
Resource = get_property(resource, Props),
Nonce = get_property(<<"nonce">>, ChallengeData),
CNonce = base16:encode(crypto:strong_rand_bytes(16)),
CNonce = binary:encode_hex(crypto:strong_rand_bytes(16), lowercase),
Realm = proplists:get_value(<<"realm">>, ChallengeData, <<>>),
QOP = get_property(<<"qop">>, ChallengeData),
NC = <<"00000001">>,
Expand Down Expand Up @@ -230,7 +230,7 @@ scram_sha_auth_payload(fast_tls, tls_unique, Conn) ->


hex_md5(Data) ->
base16:encode(crypto:hash(md5, Data)).
binary:encode_hex(crypto:hash(md5, Data), lowercase).

%%--------------------------------------------------------------------
%% Helpers - actions
Expand Down
2 changes: 1 addition & 1 deletion src/escalus_bosh.erl
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ handle_info(_, #state{ terminated = true } = S) ->
{noreply, S};
handle_info({http_reply, Ref, Body, _Transport} = HttpReply,
#state{ pending_replies = PendingReplies } = S0) ->
Timestamp = os:system_time(micro_seconds),
Timestamp = os:system_time(microsecond),
{ok, #xmlel{attrs = Attrs} = XmlBody} = exml:parse(Body),
NewS = case {queue:peek(S0#state.requests),
S0#state.quickfail andalso detect_type(Attrs) == streamend} of
Expand Down
2 changes: 1 addition & 1 deletion src/escalus_component.erl
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ component_stream_start(Component) ->
component_handshake_el(SID, Password) ->
Handshake = crypto:hash(sha, <<SID/binary, Password/binary>>),
#xmlel{name = <<"handshake">>,
children = [#xmlcdata{content = base16:encode(Handshake)}]}.
children = [#xmlcdata{content = binary:encode_hex(Handshake, lowercase)}]}.
Empty file modified src/escalus_pubsub_stanza.erl
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion src/escalus_stanza.erl
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ marker_el(MarkerName, MessageId) when MarkerName =:= <<"received">> orelse

-spec id() -> binary().
id() ->
base16:encode(crypto:strong_rand_bytes(16)).
binary:encode_hex(crypto:strong_rand_bytes(16), lowercase).

-spec uuid_v4() -> binary().
uuid_v4() ->
Expand Down
Empty file modified src/escalus_tcp.erl
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion src/escalus_ws.erl
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ do_connect(#{host := Host, port := Port}, TransportOpts) ->

handle_data(Data, State = #state{parser = Parser,
compress = Compress}) ->
Timestamp = os:system_time(micro_seconds),
Timestamp = os:system_time(microsecond),
{ok, NewParser, Stanzas} =
case Compress of
false ->
Expand Down
2 changes: 1 addition & 1 deletion test/connection_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ msg() -> <<"Message">>.

msg2() -> <<"Message 2">>.

metadata() -> #{recv_timestamp => os:system_time(micro_seconds)}.
metadata() -> #{recv_timestamp => os:system_time(microsecond)}.

client() -> #client{jid = my_jid(), rcv_pid = self(), props = []}.

Expand Down
4 changes: 2 additions & 2 deletions test/escalus_tcp_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ interleave_msgs_and_rs_test() ->
State = #state{owner = self(),
sm_state = {true, 0, active},
event_client = self()},
SecondState = escalus_tcp:forward_to_owner(FirstStanzas, State, os:system_time(micro_seconds)),
SecondState = escalus_tcp:forward_to_owner(FirstStanzas, State, os:system_time(microsecond)),
#state{sm_state = SMState} =
escalus_tcp:forward_to_owner(SecondStanzas, SecondState, os:system_time(micro_seconds)),
escalus_tcp:forward_to_owner(SecondStanzas, SecondState, os:system_time(microsecond)),
?assertEqual({true, 3, active}, SMState),
meck:unload(escalus_event),
meck:unload(gen_tcp).
Expand Down

0 comments on commit adc7f00

Please sign in to comment.