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.8.x] fix(vault): let vault entity cache key not containing workspace id #13670

Merged
merged 1 commit into from
Sep 14, 2024

Commits on Sep 14, 2024

  1. fix(vault): let vault entity cache key not containing workspace id (#…

    …13610)
    
    This PR modifies the `cache_key` function of the vault entity to always generate a cache key without workspace id.
    
    Vault entity is workspace-able, but our secret rotation timer always run without workspace settings(thus the default workspace is being used), so during secret rotation, the code https://github.com/Kong/kong/blob/4e38b965b922f57febe8652fb96b7d74aeab591a/kong/pdk/vault.lua#L620-L621 will generate a duplicate vault cache with default workspace id for each non-default workspace vault entity, and those cache will never be refreshed. The result of this issue is that when you update a vault entity's configuration inside a non-default workspace, it will never take effect in the secret rotation.
    
    Since the prefix of vault entity is unique across workspaces, it should be safe to only use one cache key without workspace id, so that the correct cache is used during secret rotation.
    
    FTI-6152
    
    (cherry picked from commit 3455151)
    windmgc authored and github-actions[bot] committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    727de7f View commit details
    Browse the repository at this point in the history