Skip to content
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 wrappers for SecItemDelete and SecItemUpdate #210

Merged

Commits on Aug 29, 2024

  1. Add wrappers for SecItemDelete and SecItemUpdate

    Thank you for the great library!
    
    This PR adds `delete_item`, `update_item` and `ItemUpdateOptions`. The
    functions reuse `SearchItemParams` to identify which items to modify
    and so I've also added a `to_dictionary` method to `SearchItemParams`.
    In fact, it would probably make sense to replace
    `SearchItemParams::search` with a `search_item` function in line with
    the add/update/delete API, but I didn't want to make unnecessary
    changes.
    
    Also in the spirit of minimising changes to existing code:
    - I added a slightly strange API to `ItemUpdateOptions::set_class` to
      allow for rewriting the secret data without overwriting the class.
      Alternatively, I could add an `ItemUpdateValue` that is the same as
      `ItemAddValue`, but doesn't take a class.
    - `ItemUpdateOptions` is basically a duplicate of `ItemAddOptions`. I
      could instead define `struct ItemAddOptions(ItemUpdateOptions)` and
      then just forward all the methods.
    
    Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
    tsoutsman committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    49acfaf View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2024

  1. Implement review

    Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
    tsoutsman committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    52eddd4 View commit details
    Browse the repository at this point in the history