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

tedge cert renew uses the existing key to create a new certificate #2520

Conversation

rina23q
Copy link
Member

@rina23q rina23q commented Dec 13, 2023

Proposed changes

This PR changes the behaviour of tedge cert renew. The work on #2502 defines that renew = remove + create, however, as #2512 is created, renew should reuse the private key and create only a new certificate.

At first, I thought I should have changed the robot tests regarding tedge cert renew, but I changed my mind. Indeed, the tests pass and they test the validity of the new certificate. So, I decided not to change them.

tests/RobotFramework/tests/tedge/tedge_upload_cert.robot

  • Renew the certificate
  • Renew certificate fails

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

#2512

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

@rina23q rina23q force-pushed the improve/2512/keep-private-key-for-tedge-cert-renew branch from 5feaf61 to 4537b23 Compare December 13, 2023 19:29
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Merging #2520 (21166d8) into main (290c50c) will increase coverage by 0.2%.
Report is 3 commits behind head on main.
The diff coverage is 94.3%.

❗ Current head 21166d8 differs from pull request most recent head 3052f95. Consider uploading reports for the commit 3052f95 to get more accurate results

Additional details and impacted files
Files Coverage Δ
crates/common/certificate/src/lib.rs 87.5% <95.2%> (+<0.1%) ⬆️
crates/core/tedge/src/cli/certificate/renew.rs 76.6% <97.3%> (+15.7%) ⬆️
crates/core/tedge/src/cli/certificate/create.rs 88.5% <90.0%> (+1.8%) ⬆️

... and 10 files with indirect coverage changes

Copy link
Contributor

github-actions bot commented Dec 13, 2023

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
370 0 3 370 100 55m46.632999999s

Copy link
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.

This is in a good shape.

crates/common/certificate/src/lib.rs Outdated Show resolved Hide resolved
@rina23q rina23q force-pushed the improve/2512/keep-private-key-for-tedge-cert-renew branch from 4537b23 to 5b5e3cb Compare December 14, 2023 12:47
@rina23q rina23q marked this pull request as ready for review December 14, 2023 13:01
Copy link
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

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
@rina23q rina23q force-pushed the improve/2512/keep-private-key-for-tedge-cert-renew branch from 21166d8 to 3052f95 Compare December 14, 2023 14:06
@rina23q rina23q merged commit e79edb6 into thin-edge:main Dec 14, 2023
16 checks passed
@rina23q rina23q deleted the improve/2512/keep-private-key-for-tedge-cert-renew branch December 14, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants