Skip to content

Conversation

@mythi
Copy link
Contributor

@mythi mythi commented Aug 20, 2024

Fixes: #12

@landhb landhb self-requested a review August 21, 2024 21:35
@landhb
Copy link
Owner

landhb commented Aug 22, 2024

@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.

@mythi
Copy link
Contributor Author

mythi commented Aug 23, 2024

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 examples/keyctl (changed keyring to ring because of a conflicting -k shorname for key/keyring)

src/keyring.rs Outdated
pub fn request_key<D: AsRef<str> + ?Sized, C: AsRef<str> + ?Sized>(
&self,
description: &D,
callout: &C,
Copy link
Owner

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 ""

Copy link
Contributor Author

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

@landhb landhb self-requested a review August 23, 2024 17:05
@mythi mythi force-pushed the request-key branch 2 times, most recently from 70758d7 to d76f9f2 Compare August 26, 2024 10:18
@mythi
Copy link
Contributor Author

mythi commented Sep 8, 2024

(pushed with one lint error fixed that I just discovered)

mythi added 6 commits October 30, 2024 20:36
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>
@landhb landhb added the enhancement New feature or request label Mar 29, 2025
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 45.00000% with 22 lines in your changes missing coverage. Please review.

Project coverage is 65.51%. Comparing base (2e81f72) to head (5811f27).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/key.rs 0.00% 16 Missing ⚠️
src/ffi/types.rs 40.00% 3 Missing ⚠️
src/errors.rs 0.00% 2 Missing ⚠️
src/keyring.rs 83.33% 1 Missing ⚠️

❗ 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@landhb landhb merged commit 05d110f into landhb:main Mar 30, 2025
9 of 11 checks passed
@landhb
Copy link
Owner

landhb commented Mar 30, 2025

@mythi Sorry for the delay. Just added a small request-key program that we can install to /sbin/request-key to run your tests in CI/CD.

Also added Key::assume_authority for that usage.

https://github.com/landhb/linux-keyutils/blob/main/examples/request-key.rs

Will get this out in the next release.

@mythi
Copy link
Contributor Author

mythi commented Mar 31, 2025

@landhb thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

keyctl instantiate

3 participants