Skip to content

feat: add provider for kiln#369

Merged
knadh merged 4 commits intoknadh:masterfrom
Thunderbottom:feat/kiln-provider
Jul 12, 2025
Merged

feat: add provider for kiln#369
knadh merged 4 commits intoknadh:masterfrom
Thunderbottom:feat/kiln-provider

Conversation

@Thunderbottom
Copy link
Contributor

Add support for loading encrypted environment variables from kiln files with age/SSH encryption.

import (
    // ...
    "github.com/knadh/koanf/providers/kiln"
)

// Load encrypted environment variables with transformations
k.Load(kiln.Provider("kiln.toml", "", "production", kiln.Opt{
    Prefix: "API_",
    TransformFunc: func(k, v string) (string, any) {
        return strings.ToLower(strings.ReplaceAll(k, "_", ".")), v
    },
}), nil)

Provides the same API as the env provider but reads from encrypted files instead of environment variables.

repository: https://github.com/thunderbottom/kiln

allows loading encrypted environment variables directly into go applications

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
requires initializing the kiln key, configuration, and setting a few
variables described in examples/read-kiln/main.go

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
@knadh knadh added the enhancement New feature or request label Jul 12, 2025
@knadh knadh merged commit 73703f1 into knadh:master Jul 12, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants