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

cli/cmd: add commands for viewing the cache location and clearing it #384

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

calebdoxsey
Copy link
Contributor

Summary

Add commands:

pomerium-cli cache clear
pomerium-cli cache location

Related issues

Fixes #279

Checklist

  • reference any related issues
  • updated docs
  • updated unit tests
  • updated UPGRADING.md
  • add appropriate tag (improvement / bug / etc)
  • ready for review

Copy link
Contributor

@kenjenkins kenjenkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for doing this!

if err != nil {
return err
}
return os.RemoveAll(filepath.Join(root, "pomerium-cli"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to extract this bit of logic to a single shared method. (I see there's already a cachePath() method, but maybe we could rename that one to execCredentialCachePath()?)

(Totally optional; we can always refactor this in a follow-up PR.)

Copy link
Contributor

@kenjenkins kenjenkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

It looks like there's also a cache path constructed in jwtcache.go. I wonder if that one can use this shared cachePath() method too (although that would probably require moving this it to a different package to avoid import issues).

Feel free to submit this PR as is -- we can always refactor the jwt cache path separately.

@calebdoxsey calebdoxsey merged commit 012055f into main Jan 16, 2024
4 checks passed
@calebdoxsey calebdoxsey deleted the cdoxsey/cache branch January 16, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants