Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SERVICE_NAME=kds
OTP_VERSION=24.3.4
REBAR_VERSION=3.18
OTP_VERSION=27.1.2
REBAR_VERSION=3.24
THRIFT_VERSION=0.14.2.3
5 changes: 3 additions & 2 deletions .github/workflows/erlang-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
thrift-version: ${{ steps.thrift-version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- run: grep -v '^#' .env >> $GITHUB_ENV
- id: otp-version
run: echo "::set-output name=version::$OTP_VERSION"
Expand All @@ -30,9 +30,10 @@ jobs:
run:
name: Run checks
needs: setup
uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v1.0.12
uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v1.0.18
with:
otp-version: ${{ needs.setup.outputs.otp-version }}
rebar-version: ${{ needs.setup.outputs.rebar-version }}
use-thrift: true
thrift-version: ${{ needs.setup.outputs.thrift-version }}
upload-coverage: false
2 changes: 2 additions & 0 deletions apps/kds/src/kds.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
kernel,
stdlib,
crypto,
prometheus,
prometheus_cowboy,
woody,
erl_health,
shamir,
Expand Down
2 changes: 1 addition & 1 deletion apps/kds/src/kds.erl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ init([]) ->
-spec enable_health_logging(erl_health:check()) -> erl_health:check().
enable_health_logging(Check) ->
EvHandler = {erl_health_event_handler, []},
maps:map(fun(_, V = {_, _, _}) -> #{runner => V, event_handler => EvHandler} end, Check).
maps:map(fun(_, {_, _, _} = V) -> #{runner => V, event_handler => EvHandler} end, Check).

-spec get_prometheus_route() -> {iodata(), module(), _Opts :: any()}.
get_prometheus_route() ->
Expand Down
14 changes: 6 additions & 8 deletions apps/kds/src/kds_keyring_management_thrift_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,8 @@ handle_function_('CancelRekey', {}, _Context, _Opts) ->
raise(#cds_InvalidStatus{status = Status})
end;
handle_function_('GetState', {}, _Context, _Opts) ->
case kds_keyring_manager:get_status() of
Status ->
{ok, encode_state(Status)}
end;
Status = kds_keyring_manager:get_status(),
{ok, encode_state(Status)};
handle_function_('UpdateKeyringMeta', {KeyringMeta}, _Context, _Opts) ->
try
DecodedKeyringMeta = kds_keyring_meta:decode_keyring_meta_diff(KeyringMeta),
Expand Down Expand Up @@ -237,27 +235,27 @@ encode_encrypted_share(#{
kds_keysharing:signed_masterkey_share(),
atom()
) -> kds_keysharing:masterkey_share().
verify_signed_share(ShareholderId, SignedShare, OperationId) ->
verify_signed_share(ShareholderId, SignedShare, OperationID) ->
case kds_shareholder:get_public_key_by_id(ShareholderId, sig) of
{ok, PublicKey} ->
case kds_crypto:verify(PublicKey, SignedShare) of
{ok, Share} ->
_ = logger:info(
"Shareholder ~w finished verification of operation ~w",
[ShareholderId, OperationId]
[ShareholderId, OperationID]
),
Share;
{error, failed_to_verify} ->
_ = logger:info(
"Shareholder ~w failed verification of operation ~w",
[ShareholderId, OperationId]
[ShareholderId, OperationID]
),
raise(#cds_VerificationFailed{})
end;
{error, not_found} ->
_ = logger:info(
"Shareholder ~w failed verification of operation ~w",
[ShareholderId, OperationId]
[ShareholderId, OperationID]
),
raise(#cds_VerificationFailed{})
end.
Expand Down
4 changes: 2 additions & 2 deletions apps/kds/src/kds_woody_event_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
%%
%% woody_event_handler behaviour callbacks
%%
-spec handle_event(Event, RpcId, Meta, Opts) -> ok when
-spec handle_event(Event, RpcID, Meta, Opts) -> ok when
Event :: woody_event_handler:event(),
RpcId :: woody:rpc_id() | undefined,
RpcID :: woody:rpc_id() | undefined,
Meta :: woody_event_handler:event_meta(),
Opts :: woody:options().
handle_event(Event, RpcID, RawMeta, Opts) ->
Expand Down
2 changes: 1 addition & 1 deletion apps/kds/test/kds_keyring_api_tests_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ init(C) ->
-spec init_with_timeout(config()) -> _.
init_with_timeout(C) ->
{Id, DecryptedMasterKeyShare} = partial_init(C),
Timeout = genlib_app:env(kds, keyring_rotation_lifetime, 4000),
Timeout = genlib_app:env(kds, keyring_initialize_lifetime, 3000),
ok = timer:sleep(Timeout + 1500),
_ = ?assertEqual(
{error, {invalid_activity, {initialization, uninitialized}}},
Expand Down
12 changes: 8 additions & 4 deletions elvis.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
{elvis_style, nesting_level, #{level => 3}},
{elvis_style, no_if_expression, disable},
{elvis_style, state_record_and_type, disable},
{elvis_style, dont_repeat_yourself, #{min_complexity => 15}}
{elvis_style, dont_repeat_yourself, #{min_complexity => 15}},
{elvis_style, export_used_types, disable},
{elvis_style, no_throw, disable}
]
},
#{
Expand All @@ -26,7 +28,10 @@
{elvis_style, no_debug_call, disable},
% Tests are usually more comprehensible when a bit more verbose.
{elvis_style, dont_repeat_yourself, #{min_complexity => 30}},
{elvis_style, god_modules, disable}
{elvis_style, god_modules, disable},
{elvis_style, export_used_types, disable},
{elvis_style, no_throw, disable},
{elvis_style, no_catch_expressions, disable}
]
},
#{
Expand All @@ -47,8 +52,7 @@
{elvis_text_style, line_length, #{limit => 120}},
{elvis_text_style, no_tabs},
{elvis_text_style, no_trailing_whitespace},
%% Temporarily disabled till regex pattern is available
{elvis_project, no_deps_master_rebar, disable}
{elvis_project, no_branch_deps, disable}
]
},
#{
Expand Down
32 changes: 12 additions & 20 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@
%% Pinning to version "1.11.2" from hex here causes constant upgrading and recompilation of the entire project
{jose, {git, "https://github.com/potatosalad/erlang-jose.git", {tag, "1.11.2"}}},
{shamir, {git, "https://github.com/valitydev/shamir.git", {branch, master}}},
{woody, {git, "https://github.com/valitydev/woody_erlang.git", {branch, master}}},
{genlib, {git, "https://github.com/valitydev/genlib.git", {branch, master}}},
{woody, {git, "https://github.com/valitydev/woody_erlang.git", {tag, "v1.1.0"}}},
{genlib, {git, "https://github.com/valitydev/genlib.git", {tag, "v1.1.0"}}},
{erl_health, {git, "https://github.com/valitydev/erlang-health.git", {branch, master}}},
{cds_proto, {git, "https://github.com/valitydev/cds-proto.git", {branch, master}}},
{msgpack, {git, "https://github.com/valitydev/msgpack-erlang", {branch, master}}},
{scoper, {git, "https://github.com/valitydev/scoper.git", {branch, master}}},
{opentelemetry_api, "1.2.1"},
{opentelemetry, "1.3.0"},
{opentelemetry_exporter, "1.3.0"}
{scoper, {git, "https://github.com/valitydev/scoper.git", {tag, "v1.1.0"}}},
{prometheus, "4.11.0"},
{prometheus_cowboy, "0.1.9"},
{opentelemetry_api, "1.4.0"},
{opentelemetry, "1.5.0"},
{opentelemetry_exporter, "1.8.0"}
]}.

%% XRef checks
Expand All @@ -59,7 +61,6 @@
% mandatory
unmatched_returns,
error_handling,
race_conditions,
unknown
]},
{plt_apps, all_deps}
Expand All @@ -70,25 +71,16 @@
{deps, [
% for introspection on production
{recon, "2.5.2"},
% Because of a dependency conflict, prometheus libs are only included in the prod profile for now
% https://github.com/project-fifo/rebar3_lint/issues/42
% https://github.com/valitydev/hellgate/pull/2/commits/884724c1799703cee4d1033850fe32c17f986d9e
{prometheus, "4.8.1"},
{prometheus_cowboy, "0.1.8"},
{logger_logstash_formatter,
{git, "https://github.com/valitydev/logger_logstash_formatter.git", {ref, "08a66a6"}}},
{iosetopts, {git, "https://github.com/valitydev/iosetopts.git", {ref, "edb445c"}}}
{git, "https://github.com/valitydev/logger_logstash_formatter.git", {ref, "08a66a6"}}}
]},
{relx, [
{release, {kds, "0.1.0"}, [
iosetopts,
{recon, load},
{runtime_tools, load},
{tools, load},
{opentelemetry, temporary},
{logger_logstash_formatter, load},
prometheus,
prometheus_cowboy,
sasl,
kds
]},
Expand All @@ -108,9 +100,9 @@
]}.

{project_plugins, [
{rebar3_lint, "1.0.1"},
{erlfmt, "1.0.0"},
{covertool, "2.0.4"}
{rebar3_lint, "3.2.6"},
{erlfmt, "1.5.0"},
{covertool, "2.0.7"}
]}.

%% Linter config.
Expand Down
Loading
Loading