rust-payjoin icon indicating copy to clipboard operation
rust-payjoin copied to clipboard

Payjoin-cli should cache ohttp-keys for re-use

Open zealsham opened this issue 5 months ago • 1 comments

This pr adds the functionality of ohttp-keys catching to payjoin-cli , ohttp-keys should not be fetched each time and a cached key should be use. Keys expire in 6 months .

To do

  • [x] it shoudnt still use cached key when the relay-url isnt even present in config or as command-line flag
  • [x] should handle a case of non-expired key but key being rejected by relay (will be handled in different PR)
  • [x] get rid of unwrap calls that can panic (unhandled)
  • [x] should not use the cached keys if --ohttp-keys flag is present cli command
  • [x] it should be possible to cache multiple ohttp-keys based on relay-url (maybe in subsequent pr ?)

Pull Request Checklist

Please confirm the following before requesting review:

zealsham avatar Sep 03 '25 00:09 zealsham

Pull Request Test Coverage Report for Build 19678524663

Details

  • 50 of 54 (92.59%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 83.578%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin-cli/src/app/v2/ohttp.rs 50 54 92.59%
<!-- Total: 50 54
Totals Coverage Status
Change from base Build 19649551708: 0.04%
Covered Lines: 9034
Relevant Lines: 10809

💛 - Coveralls

coveralls avatar Sep 03 '25 00:09 coveralls

@zealsham I am going to mark this as draft. Do you mind cleaning up the commit messages and history and re-opening. Thank you.

arminsabouri avatar Nov 24 '25 16:11 arminsabouri

@arminsabouri the PR is ready

zealsham avatar Nov 25 '25 18:11 zealsham