From 81e659789791f4ce85a200966b334920bc76f732 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 20 Mar 2026 07:00:08 +0100 Subject: [PATCH 1/4] docs: access keys and guards references in rust Signed-off-by: David Dal Busco --- docs/reference/functions/rust/sdk.mdx | 62 ++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/docs/reference/functions/rust/sdk.mdx b/docs/reference/functions/rust/sdk.mdx index 69d92587..7ee0430b 100644 --- a/docs/reference/functions/rust/sdk.mdx +++ b/docs/reference/functions/rust/sdk.mdx @@ -316,33 +316,75 @@ pub fn get_content_chunks_store( --- -## Controllers +## Access Keys -The following functions allow you to inspect and assert the controllers of your Satellite. +The following functions allow you to inspect and assert the access keys of your Satellite. --- -### get_controllers +### get_access_keys -Retrieves all controllers of the Satellite. +Retrieves all access keys of the Satellite. ```rust -pub fn get_controllers() -> Controllers +pub fn get_access_keys() -> AccessKeys ``` -📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_controllers.html) +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_access_keys.html) --- -### get_admin_controllers +### get_admin_access_keys -Retrieves only the admin controllers of the Satellite. +Retrieves only the admin access_keys of the Satellite. ```rust -pub fn get_admin_controllers() -> Controllers +pub fn get_admin_access_keys() -> AccessKeys ``` -📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_admin_controllers.html) +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_admin_access_keys.html) + +--- + +## Guards + +The following guard functions can be used to validate the caller in your custom serverless functions. + +--- + +### caller_is_admin + +Guards that the caller is an admin access key of this satellite. Admin access keys have full management privileges and never expire. + +```rust +pub fn caller_is_admin() -> Result<(), String> +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_is_admin.html) + +--- + +### caller_has_write_permission + +Guards that the caller has write permission. Admin and editor access keys pass; submitter access keys do not. + +```rust +pub fn caller_has_write_permission() -> Result<(), String> +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_has_write_permission.html) + +--- + +### caller_is_access_key + +Guards that the caller is any recognized access key of this satellite. Accepts admin, editor, and submitter access keys alike. + +```rust +pub fn caller_is_access_key() -> Result<(), String> +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_is_access_key.html) --- From 6104b0113e57dfb46254aacd6afb71e4c2bbd90b Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 06:01:57 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 62 +++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index fc06c1e4..cb456009 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -12141,33 +12141,75 @@ pub fn get_content_chunks_store( encoding: &AssetEncoding, chunk_index: us --- -## Controllers +## Access Keys -The following functions allow you to inspect and assert the controllers of your Satellite. +The following functions allow you to inspect and assert the access keys of your Satellite. --- -### get\_controllers +### get\_access\_keys -Retrieves all controllers of the Satellite. +Retrieves all access keys of the Satellite. ``` -pub fn get_controllers() -> Controllers +pub fn get_access_keys() -> AccessKeys ``` -📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_controllers.html) +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_access_keys.html) --- -### get\_admin\_controllers +### get\_admin\_access\_keys -Retrieves only the admin controllers of the Satellite. +Retrieves only the admin access\_keys of the Satellite. ``` -pub fn get_admin_controllers() -> Controllers +pub fn get_admin_access_keys() -> AccessKeys ``` -📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_admin_controllers.html) +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_admin_access_keys.html) + +--- + +## Guards + +The following guard functions can be used to validate the caller in your custom serverless functions. + +--- + +### caller\_is\_admin + +Guards that the caller is an admin access key of this satellite. Admin access keys have full management privileges and never expire. + +``` +pub fn caller_is_admin() -> Result<(), String> +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_is_admin.html) + +--- + +### caller\_has\_write\_permission + +Guards that the caller has write permission. Admin and editor access keys pass; submitter access keys do not. + +``` +pub fn caller_has_write_permission() -> Result<(), String> +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_has_write_permission.html) + +--- + +### caller\_is\_access\_key + +Guards that the caller is any recognized access key of this satellite. Accepts admin, editor, and submitter access keys alike. + +``` +pub fn caller_is_access_key() -> Result<(), String> +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_is_access_key.html) --- From 86a7e88af97bda82f312ee2661c6f243da3b3a75 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 20 Mar 2026 19:16:51 +0100 Subject: [PATCH 3/4] docs: access keys fn Signed-off-by: David Dal Busco --- docs/reference/functions/rust/sdk.mdx | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docs/reference/functions/rust/sdk.mdx b/docs/reference/functions/rust/sdk.mdx index 7ee0430b..662e344d 100644 --- a/docs/reference/functions/rust/sdk.mdx +++ b/docs/reference/functions/rust/sdk.mdx @@ -346,6 +346,51 @@ pub fn get_admin_access_keys() -> AccessKeys --- +### is_valid_access_key + +Checks if a principal is a non-expired access key regardless of scope (admin, write, or submit). + +```rust +pub fn is_valid_access_key( + id: Principal, + access_keys: &AccessKeys, +) -> bool +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_valid_access_key.html) + +--- + +### is_write_access_key + +Checks if a principal is a non-expired access key with admin or write scope. + +```rust +pub fn is_write_access_key( + id: Principal, + access_keys: &AccessKeys, +) -> bool +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_write_access_key.html) + +--- + +### is_admin_controller + +Checks if a principal is an admin access key and a controller known by the Internet Computer. + +```rust +pub fn is_admin_controller( + id: Principal, + access_keys: &AccessKeys, +) -> bool +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_admin_controller.html) + +--- + ## Guards The following guard functions can be used to validate the caller in your custom serverless functions. From 687fe41478ff89c86203e3b94e864b65434bc048 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:18:45 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index cb456009..85751053 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -12171,6 +12171,42 @@ pub fn get_admin_access_keys() -> AccessKeys --- +### is\_valid\_access\_key + +Checks if a principal is a non-expired access key regardless of scope (admin, write, or submit). + +``` +pub fn is_valid_access_key( id: Principal, access_keys: &AccessKeys,) -> bool +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_valid_access_key.html) + +--- + +### is\_write\_access\_key + +Checks if a principal is a non-expired access key with admin or write scope. + +``` +pub fn is_write_access_key( id: Principal, access_keys: &AccessKeys,) -> bool +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_write_access_key.html) + +--- + +### is\_admin\_controller + +Checks if a principal is an admin access key and a controller known by the Internet Computer. + +``` +pub fn is_admin_controller( id: Principal, access_keys: &AccessKeys,) -> bool +``` + +📦 See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_admin_controller.html) + +--- + ## Guards The following guard functions can be used to validate the caller in your custom serverless functions.