From 587d8e00bcd43d6aef0b7b61b1bd7cd4fc78e5c3 Mon Sep 17 00:00:00 2001 From: John Plevyak Date: Mon, 14 Mar 2022 10:38:06 -0700 Subject: [PATCH 1/7] Add support for arbitrary user properites to the state tree and canister settings. Signed-off-by: John Plevyak --- spec/index.adoc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spec/index.adoc b/spec/index.adoc index 883934469..708d7aa4d 100644 --- a/spec/index.adoc +++ b/spec/index.adoc @@ -420,7 +420,7 @@ The certified data of the canister with the given id, see </module_hash` (blob): + @@ -438,6 +438,13 @@ If the canister has a https://webassembly.github.io/spec/core/binary/modules.htm + It is recommended for the canister to have a custom section called "icp:public candid:service", which contains the UTF-8 encoding of https://github.com/dfinity/candid/blob/master/spec/Candid.md#core-grammar[the Candid interface] for the canister. +* `/canister//property/` (blob): ++ +Users can set arbitrary canister properties via settings, see <> and <>. The (blob) is optional. There is a maximum combined size limit for all properties of 4KB. Properties may be used to enable or disable system features, e.g.: +* disable_ic0_app_service_worker +* allow_internet_identity_aliases where (blob) is a comma separated of canister ids and/or domains. + + [#http-interface] == HTTPS Interface @@ -1560,6 +1567,12 @@ Calls to a frozen canister will be rejected (like for a stopping canister). Addi + Default value: 2592000 (approximately 30 days). +* `properties` (`vec record { name: text; value: opt blob; }`) ++ +A set of arbitrary named properties with optional blob values. The total size of the properties must be less than 4KB. ++ +Default value: The empty list. + [#ic-update_settings] === IC method `update_settings` From 71fd4bc2e757fdf6c9782d83eafeca984286ff91 Mon Sep 17 00:00:00 2001 From: John Plevyak Date: Mon, 14 Mar 2022 10:38:06 -0700 Subject: [PATCH 2/7] Add support for canister properties to the state tree and canister settings. Signed-off-by: John Plevyak --- spec/index.adoc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spec/index.adoc b/spec/index.adoc index 883934469..708d7aa4d 100644 --- a/spec/index.adoc +++ b/spec/index.adoc @@ -420,7 +420,7 @@ The certified data of the canister with the given id, see </module_hash` (blob): + @@ -438,6 +438,13 @@ If the canister has a https://webassembly.github.io/spec/core/binary/modules.htm + It is recommended for the canister to have a custom section called "icp:public candid:service", which contains the UTF-8 encoding of https://github.com/dfinity/candid/blob/master/spec/Candid.md#core-grammar[the Candid interface] for the canister. +* `/canister//property/` (blob): ++ +Users can set arbitrary canister properties via settings, see <> and <>. The (blob) is optional. There is a maximum combined size limit for all properties of 4KB. Properties may be used to enable or disable system features, e.g.: +* disable_ic0_app_service_worker +* allow_internet_identity_aliases where (blob) is a comma separated of canister ids and/or domains. + + [#http-interface] == HTTPS Interface @@ -1560,6 +1567,12 @@ Calls to a frozen canister will be rejected (like for a stopping canister). Addi + Default value: 2592000 (approximately 30 days). +* `properties` (`vec record { name: text; value: opt blob; }`) ++ +A set of arbitrary named properties with optional blob values. The total size of the properties must be less than 4KB. ++ +Default value: The empty list. + [#ic-update_settings] === IC method `update_settings` From ffd2d8c3277cb8c112da7b30af7bf8fb84d75cf6 Mon Sep 17 00:00:00 2001 From: John Plevyak Date: Mon, 14 Mar 2022 12:03:59 -0700 Subject: [PATCH 3/7] Update spec/index.adoc Co-authored-by: Joachim Breitner --- spec/index.adoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/index.adoc b/spec/index.adoc index 708d7aa4d..cb9990d00 100644 --- a/spec/index.adoc +++ b/spec/index.adoc @@ -440,7 +440,11 @@ It is recommended for the canister to have a custom section called "icp:public c * `/canister//property/` (blob): + -Users can set arbitrary canister properties via settings, see <> and <>. The (blob) is optional. There is a maximum combined size limit for all properties of 4KB. Properties may be used to enable or disable system features, e.g.: +The systems maintains for each canister a generic key-value store, called the “Canister properties”. The system does not interpret these keys and values, but other platform components (e.g. the HTTP gateway protocol or Internet Identity) can. + +The system may impose a size limit on the properties; it allows at least 4KB of combined size of the keys keys and values. Values can be empty. + +These properties are configured and kept independently from installing or uninstalling code. * disable_ic0_app_service_worker * allow_internet_identity_aliases where (blob) is a comma separated of canister ids and/or domains. From 265551d30d5dd1cd999a79aa06d1c689bfc99338 Mon Sep 17 00:00:00 2001 From: John Plevyak Date: Mon, 14 Mar 2022 12:07:39 -0700 Subject: [PATCH 4/7] Update spec/index.adoc Co-authored-by: Joachim Breitner --- spec/index.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/index.adoc b/spec/index.adoc index cb9990d00..14ec3f820 100644 --- a/spec/index.adoc +++ b/spec/index.adoc @@ -1571,9 +1571,9 @@ Calls to a frozen canister will be rejected (like for a stopping canister). Addi + Default value: 2592000 (approximately 30 days). -* `properties` (`vec record { name: text; value: opt blob; }`) +* `properties` (`vec record { name: text; value: blob; }`) + -A set of arbitrary named properties with optional blob values. The total size of the properties must be less than 4KB. +A set of arbitrary named properties with arbitrary values. The names in the list must be free of duplicates. See `_state-tree-canister-information`. + Default value: The empty list. From f506393b098e69a32968a121d5417aa360bec281 Mon Sep 17 00:00:00 2001 From: John Plevyak Date: Mon, 14 Mar 2022 12:22:38 -0700 Subject: [PATCH 5/7] Update WRT comments: clarify roles of canister adminstorator vs canister developer. Signed-off-by: John Plevyak --- spec/index.adoc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/index.adoc b/spec/index.adoc index 14ec3f820..64bb8d348 100644 --- a/spec/index.adoc +++ b/spec/index.adoc @@ -440,13 +440,11 @@ It is recommended for the canister to have a custom section called "icp:public c * `/canister//property/` (blob): + -The systems maintains for each canister a generic key-value store, called the “Canister properties”. The system does not interpret these keys and values, but other platform components (e.g. the HTTP gateway protocol or Internet Identity) can. +The systems maintains for each canister a generic key-value store, called the “canister properties”. These properties are provided by canister aministrators and while the system does not interpret them other platform components (e.g. the HTTP gateway protocol or Internet Identity) may. In contrast, metadata is provided by canister developers and may be interpreted by the system. The system may impose a size limit on the properties; it allows at least 4KB of combined size of the keys keys and values. Values can be empty. These properties are configured and kept independently from installing or uninstalling code. -* disable_ic0_app_service_worker -* allow_internet_identity_aliases where (blob) is a comma separated of canister ids and/or domains. [#http-interface] From 203a4e207758fea89d5ae4eb8c645aa8ba4d0254 Mon Sep 17 00:00:00 2001 From: John Plevyak Date: Mon, 14 Mar 2022 12:28:24 -0700 Subject: [PATCH 6/7] Fix typo. Signed-off-by: John Plevyak --- spec/index.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/index.adoc b/spec/index.adoc index 64bb8d348..c3e8ecf62 100644 --- a/spec/index.adoc +++ b/spec/index.adoc @@ -440,7 +440,7 @@ It is recommended for the canister to have a custom section called "icp:public c * `/canister//property/` (blob): + -The systems maintains for each canister a generic key-value store, called the “canister properties”. These properties are provided by canister aministrators and while the system does not interpret them other platform components (e.g. the HTTP gateway protocol or Internet Identity) may. In contrast, metadata is provided by canister developers and may be interpreted by the system. +The system maintains for each canister list of key-value pairs, called “canister properties” controlled by canister aministrators and while the system does not interpret them other platform components (e.g. the HTTP gateway protocol or Internet Identity) may. In contrast, metadata is provided by canister developers and may be interpreted by the system. The system may impose a size limit on the properties; it allows at least 4KB of combined size of the keys keys and values. Values can be empty. From 6fd0005f05a249209c2bcba0837aa313a7f81291 Mon Sep 17 00:00:00 2001 From: John Plevyak Date: Mon, 14 Mar 2022 16:41:17 -0700 Subject: [PATCH 7/7] Shorten. Signed-off-by: John Plevyak --- spec/index.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/index.adoc b/spec/index.adoc index c3e8ecf62..7c8c5845e 100644 --- a/spec/index.adoc +++ b/spec/index.adoc @@ -440,7 +440,7 @@ It is recommended for the canister to have a custom section called "icp:public c * `/canister//property/` (blob): + -The system maintains for each canister list of key-value pairs, called “canister properties” controlled by canister aministrators and while the system does not interpret them other platform components (e.g. the HTTP gateway protocol or Internet Identity) may. In contrast, metadata is provided by canister developers and may be interpreted by the system. +Canister administrators may set and update a list of named canister setting properties. The system may impose a size limit on the properties; it allows at least 4KB of combined size of the keys keys and values. Values can be empty.