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

Feature request - load configuration from HashiCorp Vault #8

Open
tomron opened this issue Oct 21, 2021 · 1 comment
Open

Feature request - load configuration from HashiCorp Vault #8

tomron opened this issue Oct 21, 2021 · 1 comment
Labels
question Further information is requested

Comments

@tomron
Copy link

tomron commented Oct 21, 2021

This is slightly a different case for loaders since it is not local but we use Vault \ Secrets Manager to hold configuration data such as DB URL, password, etc (which are different per env).

@hernantz
Copy link
Owner

This would be really cool, does it need a new dependency? If so, I think it should be optional. Another possibility is to provide this loader as a separate package like classyconf-vault?

Something to consider is that we would need to have a "configuration of the configuration" since the loader would need to be configured:

VaultLoader(
        url='https://localhost:8200',
        token='asdf',
        namespace='/test/'
)

So the loader would need to get this params from somewhere

class VaultConf(ClassyConf):
    VAULT_URL = Value(default="https://localhost:8200")
    VAULT_TOKEN = Value()
    VAULT_NAMESPACE = Value()

    class Meta:
        loaders = [ EnvFile(".env") ]


vault_conf= VaultConf()

vault_loader = VaultLoader(
    url=vault_conf.VAULT_URL,  
    token=vault_conf.VAULT_TOKEN, 
    namespace=vault_conf.VAULT_NAMESPACE
)

ini_loader = IniFile("another_conf.ini")

class MyAppConf(ClassyConf):
    class Meta:
        loaders = [ vault_loader, ini_loader ]

Makes sense?

@hernantz hernantz added the question Further information is requested label Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants