Skip to content

Commit df67b94

Browse files
docs: access keys and guards references in rust (#674)
* docs: access keys and guards references in rust Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> * πŸ“„ Update LLMs.txt snapshot for PR review * docs: access keys fn Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> * πŸ“„ Update LLMs.txt snapshot for PR review * πŸ“„ Update LLMs.txt snapshot for PR review --------- Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e1ec414 commit df67b94

2 files changed

Lines changed: 215 additions & 50 deletions

File tree

β€Ž.llms-snapshots/llms-full.txtβ€Ž

Lines changed: 118 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10042,36 +10042,36 @@ For most applications, we recommend using the default subnets and staying on the
1004210042

1004310043
| Subnet ID | Type | Canisters (Running/Stopped) | Nodes (Up/Total) |
1004410044
| --- | --- | --- | --- |
10045-
| 6pbhf-qzpdk-kuqbr-pklfa-5ehhf-jfjps-zsj6q-57nrl-kzhpd-mu7hc-vae | Juno's Subnet | 36185/704 | 13/13 |
10046-
| pzp6e-ekpqk-3c5x7-2h6so-njoeq-mt45d-h3h6c-q3mxf-vpeq5-fk5o7-yae | Fiduciary | 3564/12 | 34/34 |
10047-
| bkfrj-6k62g-dycql-7h53p-atvkj-zg4to-gaogh-netha-ptybj-ntsgw-rqe | European | 25096/663 | 13/13 |
10048-
| brlsh-zidhj-3yy3e-6vqbz-7xnih-xeq2l-as5oc-g32c4-i5pdn-2wwof-oae | | 35432/815 | 13/13 |
10049-
| o3ow2-2ipam-6fcjo-3j5vt-fzbge-2g7my-5fz2m-p4o2t-dwlc4-gt2q7-5ae | | 57571/170 | 13/13 |
10050-
| 4ecnw-byqwz-dtgss-ua2mh-pfvs7-c3lct-gtf4e-hnu75-j7eek-iifqm-sqe | | 8684/303 | 13/13 |
10051-
| opn46-zyspe-hhmyp-4zu6u-7sbrh-dok77-m7dch-im62f-vyimr-a3n2c-4ae | | 40491/835 | 13/13 |
10052-
| nl6hn-ja4yw-wvmpy-3z2jx-ymc34-pisx3-3cp5z-3oj4a-qzzny-jbsv3-4qe | | 32293/818 | 13/13 |
10053-
| io67a-2jmkw-zup3h-snbwi-g6a5n-rm5dn-b6png-lvdpl-nqnto-yih6l-gqe | | 2997/2528 | 13/13 |
10054-
| ejbmu-grnam-gk6ol-6irwa-htwoj-7ihfl-goimw-hlnvh-abms4-47v2e-zqe | | 12068/111 | 13/13 |
10055-
| gmq5v-hbozq-uui6y-o55wc-ihop3-562wb-3qspg-nnijg-npqp5-he3cj-3ae | | 34558/256 | 13/13 |
10056-
| pjljw-kztyl-46ud4-ofrj6-nzkhm-3n4nt-wi3jt-ypmav-ijqkt-gjf66-uae | | 32743/243 | 12/13 |
10057-
| 4zbus-z2bmt-ilreg-xakz4-6tyre-hsqj4-slb4g-zjwqo-snjcc-iqphi-3qe | | 59568/87 | 13/13 |
10058-
| 5kdm2-62fc6-fwnja-hutkz-ycsnm-4z33i-woh43-4cenu-ev7mi-gii6t-4ae | | 13234/154 | 13/13 |
10059-
| e66qm-3cydn-nkf4i-ml4rb-4ro6o-srm5s-x5hwq-hnprz-3meqp-s7vks-5qe | | 35861/769 | 13/13 |
10060-
| qdvhd-os4o2-zzrdw-xrcv4-gljou-eztdp-bj326-e6jgr-tkhuc-ql6v2-yqe | | 53577/125 | 13/13 |
10061-
| snjp4-xlbw4-mnbog-ddwy6-6ckfd-2w5a2-eipqo-7l436-pxqkh-l6fuv-vae | | 4277/1511 | 13/13 |
10062-
| shefu-t3kr5-t5q3w-mqmdq-jabyv-vyvtf-cyyey-3kmo4-toyln-emubw-4qe | | 3004/2624 | 13/13 |
10063-
| csyj4-zmann-ys6ge-3kzi6-onexi-obayx-2fvak-zersm-euci4-6pslt-lae | | 3682/1812 | 13/13 |
10064-
| yinp6-35cfo-wgcd2-oc4ty-2kqpf-t4dul-rfk33-fsq3r-mfmua-m2ngh-jqe | | 8457/582 | 13/13 |
10065-
| w4asl-4nmyj-qnr7c-6cqq4-tkwmt-o26di-iupkq-vx4kt-asbrx-jzuxh-4ae | | 3151/2468 | 12/13 |
10066-
| c4isl-65rwf-emhk5-5ta5m-ngl73-rgrl3-tcc56-2hkja-4erqd-iivmy-7ae | | 1700/4011 | 13/13 |
10067-
| mpubz-g52jc-grhjo-5oze5-qcj74-sex34-omprz-ivnsm-qvvhr-rfzpv-vae | | 55938/327 | 12/13 |
10068-
| fuqsr-in2lc-zbcjj-ydmcw-pzq7h-4xm2z-pto4i-dcyee-5z4rz-x63ji-nae | | 22380/117 | 13/13 |
10069-
| cv73p-6v7zi-u67oy-7jc3h-qspsz-g5lrj-4fn7k-xrax3-thek2-sl46v-jae | | 51889/339 | 13/13 |
10070-
| pae4o-o6dxf-xki7q-ezclx-znyd6-fnk6w-vkv5z-5lfwh-xym2i-otrrw-fqe | | 5134/630 | 13/13 |
10071-
| qxesv-zoxpm-vc64m-zxguk-5sj74-35vrb-tbgwg-pcird-5gr26-62oxl-cae | | 2531/3146 | 13/13 |
10072-
| 4utr6-xo2fz-v7fsb-t3wsg-k7sfl-cj2ba-ghdnd-kcrfo-xavdb-ebean-mqe | | 2756/3071 | 13/13 |
10073-
| lspz2-jx4pu-k3e7p-znm7j-q4yum-ork6e-6w4q6-pijwq-znehu-4jabe-kqe | | 40004/944 | 13/13 |
10074-
| jtdsg-3h6gi-hs7o5-z2soi-43w3z-soyl3-ajnp3-ekni5-sw553-5kw67-nqe | | 27813/206 | 13/13 |
10045+
| 6pbhf-qzpdk-kuqbr-pklfa-5ehhf-jfjps-zsj6q-57nrl-kzhpd-mu7hc-vae | Juno's Subnet | 36239/705 | 13/13 |
10046+
| pzp6e-ekpqk-3c5x7-2h6so-njoeq-mt45d-h3h6c-q3mxf-vpeq5-fk5o7-yae | Fiduciary | 3784/51 | 34/34 |
10047+
| bkfrj-6k62g-dycql-7h53p-atvkj-zg4to-gaogh-netha-ptybj-ntsgw-rqe | European | 25195/718 | 13/13 |
10048+
| brlsh-zidhj-3yy3e-6vqbz-7xnih-xeq2l-as5oc-g32c4-i5pdn-2wwof-oae | | 40631/3105 | 13/13 |
10049+
| o3ow2-2ipam-6fcjo-3j5vt-fzbge-2g7my-5fz2m-p4o2t-dwlc4-gt2q7-5ae | | 62897/2621 | 13/13 |
10050+
| 4ecnw-byqwz-dtgss-ua2mh-pfvs7-c3lct-gtf4e-hnu75-j7eek-iifqm-sqe | | 14032/2669 | 13/13 |
10051+
| opn46-zyspe-hhmyp-4zu6u-7sbrh-dok77-m7dch-im62f-vyimr-a3n2c-4ae | | 45968/3193 | 13/13 |
10052+
| nl6hn-ja4yw-wvmpy-3z2jx-ymc34-pisx3-3cp5z-3oj4a-qzzny-jbsv3-4qe | | 37244/3167 | 13/13 |
10053+
| io67a-2jmkw-zup3h-snbwi-g6a5n-rm5dn-b6png-lvdpl-nqnto-yih6l-gqe | | 8400/4104 | 13/13 |
10054+
| ejbmu-grnam-gk6ol-6irwa-htwoj-7ihfl-goimw-hlnvh-abms4-47v2e-zqe | | 16891/2458 | 13/13 |
10055+
| gmq5v-hbozq-uui6y-o55wc-ihop3-562wb-3qspg-nnijg-npqp5-he3cj-3ae | | 39707/2520 | 13/13 |
10056+
| pjljw-kztyl-46ud4-ofrj6-nzkhm-3n4nt-wi3jt-ypmav-ijqkt-gjf66-uae | | 38043/2604 | 13/13 |
10057+
| 4zbus-z2bmt-ilreg-xakz4-6tyre-hsqj4-slb4g-zjwqo-snjcc-iqphi-3qe | | 71502/2364 | 13/13 |
10058+
| 5kdm2-62fc6-fwnja-hutkz-ycsnm-4z33i-woh43-4cenu-ev7mi-gii6t-4ae | | 18638/2404 | 13/13 |
10059+
| e66qm-3cydn-nkf4i-ml4rb-4ro6o-srm5s-x5hwq-hnprz-3meqp-s7vks-5qe | | 41166/3138 | 13/13 |
10060+
| qdvhd-os4o2-zzrdw-xrcv4-gljou-eztdp-bj326-e6jgr-tkhuc-ql6v2-yqe | | 58789/2366 | 13/13 |
10061+
| snjp4-xlbw4-mnbog-ddwy6-6ckfd-2w5a2-eipqo-7l436-pxqkh-l6fuv-vae | | 9861/3288 | 13/13 |
10062+
| shefu-t3kr5-t5q3w-mqmdq-jabyv-vyvtf-cyyey-3kmo4-toyln-emubw-4qe | | 8360/4158 | 12/13 |
10063+
| csyj4-zmann-ys6ge-3kzi6-onexi-obayx-2fvak-zersm-euci4-6pslt-lae | | 9121/3452 | 13/13 |
10064+
| yinp6-35cfo-wgcd2-oc4ty-2kqpf-t4dul-rfk33-fsq3r-mfmua-m2ngh-jqe | | 13861/2699 | 13/13 |
10065+
| w4asl-4nmyj-qnr7c-6cqq4-tkwmt-o26di-iupkq-vx4kt-asbrx-jzuxh-4ae | | 8465/4153 | 13/13 |
10066+
| c4isl-65rwf-emhk5-5ta5m-ngl73-rgrl3-tcc56-2hkja-4erqd-iivmy-7ae | | 6975/5761 | 13/13 |
10067+
| mpubz-g52jc-grhjo-5oze5-qcj74-sex34-omprz-ivnsm-qvvhr-rfzpv-vae | | 61396/2580 | 13/13 |
10068+
| fuqsr-in2lc-zbcjj-ydmcw-pzq7h-4xm2z-pto4i-dcyee-5z4rz-x63ji-nae | | 28775/2439 | 13/13 |
10069+
| cv73p-6v7zi-u67oy-7jc3h-qspsz-g5lrj-4fn7k-xrax3-thek2-sl46v-jae | | 57106/2558 | 13/13 |
10070+
| pae4o-o6dxf-xki7q-ezclx-znyd6-fnk6w-vkv5z-5lfwh-xym2i-otrrw-fqe | | 10337/2862 | 13/13 |
10071+
| qxesv-zoxpm-vc64m-zxguk-5sj74-35vrb-tbgwg-pcird-5gr26-62oxl-cae | | 8043/4678 | 13/13 |
10072+
| 4utr6-xo2fz-v7fsb-t3wsg-k7sfl-cj2ba-ghdnd-kcrfo-xavdb-ebean-mqe | | 7823/4812 | 13/13 |
10073+
| lspz2-jx4pu-k3e7p-znm7j-q4yum-ork6e-6w4q6-pijwq-znehu-4jabe-kqe | | 45637/3300 | 13/13 |
10074+
| jtdsg-3h6gi-hs7o5-z2soi-43w3z-soyl3-ajnp3-ekni5-sw553-5kw67-nqe | | 33152/2504 | 13/13 |
1007510075

1007610076
# Wallet
1007710077

@@ -12141,33 +12141,111 @@ pub fn get_content_chunks_store( encoding: &AssetEncoding, chunk_index: us
1214112141

1214212142
---
1214312143

12144-
## Controllers
12144+
## Access Keys
1214512145

12146-
The following functions allow you to inspect and assert the controllers of your Satellite.
12146+
The following functions allow you to inspect and assert the access keys of your Satellite.
1214712147

1214812148
---
1214912149

12150-
### get\_controllers
12150+
### get\_access\_keys
1215112151

12152-
Retrieves all controllers of the Satellite.
12152+
Retrieves all access keys of the Satellite.
1215312153

1215412154
```
12155-
pub fn get_controllers() -> Controllers
12155+
pub fn get_access_keys() -> AccessKeys
1215612156
```
1215712157

12158-
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_controllers.html)
12158+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_access_keys.html)
1215912159

