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

[backport -> release/3.6.x] fix(certificate): hybrid dp cannot refresh certificate entity with vault reference #12886

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

team-gateway-bot
Copy link
Collaborator

Automated backport to release/3.6.x, triggered by a label in #12868.

Original description

Summary

This PR fixes a problem that a certificate entity with cert/keys stored in a vault-referenced type cannot be refreshed even if the vault reference secret value has been updated both in L1/L2 vault PDK.

The root cause of this problem is that in a dp node running hybrid mode, kong cache interfaces force the cache TTL to be infinite(and it also does not respect cache TTL configured in kong.conf), thus the certificate object cannot be updated unless a new configuration is received and cache purge being called.

The PR fixes the problem by caching the vault reference fields $ref and call kong.vault.update every time in get_certificate, and l1 serializer will keep the value serialized inside the certificate object.

This PR contains a test case that tests a certificate entity with a vault-referenced key that can be refreshed promptly, according to the TTL configured on the vault reference. The test case will fail consistently without the fix.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

FTI-5881

…ult reference (#12868)

This PR fixes a problem that a certificate entity with cert/keys stored in a vault-referenced type cannot be refreshed even if the vault reference secret value has been updated both in L1/L2 vault PDK.

FTI-5881
---------

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Co-authored-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
(cherry picked from commit 7dd29d4)
@ms2008 ms2008 merged commit c51c393 into release/3.6.x Apr 19, 2024
44 checks passed
@ms2008 ms2008 deleted the backport-12868-to-release/3.6.x branch April 19, 2024 08:23
@team-gateway-bot
Copy link
Collaborator Author

Cherry-pick failed for release/3.6.x: couldn't find remote ref release/3.6.x.
Please ensure that this Github repo has a branch named release/3.6.x.

@team-gateway-bot
Copy link
Collaborator Author

Cherry-pick failed for release/3.6.x, because it was unable to create a new branch.

Please cherry-pick the changes locally.

git remote add upstream https://github.com/kong/kong-ee
git fetch upstream release/3.6.x
git worktree add -d .worktree/cherry-pick-12886-to-release/3.6.x-to-upstream upstream/release/3.6.x
cd .worktree/cherry-pick-12886-to-release/3.6.x-to-upstream
git checkout -b cherry-pick-12886-to-release/3.6.x-to-upstream
ancref=$(git merge-base 7a9a9df9641ccf8d2bbce819493279d3300ebeb8 38092e3fedc472e22dd36ccea7da2de6e6a755ff)
git cherry-pick -x $ancref..38092e3fedc472e22dd36ccea7da2de6e6a755ff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/pdk core/proxy size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants