-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
Add Client::with_valid_until
for client cert expiry
#1707
Conversation
Signed-off-by: goenning <[email protected]>
Signed-off-by: goenning <[email protected]>
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i like this! thank you!
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, this isn't a big deal. I'll merge it in.
valid_until
to Client Client::with_valid_until
for client cert expiry
fixes #1675 as a follow up from #1676
This PR implements
Option 3
as described in #1676 without any breaking changeI decided to make a separate so they can be compared