1216012160
---
1216112161

12162-
### get\_admin\_controllers
12162+
### get\_admin\_access\_keys
1216312163

12164-
Retrieves only the admin controllers of the Satellite.
12164+
Retrieves only the admin access\_keys of the Satellite.
1216512165

1216612166
```
12167-
pub fn get_admin_controllers() -> Controllers
12167+
pub fn get_admin_access_keys() -> AccessKeys
1216812168
```
1216912169

12170-
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_admin_controllers.html)
12170+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_admin_access_keys.html)
12171+
12172+
---
12173+
12174+
### is\_valid\_access\_key
12175+
12176+
Checks if a principal is a non-expired access key regardless of scope (admin, write, or submit).
12177+
12178+
```
12179+
pub fn is_valid_access_key( id: Principal, access_keys: &AccessKeys,) -> bool
12180+
```
12181+
12182+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_valid_access_key.html)
12183+
12184+
---
12185+
12186+
### is\_write\_access\_key
12187+
12188+
Checks if a principal is a non-expired access key with admin or write scope.
12189+
12190+
```
12191+
pub fn is_write_access_key( id: Principal, access_keys: &AccessKeys,) -> bool
12192+
```
12193+
12194+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_write_access_key.html)
12195+
12196+
---
12197+
12198+
### is\_admin\_controller
12199+
12200+
Checks if a principal is an admin access key and a controller known by the Internet Computer.
12201+
12202+
```
12203+
pub fn is_admin_controller( id: Principal, access_keys: &AccessKeys,) -> bool
12204+
```
12205+
12206+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_admin_controller.html)
12207+
12208+
---
12209+
12210+
## Guards
12211+
12212+
The following guard functions can be used to validate the caller in your custom serverless functions.
12213+
12214+
---
12215+
12216+
### caller\_is\_admin
12217+
12218+
Guards that the caller is an admin access key of this satellite. Admin access keys have full management privileges and never expire.
12219+
12220+
```
12221+
pub fn caller_is_admin() -> Result<(), String>
12222+
```
12223+
12224+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_is_admin.html)
12225+
12226+
---
12227+
12228+
### caller\_has\_write\_permission
12229+
12230+
Guards that the caller has write permission. Admin and editor access keys pass; submitter access keys do not.
12231+
12232+
```
12233+
pub fn caller_has_write_permission() -> Result<(), String>
12234+
```
12235+
12236+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_has_write_permission.html)
12237+
12238+
---
12239+
12240+
### caller\_is\_access\_key
12241+
12242+
Guards that the caller is any recognized access key of this satellite. Accepts admin, editor, and submitter access keys alike.
12243+
12244+
```
12245+
pub fn caller_is_access_key() -> Result<(), String>
12246+
```
12247+
12248+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_is_access_key.html)
1217112249

1217212250
---
1217312251

β€Ždocs/reference/functions/rust/sdk.mdxβ€Ž

Lines changed: 97 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,33 +316,120 @@ pub fn get_content_chunks_store(
316316

317317
---
318318

319-
## Controllers
319+
## Access Keys
320320

321-
The following functions allow you to inspect and assert the controllers of your Satellite.
321+
The following functions allow you to inspect and assert the access keys of your Satellite.
322322

323323
---
324324

325-
### get_controllers
325+
### get_access_keys
326326

327-
Retrieves all controllers of the Satellite.
327+
Retrieves all access keys of the Satellite.
328328

329329
```rust
330-
pub fn get_controllers() -> Controllers
330+
pub fn get_access_keys() -> AccessKeys
331331
```
332332

333-
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_controllers.html)
333+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_access_keys.html)
334334

335335
---
336336

337-
### get_admin_controllers
337+
### get_admin_access_keys
338338

339-
Retrieves only the admin controllers of the Satellite.
339+
Retrieves only the admin access_keys of the Satellite.
340340

341341
```rust
342-
pub fn get_admin_controllers() -> Controllers
342+
pub fn get_admin_access_keys() -> AccessKeys
343343
```
344344

345-
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_admin_controllers.html)
345+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.get_admin_access_keys.html)
346+
347+
---
348+
349+
### is_valid_access_key
350+
351+
Checks if a principal is a non-expired access key regardless of scope (admin, write, or submit).
352+
353+
```rust
354+
pub fn is_valid_access_key(
355+
id: Principal,
356+
access_keys: &AccessKeys,
357+
) -> bool
358+
```
359+
360+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_valid_access_key.html)
361+
362+
---
363+
364+
### is_write_access_key
365+
366+
Checks if a principal is a non-expired access key with admin or write scope.
367+
368+
```rust
369+
pub fn is_write_access_key(
370+
id: Principal,
371+
access_keys: &AccessKeys,
372+
) -> bool
373+
```
374+
375+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_write_access_key.html)
376+
377+
---
378+
379+
### is_admin_controller
380+
381+
Checks if a principal is an admin access key and a controller known by the Internet Computer.
382+
383+
```rust
384+
pub fn is_admin_controller(
385+
id: Principal,
386+
access_keys: &AccessKeys,
387+
) -> bool
388+
```
389+
390+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.is_admin_controller.html)
391+
392+
---
393+
394+
## Guards
395+
396+
The following guard functions can be used to validate the caller in your custom serverless functions.
397+
398+
---
399+
400+
### caller_is_admin
401+
402+
Guards that the caller is an admin access key of this satellite. Admin access keys have full management privileges and never expire.
403+
404+
```rust
405+
pub fn caller_is_admin() -> Result<(), String>
406+
```
407+
408+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_is_admin.html)
409+
410+
---
411+
412+
### caller_has_write_permission
413+
414+
Guards that the caller has write permission. Admin and editor access keys pass; submitter access keys do not.
415+
416+
```rust
417+
pub fn caller_has_write_permission() -> Result<(), String>
418+
```
419+
420+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_has_write_permission.html)
421+
422+
---
423+
424+
### caller_is_access_key
425+
426+
Guards that the caller is any recognized access key of this satellite. Accepts admin, editor, and submitter access keys alike.
427+
428+
```rust
429+
pub fn caller_is_access_key() -> Result<(), String>
430+
```
431+
432+
πŸ“¦ See full definition on [docs.rs](https://docs.rs/junobuild-satellite/latest/junobuild_satellite/fn.caller_is_access_key.html)
346433

347434
---
348435

0 commit comments

Comments
Β (0)