Add option to delete secret key without confirmation dialog #193
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.
Add Option to Delete GPG Key Without Confirmation Dialog
Summary
This PR introduces the ability to delete GPG keys without prompting for confirmation. This is achieved by leveraging the new
gpgme_op_delete_ext
function introduced in GPGME 1.9.1. Additionally, this update introduces two flags:DELETE_ALLOW_SECRET
: Allows deletion of secret keys alongside public ones.DELETE_FORCE
: Forces the deletion of keys without the confirmation dialog.Changes
New Method:
gpgme_op_delete_ext
:gpgme_n.c
) to allow deletion of GPG keys using additional flags.gpgme_op_delete_ext
function which allows the passing of flags (GPGME_DELETE_ALLOW_SECRET
,GPGME_DELETE_FORCE
).Constants:
GPGME_DELETE_ALLOW_SECRET
andGPGME_DELETE_FORCE
to expose these new flags to the Ruby interface.Ruby Methods:
GPGME::Ctx#delete_key
andGPGME::Key#delete!
methods to accept an additionalforce
parameter, which suppresses the confirmation dialog when deleting keys. They default tofalse
to ensure a non-breaking change.Usage Example:
Compatibility:
gpgme_op_delete_ext
method.Let me know if you'd like to add or modify anything! Any pointers regarding writing a test to detect the dialog?