-
Notifications
You must be signed in to change notification settings - Fork 6
Add support for request_key and keyctl_instantiate #13
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
Conversation
|
@mythi Thanks for the PR! It looks great, will try to finish the review this weekend. Left one comment for your question about "NULL" callouts. |
Thanks, I think the comment is missing (at least I cannot see it). I pushed one small fix to |
src/keyring.rs
Outdated
| pub fn request_key<D: AsRef<str> + ?Sized, C: AsRef<str> + ?Sized>( | ||
| &self, | ||
| description: &D, | ||
| callout: &C, |
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 think having this as Option<&C> and then updating ffi::request_key to provide core::ptr::null when the Option is None would be nice from a user perspective. Instead of checking for ""
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 thought about the same but dropped the idea in the initial ver. I've have that now implemented. AFAUI, Option<&C> wants type hint so the param becomes None::<&str>.
70758d7 to
d76f9f2
Compare
|
(pushed with one lint error fixed that I just discovered) |
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
the rustdoc content is based on 'man request_key'. Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #13 +/- ##
===========================================
- Coverage 78.33% 65.51% -12.82%
===========================================
Files 9 9
Lines 420 319 -101
===========================================
- Hits 329 209 -120
- Misses 91 110 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@mythi Sorry for the delay. Just added a small Also added https://github.com/landhb/linux-keyutils/blob/main/examples/request-key.rs Will get this out in the next release. |
|
@landhb thanks! |
Fixes: #12