Skip to content

feat: add url flag to tedge cert download c8y#3689

Merged
reubenmiller merged 1 commit intothin-edge:mainfrom
reubenmiller:feat-tedge-cert-download-c8y-url-flag
Jun 17, 2025
Merged

feat: add url flag to tedge cert download c8y#3689
reubenmiller merged 1 commit intothin-edge:mainfrom
reubenmiller:feat-tedge-cert-download-c8y-url-flag

Conversation

@reubenmiller
Copy link
Copy Markdown
Contributor

Proposed changes

Add --url flag to the tedge cert download c8y command which allows users to provde the url where the certificate should be downloaded from.

By having a flag, it avoids problems with setting environment variables via sudo if the user does not have the SETENV sudo option set.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue

#3686

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s. You can activate automatic signing by running just prepare-dev once)
  • I ran just format as mentioned in CODING_GUIDELINES
  • I used just check as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/core/tedge/src/cli/certificate/cli.rs 0.00% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is correct, however I wonder why a specific treatment for this setting. There are many place where tedge uses settings that can be overwritten by env variable but not with a command argument. A more systematic fix is what you propose here #3688

@reubenmiller
Copy link
Copy Markdown
Contributor Author

reubenmiller commented Jun 16, 2025

The code is correct, however I wonder why a specific treatment for this setting. There are many place where tedge uses settings that can be overwritten by env variable but not with a command argument. A more systematic fix is what you propose here #3688

The motivation for the flag is to avoid relying on sudo to be configured correctly, as if someone has installed thin-edge.io without the linux packaging, then they will also face the same issue.

And looking in the future, having the host be configurable, would possible make the tedge cert download c8y command also work with another EST server (not just Cumulocity), for example if there was a local EST server to issue certificates to clients in the local network.

A more convincing argument has been given offline. Having the ability to provide the CA host on the command line is helpful when a user wants to switch from one tenant to another. A certificate for the new tenant can then be requested without having to twist the current configuration.

@reubenmiller reubenmiller added the theme:registration Theme: Device registration and device certificate related topics label Jun 16, 2025
Copy link
Copy Markdown
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 16, 2025

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
642 0 3 642 100 1h53m23.325461s

@reubenmiller reubenmiller added this pull request to the merge queue Jun 17, 2025
Merged via the queue into thin-edge:main with commit cd6f521 Jun 17, 2025
51 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:registration Theme: Device registration and device certificate related topics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants