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

feat: Enable multiple token caching and add option to disable caching… #660

Merged
merged 2 commits into from
Sep 29, 2024

Conversation

DaThumpingRabbit
Copy link
Contributor

Description

Due to the previous PR #544 fixing the cache behavior, users are not able to use multiple credentials anymore with the same AVP

This new PR's goal is to fix that issue by adding the following features

  • Tokens will now be cached on separate files identified by the connection method. Additionally, the approle and userpass method will have an additional identifier containing either the roleID or the username to allow users to reference multiple credentials if needed
  • Addition of a command-line parameter to disable completely the token caching feature if the user needs to make a fresh login at every call

Fixes: #658

Checklist

Please make sure that your PR fulfills the following requirements:

  • Reviewed the guidelines for contributing to this repository
  • The commit message follows the Conventional Commits Guidelines.
  • Tests for the changes have been updated
  • Are you adding dependencies? If so, please run go mod tidy -compat=1.21 to ensure only the minimum is pulled in.
  • Docs have been added / updated
  • Optional. My organization is added to USERS.md.

Type of Change

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • New tests
  • Build/CI related changes
  • Documentation content changes
  • Other (please describe)

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 53.44828% with 27 lines in your changes missing coverage. Please review.

Project coverage is 72.91%. Comparing base (42a43f0) to head (b5c0bad).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
pkg/utils/util.go 44.68% 17 Missing and 9 partials ⚠️
pkg/auth/vault/userpass.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #660      +/-   ##
==========================================
+ Coverage   72.16%   72.91%   +0.74%     
==========================================
  Files          26       26              
  Lines        1994     1606     -388     
==========================================
- Hits         1439     1171     -268     
+ Misses        458      326     -132     
- Partials       97      109      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pre
Copy link

pre commented Sep 17, 2024

Can't wait to see this merged soon!

@DaThumpingRabbit
Copy link
Contributor Author

@werne2j @jkayani
Would you have time to look into that PR ? I think that lots of people might have been impacted by my last one to enable the cache feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants