From 422c052ed64c1bbd0471da006e5fe7f706993109 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 20 Mar 2026 08:41:30 +0100 Subject: [PATCH 1/4] docs: access keys and guards references in typescript Signed-off-by: David Dal Busco --- docs/reference/functions/typescript/sdk.mdx | 112 ++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/docs/reference/functions/typescript/sdk.mdx b/docs/reference/functions/typescript/sdk.mdx index a53ecc60..240b1993 100644 --- a/docs/reference/functions/typescript/sdk.mdx +++ b/docs/reference/functions/typescript/sdk.mdx @@ -541,3 +541,115 @@ function getContentChunksStore( - `ZodError` if the input schema is invalid. - `Error` if the operation fails. + +--- + +## Access Keys + +The following functions allow you to inspect and assert the access keys of your Satellite. + +--- + +### getAccessKeys + +Retrieves all access keys of the Satellite. + +```typescript +function getAccessKeys(): AccessKeys; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +- `AccessKeys`: The list of all access keys. + +#### Throws: + +- `ZodError` if the returned value does not match the expected schema. + +--- + +### getAdminAccessKeys + +Retrieves only the admin access keys of the Satellite. + +```typescript +function getAdminAccessKeys(): AccessKeys; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +- `AccessKeys`: The list of admin access keys. + +#### Throws: + +- `ZodError` if the returned value does not match the expected schema. + +--- + +## Guards + +The following guard functions can be used to validate the caller in your custom serverless functions. + +--- + +### callerIsAdmin + +Guards that the caller is an admin access key of this satellite. Admin access keys have full management privileges and never expire. + +```typescript +function callerIsAdmin(): void; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +- `void` + +#### Throws: + +- `ZodError` if the caller is not an admin access key. + +--- + +### callerHasWritePermission + +Guards that the caller has write permission. Admin and editor access keys pass; submitter access keys do not. + +```typescript +function callerHasWritePermission(): void; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +- `void` + +#### Throws: + +- `ZodError` if the caller does not have write permission. + +--- + +### callerIsAccessKey + +Guards that the caller is any recognized access key of this satellite. Accepts admin, editor, and submitter access keys alike. + +```typescript +function callerIsAccessKey(): void; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +- `void` + +#### Throws: + +- `ZodError` if the caller is not a recognized access key. From b3cd1b0f05bd2dc1b4fc15db806fb02c7816a859 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 07:43:12 +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 | 112 ++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index fc06c1e4..6fe5534e 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -13290,6 +13290,118 @@ function getContentChunksStore( params: GetContentChunksStoreParams): Blob | un * `ZodError` if the input schema is invalid. * `Error` if the operation fails. +--- + +## Access Keys + +The following functions allow you to inspect and assert the access keys of your Satellite. + +--- + +### getAccessKeys + +Retrieves all access keys of the Satellite. + +``` +function getAccessKeys(): AccessKeys; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +* `AccessKeys`: The list of all access keys. + +#### Throws: + +* `ZodError` if the returned value does not match the expected schema. + +--- + +### getAdminAccessKeys + +Retrieves only the admin access keys of the Satellite. + +``` +function getAdminAccessKeys(): AccessKeys; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +* `AccessKeys`: The list of admin access keys. + +#### Throws: + +* `ZodError` if the returned value does not match the expected schema. + +--- + +## Guards + +The following guard functions can be used to validate the caller in your custom serverless functions. + +--- + +### callerIsAdmin + +Guards that the caller is an admin access key of this satellite. Admin access keys have full management privileges and never expire. + +``` +function callerIsAdmin(): void; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +* `void` + +#### Throws: + +* `ZodError` if the caller is not an admin access key. + +--- + +### callerHasWritePermission + +Guards that the caller has write permission. Admin and editor access keys pass; submitter access keys do not. + +``` +function callerHasWritePermission(): void; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +* `void` + +#### Throws: + +* `ZodError` if the caller does not have write permission. + +--- + +### callerIsAccessKey + +Guards that the caller is any recognized access key of this satellite. Accepts admin, editor, and submitter access keys alike. + +``` +function callerIsAccessKey(): void; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Returns: + +* `void` + +#### Throws: + +* `ZodError` if the caller is not a recognized access key. + # Utils The following utilities are provided to help you work with document and asset data inside your Satellite. They simplify tasks such as decoding and encoding data, serializing custom types, and interacting with Juno’s core features in a consistent way. From bca01bd89717b63cc757716ff4c84e126e2c592b Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 20 Mar 2026 19:18:54 +0100 Subject: [PATCH 3/4] docs: access keys fn Signed-off-by: David Dal Busco --- docs/reference/functions/typescript/sdk.mdx | 78 +++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/docs/reference/functions/typescript/sdk.mdx b/docs/reference/functions/typescript/sdk.mdx index 240b1993..ef6b26bb 100644 --- a/docs/reference/functions/typescript/sdk.mdx +++ b/docs/reference/functions/typescript/sdk.mdx @@ -590,6 +590,84 @@ function getAdminAccessKeys(): AccessKeys; --- +### isWriteAccessKey + +Checks if the given id is a non-expired access key with admin or write scope. + +```typescript +function isWriteAccessKey(params: AccessKeyCheckParams): boolean; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Parameters: + +- `params`: An object containing: +- `id`: The principal to check (`RawUserId` or `UserId`). +- `accessKeys`: The list of access keys to verify against. + +#### Returns: + +- `boolean`: Whether the id is an access key with write permission. + +#### Throws: + +- `ZodError` if any input does not match the expected schema. + +--- + +### isValidAccessKey + +Checks if the given id is a non-expired access key regardless of scope (admin, write, or submit). + +```typescript +function isValidAccessKey(params: AccessKeyCheckParams): boolean; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Parameters: + +- `params`: An object containing: +- `id`: The principal to check (`RawUserId` or `UserId`). +- `accessKeys`: The list of access keys to verify against. + +#### Returns: + +- `boolean`: Whether the id is a recognized access key. + +#### Throws: + +- `ZodError` if any input does not match the expected schema. + +--- + +### isAdminController + +Checks if the given id is an admin access key and a controller known by the Internet Computer. + +```typescript +function isAdminController(params: AccessKeyCheckParams): boolean; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Parameters: + +- `params`: An object containing: +- `id`: The principal to check (`RawUserId` or `UserId`). +- `accessKeys`: The list of access keys to verify against. + +#### Returns: + +- `boolean`: Whether the id is an admin and a controller of the Satellite. + +#### Throws: + +- `ZodError` if any input does not match the expected schema. + +--- + ## Guards The following guard functions can be used to validate the caller in your custom serverless functions. From 4c66af2e699b3cbfa950cbbe0b74caf26eaa2126 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:20:34 +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 | 78 +++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index 6fe5534e..d5de5d12 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -13338,6 +13338,84 @@ function getAdminAccessKeys(): AccessKeys; --- +### isWriteAccessKey + +Checks if the given id is a non-expired access key with admin or write scope. + +``` +function isWriteAccessKey(params: AccessKeyCheckParams): boolean; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Parameters: + +* `params`: An object containing: +* `id`: The principal to check (`RawUserId` or `UserId`). +* `accessKeys`: The list of access keys to verify against. + +#### Returns: + +* `boolean`: Whether the id is an access key with write permission. + +#### Throws: + +* `ZodError` if any input does not match the expected schema. + +--- + +### isValidAccessKey + +Checks if the given id is a non-expired access key regardless of scope (admin, write, or submit). + +``` +function isValidAccessKey(params: AccessKeyCheckParams): boolean; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Parameters: + +* `params`: An object containing: +* `id`: The principal to check (`RawUserId` or `UserId`). +* `accessKeys`: The list of access keys to verify against. + +#### Returns: + +* `boolean`: Whether the id is a recognized access key. + +#### Throws: + +* `ZodError` if any input does not match the expected schema. + +--- + +### isAdminController + +Checks if the given id is an admin access key and a controller known by the Internet Computer. + +``` +function isAdminController(params: AccessKeyCheckParams): boolean; +``` + +📦 Import from `@junobuild/functions/sdk` + +#### Parameters: + +* `params`: An object containing: +* `id`: The principal to check (`RawUserId` or `UserId`). +* `accessKeys`: The list of access keys to verify against. + +#### Returns: + +* `boolean`: Whether the id is an admin and a controller of the Satellite. + +#### Throws: + +* `ZodError` if any input does not match the expected schema. + +--- + ## Guards The following guard functions can be used to validate the caller in your custom serverless functions.