rust-payjoin
rust-payjoin copied to clipboard
Payjoin-cli should cache ohttp-keys for re-use
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:
- [x] I have disclosed my use of AI in the body of this PR.
- [x] I have read CONTRIBUTING.md and rebased my branch to produce hygienic commits.
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 | |
|---|---|
| Change from base Build 19649551708: | 0.04% |
| Covered Lines: | 9034 |
| Relevant Lines: | 10809 |
💛 - 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 the PR is ready