-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(boundary): add metrics and access control to
salt_sharing
can…
…ister (#3762) **Changes**: - added metrics - bazelification - access control, only API boundary nodes can call the `get_salt()` - `inspect_message` for early rejections of replicated query calls - added polling of API boundary nodes - improved structure by moving implementation of `/logs` **How to test**: ``` // deploy with dfx $ dfx deploy salt_sharing -m reinstall --playground --argument \ '(record { regenerate_now = true; salt_generation_strategy = variant { StartOfMonth }; registry_polling_interval_secs = 60; })' ``` **Check metrics**: ``` https://{canister_id}.raw.icp0.io/metrics ``` **Check logs**: ``` https://{canister_id}.raw.icp0.io/logs ``` --------- Co-authored-by: IDX GitLab Automation <[email protected]> Co-authored-by: r-birkner <[email protected]>
- Loading branch information
1 parent
1f525da
commit 28c8a07
Showing
13 changed files
with
501 additions
and
143 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
load("@rules_rust//rust:defs.bzl", "rust_test") | ||
load("//bazel:canisters.bzl", "rust_canister") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
DEPENDENCIES = [ | ||
# Keep sorted. | ||
"//rs/boundary_node/salt_sharing/api:salt_sharing_api", | ||
"//rs/nns/constants", | ||
"//rs/rust_canisters/canister_log", | ||
"//rs/rust_canisters/http_types", | ||
"@crate_index//:candid", | ||
"@crate_index//:ic-cdk", | ||
"@crate_index//:ic-cdk-timers", | ||
"@crate_index//:ic-stable-structures", | ||
"@crate_index//:prometheus", | ||
"@crate_index//:serde", | ||
"@crate_index//:serde_cbor", | ||
"@crate_index//:serde_json", | ||
"@crate_index//:time", | ||
] | ||
|
||
MACRO_DEPENDENCIES = [ | ||
# Keep sorted. | ||
"@crate_index//:ic-cdk-macros", | ||
] | ||
|
||
rust_canister( | ||
name = "salt_sharing_canister", | ||
srcs = glob(["canister/**/*.rs"]), | ||
crate_name = "salt_sharing_canister", | ||
crate_root = "canister/lib.rs", | ||
proc_macro_deps = MACRO_DEPENDENCIES, | ||
service_file = "canister/salt_sharing_canister.did", | ||
deps = DEPENDENCIES, | ||
) | ||
|
||
rust_test( | ||
name = "unit_tests", | ||
srcs = glob(["canister/**/*.rs"]), | ||
crate_name = "salt_sharing_canister", | ||
crate_root = "canister/lib.rs", | ||
data = ["canister/salt_sharing_canister.did"], | ||
proc_macro_deps = MACRO_DEPENDENCIES, | ||
deps = DEPENDENCIES + ["@crate_index//:candid_parser"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
load("@rules_rust//rust:defs.bzl", "rust_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
DEPENDENCIES = [ | ||
# Keep sorted. | ||
"@crate_index//:candid", | ||
"@crate_index//:serde", | ||
] | ||
|
||
rust_library( | ||
name = "salt_sharing_api", | ||
srcs = glob(["src/**/*.rs"]), | ||
aliases = {}, | ||
crate_name = "salt_sharing_api", | ||
proc_macro_deps = [], | ||
deps = DEPENDENCIES, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.