danielgtaylor / restish

Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in
https://rest.sh/
MIT License
717 stars 69 forks source link

feat: add command to clear auth token cache #234

Closed danielgtaylor closed 7 months ago

danielgtaylor commented 7 months ago

This adds a basic profile-aware command to clear the auth token cache, so you don't have to try and find the cache.json file, find the right line, and delete it in order to force e.g. OAuth2 re-auth. Now it's a simple:

$ restish api clear-auth-cache $NAME`

Pass --rsh-profile=$PROFILE or -p $PROFILE to clear the cache for a specific profile instead of default.

codecov[bot] commented 7 months ago

Codecov Report

Merging #234 (97c3636) into main (21a9017) will increase coverage by 0.02%. The diff coverage is 84.61%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/danielgtaylor/restish/pull/234/graphs/tree.svg?width=650&height=150&src=pr&token=1BMagYibk9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+G.+Taylor)](https://app.codecov.io/gh/danielgtaylor/restish/pull/234?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+G.+Taylor) ```diff @@ Coverage Diff @@ ## main #234 +/- ## ========================================== + Coverage 76.84% 76.86% +0.02% ========================================== Files 26 26 Lines 3666 3679 +13 ========================================== + Hits 2817 2828 +11 - Misses 642 643 +1 - Partials 207 208 +1 ``` | [Files](https://app.codecov.io/gh/danielgtaylor/restish/pull/234?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+G.+Taylor) | Coverage Δ | | |---|---|---| | [cli/apiconfig.go](https://app.codecov.io/gh/danielgtaylor/restish/pull/234?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+G.+Taylor#diff-Y2xpL2FwaWNvbmZpZy5nbw==) | `83.87% <84.61%> (+0.06%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/danielgtaylor/restish/pull/234?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+G.+Taylor). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+G.+Taylor) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/danielgtaylor/restish/pull/234?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+G.+Taylor). Last update [21a9017...97c3636](https://app.codecov.io/gh/danielgtaylor/restish/pull/234?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+G.+Taylor). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+G.+Taylor).