Skip to content

device.id should be derived from device certificates when in use #3369

@reubenmiller

Description

@reubenmiller

Is your feature improvement request related to a problem? Please describe.

If the cloud connection uses a certificate, then the device.id used for any cloud communication should be derived from the certificate's Common Name (CN).

Describe the solution you'd like

  • When using certificates, the device.id should only be used as a default value when creating a certificate via the tedge cert create command if the --device-id flag is not provided by the user.
  • Cloud connections should only use the device.id from the certificate being used for the connection

The change in behaviour is best highlighted in the follow cases:

Case 1: Use explicit device id during cert creation

tedge config set device.id foo
tedge cert create --device-id bar

# => CN=bar

Case 2: Use default device.id

tedge config set device.id foo
tedge cert create

# => CN=foo

Case 3: Use default device.id

tedge cert create --device-id foo
tedge config set device.id bar
tedge connect c8y

# => connect: device.id=foo

Case 4: Use default device.id to create the cert

tedge config set device.id foo
tedge cert create
# CN=foo
tedge config set device.id bar

tedge connect c8y
# => connect: device.id=foo

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions