Skip to content

Conversation

carlo-blohm
Copy link
Contributor

@carlo-blohm carlo-blohm commented Jan 6, 2025

Changes proposed by this PR

closes #8705

The current implementation causes the secret cache not to be cleared for the object and it is saved for ever.

Checking the itemDuration if it is greater than 0 fixed this issue and sets the default duration.
Also changed the test duration as the tests needed 5 seconds, now they are done in 1 second.

Notes to reviewer

hope the shortened timing does not break CI or other non local systems

Release Notes

  • Fix a bug in credential caching where a secret would be cached forever

This causes the secret cache not to be cleared for the object and it is
saved for ever.
Checking the itemDuration if it is greater than 0 fixed this issue and
sets the default duration.
Also changed the test duration as the tests needed 5 seconds, no they
are 1 second.

Signed-off-by: Carlo Blohm <carlo.blohm@solarisbank.de>
@carlo-blohm carlo-blohm changed the title In case of Vault, the duration can be 0 or less make sure to drop item from secret cache after default duration if calculated duration is equal or less than 0 Jan 6, 2025
@carlo-blohm carlo-blohm marked this pull request as ready for review January 6, 2025 16:23
@carlo-blohm carlo-blohm requested a review from a team as a code owner January 6, 2025 16:23
@taylorsilva taylorsilva added the bug label Jan 7, 2025
Copy link
Member

@taylorsilva taylorsilva left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @carlo-blohm! Sorry it took a while getting to it. Thanks for including a test as well.

@taylorsilva taylorsilva merged commit 1865c66 into concourse:master Feb 21, 2025
9 checks passed
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.

Credentials returned from Vault with lease_duration of 0 stay in cache forever
2 participants