Skip to content

Commit

Permalink
DPS updates (#251)
Browse files Browse the repository at this point in the history
* Regenerate 2019-03-31 DPS SDK
* Support --show-keys argument to add attestation information to enrollment/enrollment-group show results
* Simplified show/list registration ops to use raw result instead of model (removes extraneous null fields)
* Updated DPS unit tests to use new mocked_response pattern
* Integration test updates
* Removed DPS device operations SDK until commands are implemented
* Updated history and help files
* Help text for --show-keys command is now specific to symmetric-key enrollments and groups
* Added warning when --show-keys is used for non-symmetric-key enrollments or groups
* Attempt to link hub in DPS integration tests if not already linked.
  • Loading branch information
c-ryan-k authored Sep 11, 2020
1 parent 558bc31 commit cfdc6a8
Show file tree
Hide file tree
Showing 70 changed files with 3,741 additions and 1,845 deletions.
14 changes: 14 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
Release History
===============

0.10.0
+++++++++++++++

**Breaking Changes**

* `az iot dps enrollment show` and `az iot dps enrollment-group show` now return raw service results instead of deserialized models.
This means that some properties that were previously returned as `null` for these commands will no longer be returned, possibly causing a breaking change.

**IoT DPS updates**

* Added --show-keys argument to `dps enrollment show` and `dps enrollment-group show` to include full attestation information for symmetric key enrollments and enrollment groups
* Regenerated 2019-03-31 DPS Service SDK


0.9.9
+++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion azext_iot/_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def _get_pnp_runtime_sdk(self):
return IotHubGatewayServiceAPIs(credentials=credentials, base_url=self.endpoint)

def _get_dps_service_sdk(self):
from azext_iot.sdk.dps import ProvisioningServiceClient
from azext_iot.sdk.dps.service import ProvisioningServiceClient

credentials = SasTokenAuthentication(
uri=self.sas_uri,
Expand Down
14 changes: 14 additions & 0 deletions azext_iot/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,13 @@
] = """
type: command
short-summary: Get device enrollment details in an Azure IoT Hub Device Provisioning Service.
examples:
- name: Basic usage
text: >
az iot dps enrollment show --dps-name {dps_name} -g {resource_group} --enrollment-id {enrollment_id}
- name: Include full attestation information in results for a symmetric key enrollment
text: >
az iot dps enrollment show --dps-name {dps_name} -g {resource_group} --enrollment-id {symmetric_key_enrollment_id} --show-keys
"""

helps[
Expand Down Expand Up @@ -1133,6 +1140,13 @@
] = """
type: command
short-summary: Get the details of an enrollment group in an Azure IoT Hub Device Provisioning Service.
examples:
- name: Basic usage
text: >
az iot dps enrollment-group show --dps-name {dps_name} -g {resource_group} --enrollment-id {enrollment_id}
- name: Include full attestation information in results for a symmetric key enrollment-group
text: >
az iot dps enrollment-group show --dps-name {dps_name} -g {resource_group} --enrollment-id {symmetric_key_enrollment_id} --show-keys
"""

helps[
Expand Down
16 changes: 16 additions & 0 deletions azext_iot/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,14 @@ def load_arguments(self, _):
"When choosing tpm as attestation type, endorsement key is required.",
)

with self.argument_context("iot dps enrollment show") as context:
context.argument(
"show_keys",
options_list=["--show-keys", "--keys"],
arg_type=get_three_state_flag(),
help="Include attestation keys and information in enrollment results"
)

with self.argument_context("iot dps enrollment update") as context:
context.argument(
"endorsement_key",
Expand Down Expand Up @@ -905,6 +913,14 @@ def load_arguments(self, _):
"If attestation with a root CA certificate is desired then a root ca name must be provided.",
)

with self.argument_context("iot dps enrollment-group show") as context:
context.argument(
"show_keys",
options_list=["--show-keys", "--keys"],
arg_type=get_three_state_flag(),
help="Include attestation keys and information in enrollment group results"
)

with self.argument_context("iot dps registration") as context:
context.argument("registration_id", help="ID of device registration")

Expand Down
Loading

0 comments on commit cfdc6a8

Please sign in to comment.