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

[TT-13227] Add support for subdirectories when using Vault data store #6589

Open
vanny96 opened this issue Sep 26, 2024 · 1 comment
Open

Comments

@vanny96
Copy link

vanny96 commented Sep 26, 2024

Describe the problem
As described here, the vault data storage seems to have an inconsistent behaviour depending on where it is used.

In particular the behaviour for "any string field" seems to be quite limited, as it enforces all the key/value pairs to be set in the /secret/tyk-apis Vault secret (btw, the documentation doesn't mention the requirement for the Secret Engine to be named "secret", without looking at the source code there would be no way of knowing.)

Describe the solution you'd like
Ideally, the behaviour for "any string field" would be exactly the same as for the other fields (listenPath, upstream, configs and so on). If that's not possible due to back compatibility issues, support for subdirectories should be added so that:

  • vault://KEY still resolves to /secrets/data/tyk-apis.KEY
  • vault://path.KEY resolves to /secrets/data/tyk-apis/<path>.KEY

Describe alternatives you've considered
I think on the short term the subdirectory approach is the easiest to introduce as it won't break back-compatibility, but a more robust implementation that behaves as the configuration files would be heavily preferred.

For the back-compat approach, I created a draft PR with a rough idea of how it could be implemented. You can see more here: #6588

For the preferred approach, we could have a replaceVaultSecretsV2 function which uses a better resolution method and could be opt-in to begin with, and eventually become the default approach.

@andyo-tyk
Copy link
Contributor

Hi @vanny96,

Thank you for this suggestion. It's true that the initial implementation of "any string field" has known limitations and was released as an MVP. Your feedback helps to confirm that our plans to extend the functionality further are required.

Your PR is greatly appreciated and we will consider this as part of our work to enhance the Vault key-value storage.

Thanks again for your contribution.

@andyo-tyk andyo-tyk changed the title Add support for subdirectories when using Vault data store [TT-13227] Add support for subdirectories when using Vault data store Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants