Skip to content

Commit

Permalink
Update iotedge tool for prefer_module_identity_cache (#7085) (#7108)
Browse files Browse the repository at this point in the history
Update the iotedge tool for the new option introduced in Azure/iot-identity-service#543
  • Loading branch information
gordonwang0 authored Sep 14, 2023
1 parent 1a1d65b commit 9c7dbdd
Show file tree
Hide file tree
Showing 46 changed files with 86 additions and 26 deletions.
52 changes: 26 additions & 26 deletions edgelet/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions edgelet/contrib/config/linux/template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@
#
# allow_elevated_docker_permissions = false

# ==============================================================================
# Module identity cache preference
# ==============================================================================
#
# The default behavior is to request module identities from IoT Hub and fall back to a
# cached backup if the Hub request fails. This keeps identities in sync with IoT Hub,
# but results in extra requests to Hub that may not be necessary depending on use case.
#
# Setting prefer_module_identity_cache to true reverses the behavior so that the cached
# identities are preferred to IoT Hub requests. Requests to Hub are still made if identities
# are not found in the cache.
#
# prefer_module_identity_cache = false

# ==============================================================================
# Provisioning
# ==============================================================================
Expand Down
2 changes: 2 additions & 0 deletions edgelet/iotedge/src/config/import/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ fn execute_inner(

aziot_max_requests: Default::default(),

prefer_module_identity_cache: Default::default(),

aziot_keys: Default::default(),

preloaded_keys: Default::default(),
Expand Down
2 changes: 2 additions & 0 deletions edgelet/iotedge/src/config/mp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ To reconfigure IoT Edge, run:

aziot_max_requests: Default::default(),

prefer_module_identity_cache: Default::default(),

aziot_keys: Default::default(),

preloaded_keys: Default::default(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "manual"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "manual"
Expand Down
1 change: 1 addition & 0 deletions edgelet/iotedge/test-files/config/ca-certs/identityd.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "manual"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
trust_bundle_cert = "file:///var/secrets/trusted-ca.pem"
auto_reprovisioning_mode = "OnErrorOnly"
hostname = "my-device"
prefer_module_identity_cache = false

[provisioning]
source = "manual"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "manual"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "manual"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
auto_reprovisioning_mode = "OnErrorOnly"
hostname = "my-device"
prefer_module_identity_cache = false

[provisioning]
source = "manual"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "manual"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
auto_reprovisioning_mode = "OnErrorOnly"
hostname = "my-device"
prefer_module_identity_cache = false

[provisioning]
source = "manual"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "dps"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
auto_reprovisioning_mode = "OnErrorOnly"
hostname = "my-device"
prefer_module_identity_cache = false

[provisioning]
source = "dps"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "dps"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
auto_reprovisioning_mode = "Dynamic"
hostname = "my-device"
prefer_module_identity_cache = false

[provisioning]
source = "dps"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "dps"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
auto_reprovisioning_mode = "Dynamic"
hostname = "my-device"
prefer_module_identity_cache = false

[provisioning]
source = "dps"
Expand Down
1 change: 1 addition & 0 deletions edgelet/iotedge/test-files/config/dps-tpm/identityd.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

hostname = "my-device"
homedir = "/var/lib/aziot/identityd"
prefer_module_identity_cache = false

[provisioning]
source = "dps"
Expand Down
Loading

0 comments on commit 9c7dbdd

Please sign in to comment.