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

Make sure both tokenCache and tokenExpiryCache are initialized if needed #342

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

dwnusbaum
Copy link
Member

It is possible for users who have a AbstractVaultTokenCredentialWithExpiration that was created after #223 and has not been resaved since #325 to still have a non-null tokenCache field on disk (and a non-null tokenExpiry field).

As of #336, this causes problems, because the following logic only checks for a non-null tokenCache to decide if the transient fields need to be initialized:

We need to adjust this logic to check for both tokenCache and the newly-renamed tokenExpiryCache to avoid issues for users who have gone through this upgrade path.

Fixes #340.

Testing done

Untested.

The regression should be able to be reproduced in a JenkinsRule test if desired, but I do not see any existing JenkinsRule tests for the credentials types that are subclasses of AbstractVaultTokenCredentialWithExpiration, so it might take some effort.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@dwnusbaum dwnusbaum mentioned this pull request Oct 16, 2024
@basil basil requested a review from a team October 16, 2024 19:34
@basil basil added the bug label Oct 17, 2024
@basil basil merged commit 884a4dd into jenkinsci:master Oct 17, 2024
15 checks passed
@dwnusbaum dwnusbaum deleted the deserialization-2 branch October 17, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception on java 17
3 participants