Skip to content

tedge connect c8y should display the auth method used (certificates or basic auth) #3380

@reubenmiller

Description

@reubenmiller

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

When using tedge connect c8y and setting the c8y.auth_method to basic, the command output displays incorrect information about the certificate.

Below shows an example of the output when using a username/password MQTT connection to Cumulocity.

$ sudo tedge connect c8y

Connecting to Cumulocity with config:
        device id: TST_mute_thundering_agent
        cloud profile: <none>
        cloud host: thin-edge-io.eu-latest.cumulocity.com:8883
        certificate file: /etc/tedge/device-certs/tedge-certificate.pem
        bridge: mosquitto
        service manager: systemd
        mosquitto version: 2.0.11
Creating device in Cumulocity cloud... ✓
Restarting mosquitto... ✓
Waiting for mosquitto to be listening for connections... ✓
Verifying device is connected to cloud... ✓
Enabling tedge-mapper-c8y... ✓
Enabling tedge-agent... ✓

The certificate file: /etc/tedge/device-certs/tedge-certificate.pem line suggestions that a certificate is being used when in-fact it isn't. This causes the user to question their configuration.

Describe the solution you'd like

The tedge connect c8y commands (including the --test option), should display

  • Show the certificate path only if a certificate is being used (note c8y.auth_method can be set to either basic or auto (where basic auth is used only if the given path (c8y.credentials_path) exists)

When using a certificate

$ sudo tedge connect c8y --test

Testing Cumulocity connection with config:
        device id: TST_mute_thundering_agent
        cloud profile: <none>
        cloud host: thin-edge-io.eu-latest.cumulocity.com:8883
        auth method: certificate                              <=== new
        certificate file: /etc/tedge/device-certs/tedge-certificate.pem
        bridge: mosquitto
        service manager: systemd
        mosquitto version: 2.0.11
Verifying device is connected to cloud... ✓
Connection check to c8y cloud is successful.

When using basic auth

$ sudo tedge connect c8y --test

Testing Cumulocity connection with config:
        device id: TST_mute_thundering_agent
        cloud profile: <none>
        cloud host: thin-edge-io.eu-latest.cumulocity.com:8883
        auth method: basic                                   <=== new
        credentials path: /etc/tedge/credentials.toml        <=== new
        bridge: mosquitto
        service manager: systemd
        mosquitto version: 2.0.11
Verifying device is connected to cloud... ✓
Connection check to c8y cloud is successful.

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

Labels

improvementUser valuetheme:c8yTheme: Cumulocity related topics

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions