forked from Azure/iotedge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new external provisioning mode that uses a hosting environment …
…endpoint for retrieving device specific information. (Azure#1144) * Add a new external provisioning mode that uses a hosting environment endpoint for retrieving device specific information. * Use a sentinel while activating primary key in external mode. * Minor changes * Remove temporary change * Reverting changes made to other files with older version of rustfmt. * Fix spelling * Clippy fix * Set the hosting endpoint environment var before the crypto lib is initialized. * Pass hsm_lock param. * Allow cyclomatic complexity warning in method. * Incorporate review comments. * Rename to external provisioning from hosting. * Changing spec * Incorporating review comments. * Update external prov interface * Prov changes * New changes * With generics * draft * draft * Compiling * Working changes * Clippy fixes * Update tests * Add more tests * Fix other tests * Clippy fix * Incorporate review comments. * Incorporating review comments again.
- Loading branch information
1 parent
1609e47
commit 539efad
Showing
40 changed files
with
1,831 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
edgelet/api/externalProvisioningVersion_2019_04_10.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
swagger: '2.0' | ||
schemes: | ||
- http | ||
info: | ||
title: IoT Edge External Provisioning Environment API | ||
version: '2019-04-10' | ||
tags: | ||
- name: ExternalProvisioning | ||
x-displayName: ExternalProvisioning | ||
description: | | ||
paths: | ||
'/device/provisioninginformation': | ||
get: | ||
tags: | ||
- ExternalProvisioning | ||
summary: Gets the IoT hub provisioning information of the device. | ||
produces: | ||
- application/json | ||
description: | | ||
This returns the IoT hub provisioning information of the device. | ||
operationId: GetDeviceProvisioningInformation | ||
parameters: | ||
- $ref: '#/parameters/api-version' | ||
responses: | ||
'200': | ||
description: Ok | ||
schema: | ||
$ref: '#/definitions/DeviceProvisioningInfo' | ||
default: | ||
description: Error | ||
schema: | ||
$ref: '#/definitions/ErrorResponse' | ||
|
||
definitions: | ||
DeviceProvisioningInfo: | ||
type: object | ||
properties: | ||
hubName: | ||
type: string | ||
description: The host name of the IoT hub. | ||
example: mytesthub.azure-devices.net | ||
deviceId: | ||
type: string | ||
description: The ID of the device in IoT hub. | ||
example: device01 | ||
credentials: | ||
$ref: '#/definitions/Credentials' | ||
required: | ||
- hubName | ||
- deviceId | ||
- credentials | ||
Credentials: | ||
type: object | ||
properties: | ||
authType: | ||
type: string | ||
description: Indicates the type of authentication credential used. | ||
enum: | ||
- symmetric-key | ||
- x509 | ||
source: | ||
type: string | ||
description: Indicates the source of the authentication credential. | ||
enum: | ||
- payload | ||
- hsm | ||
key: | ||
type: string | ||
format: byte | ||
description: The symmetric key used for authentication. Specified only if the 'authType' is 'symmetric-key' and the 'source' is 'payload'. | ||
identityCert: | ||
type: string | ||
format: byte | ||
description: The identity certificate. Should be a PEM formatted byte array if the 'authType' is 'x509' and the 'source' is 'payload' or should be a reference to the certificate if the 'authType' is 'x509' and the 'source' is 'hsm'. | ||
identityPrivateKey: | ||
type: string | ||
format: byte | ||
description: The identity private key. Should be a PEM formatted byte array if the 'authType' is 'x509' and the 'source' is 'payload' or should be a reference to the private key if the 'authType' is 'x509' and the 'source' is 'hsm'. | ||
|
||
required: | ||
- authType | ||
- source | ||
|
||
ErrorResponse: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
required: | ||
- message | ||
|
||
parameters: | ||
api-version: | ||
name: api-version | ||
in: query | ||
description: The version of the API. | ||
required: true | ||
type: string | ||
default: '2019-04-10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
edgelet/edgelet-config/test/linux/sample_settings.external.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
# Configures the provisioning mode | ||
provisioning: | ||
source: 'external' | ||
endpoint: 'http://localhost:9999' | ||
|
||
agent: | ||
name: "edgeAgent" | ||
type: "docker" | ||
env: | ||
abc: "value1" | ||
acd: "value2" | ||
config: | ||
image: "microsoft/azureiotedge-agent:1.0" | ||
auth: {} | ||
hostname: "localhost" | ||
|
||
# Sets the connection uris for clients | ||
connect: | ||
workload_uri: "http://localhost:8081" | ||
management_uri: "http://localhost:8080" | ||
|
||
# Sets the uris to listen on | ||
# These can be different than the connect uris. | ||
# For instance, when using the fd:// scheme for systemd | ||
listen: | ||
workload_uri: "http://0.0.0.0:8081" | ||
management_uri: "http://0.0.0.0:8080" | ||
homedir: "/tmp" | ||
moby_runtime: | ||
uri: "http://localhost:2375" | ||
network: "azure-iot-edge" |
Oops, something went wrong.