Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Integration with Cumulocity CA #3259

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

didier-wenzek
Copy link
Contributor

@didier-wenzek didier-wenzek commented Nov 21, 2024

Proposed changes

  • Impl tedge cert download c8y
  • Impl tedge cert renew c8y
  • Enhance tedge config with setting for certificate validity period.
  • Enhance tedge cert show to display number of days before expiration.
  • Make sure the current certificate is not erased on renewal

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

#3248

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy 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

@didier-wenzek didier-wenzek added feature Change request theme:c8y Theme: Cumulocity related topics theme:certificates Theme: Device certificate topics labels Nov 21, 2024
)
}
}
warning!("Will retry in 5 seconds");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One needs to loop only when it makes senses to retry: i.e. the c8y endpoint has been reached but the device has not been registered yet.

Question: does Cumulocity return a specific HTTP status when the device is not registered?

@didier-wenzek didier-wenzek force-pushed the feat/integration-with-cumulocity-ca branch from 844dc34 to 284c8ee Compare November 22, 2024 10:16
@didier-wenzek didier-wenzek force-pushed the feat/integration-with-cumulocity-ca branch from 284c8ee to fba8ed6 Compare November 22, 2024 16:00
Copy link
Contributor

github-actions bot commented Nov 28, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
570 0 3 570 100 1h33m53.885902999s

@didier-wenzek didier-wenzek force-pushed the feat/integration-with-cumulocity-ca branch from abfa57e to 74c6188 Compare December 31, 2024 13:22
Comment on lines 46 to 55
Renew {
/// CA from which the certificate will be renew
#[arg(value_enum, default_value = "self-signed")]
ca: CertRenewalCA,

#[clap(subcommand)]
cloud: Option<CloudArg>,
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Something is wrong here.

In tedge cert renew c8y, c8y can be understood either as the CA and as the cloud profile. Even clap is confused:

  • tedge cert renew self-signed c8y --profile test is correctly interpreted as a request to renew the self-signed certificate used to connect the test c8y tenant
  • while tedge cert renew c8y c8y --profile test leads to an error, clap incorrectly assuming the default CA (i.e. self-signed) and being then confused by the repeated cloud parameter.

@didier-wenzek didier-wenzek force-pushed the feat/integration-with-cumulocity-ca branch from 4911dbf to d8ad1bd Compare February 4, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Change request theme:c8y Theme: Cumulocity related topics theme:certificates Theme: Device certificate topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants