Add Client::with_valid_until for client cert expiry#1707
Merged
clux merged 3 commits intokube-rs:mainfrom Mar 10, 2025
Merged
Conversation
Signed-off-by: goenning <me@goenning.net>
Signed-off-by: goenning <me@goenning.net>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1707 +/- ##
=======================================
- Coverage 76.2% 76.1% -0.0%
=======================================
Files 84 84
Lines 7847 7858 +11
=======================================
+ Hits 5972 5977 +5
- Misses 1875 1881 +6
🚀 New features to boost your workflow:
|
clux
reviewed
Mar 7, 2025
Comment on lines
+299
to
+308
| pub(crate) fn exec_identity_pem(&self) -> (Option<Vec<u8>>, Option<DateTime<Utc>>) { | ||
| match Auth::try_from(&self.auth_info) { | ||
| Ok(Auth::Certificate(client_certificate_data, client_key_data)) => { | ||
| Ok(Auth::Certificate(client_certificate_data, client_key_data, expiratiom)) => { | ||
| const NEW_LINE: u8 = b'\n'; | ||
|
|
||
| let mut buffer = client_key_data.expose_secret().as_bytes().to_vec(); | ||
| buffer.push(NEW_LINE); | ||
| buffer.extend_from_slice(client_certificate_data.as_bytes()); | ||
| buffer.push(NEW_LINE); | ||
| Some(buffer) | ||
| (Some(buffer), expiratiom) |
Member
There was a problem hiding this comment.
I was trying to think of a way to lock this down with some tests, because that's the only thing that makes me a little tentative about merging this immediately.
Maybe this is a good fn to put a unit test around?
Member
There was a problem hiding this comment.
Eh, this isn't a big deal. I'll merge it in.
valid_until to Client Client::with_valid_until for client cert expiry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1675 as a follow up from #1676
This PR implements
Option 3as described in #1676 without any breaking changeI decided to make a separate so they can be compared