kieraneglin / kieraneglin/encrypted_secrets_ex

Encrypted runtime config

Open
#10 9 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Elixir
Stars
50
Forks
6
PR merge metrics
No merged PRs in 30d

Description

I've been scratching my head with a problem which your post on elixirforum helped me squash. https://elixirforum.com/t/loading-custom-module-in-config-exs/23232
The problem being how to use the encrypted secrets inside a config file.

I am a long time ruby developer so this also seemed intuitive to me and was what I was looking for a solution to! Surprisingly hard to google, only found that thread after reading 10s of posts on compilation.

Anyway, based on the fact that it's not a good idea to decrypt these secrets during compilation as they'll be in the build unencrypted... maybe another solution is to create a runtime config module that behaves in a similar way but is called during startup. Similar to how you've proposed in the thread.

```
use EncryptedCredentials.RuntimeConfig
credentials = EncryptedCredentials.read!(file, key)

config :app, config_var: credentials[:config_var]
```
Then in Application#start/2 call this file
```
EncryptedCredentials.init_config
```
Just thinking out loud. For now I'm probably just going to build a module to do this for myself but while it was fresh thought it was worth writing down. The readme could also do with updating on how people actually get these credentials into the app and the limitations e.g. dependencies that require compiled configs rather than runtime

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the README and the linked ElixirForum discussion, then inspect how config.exs and Application#start/2 currently handle credentials. Clarify whether runtime configuration or README guidance is the intended scope; done should be defined as an agreed approach that addresses encrypted secrets, startup loading, and dependencies requiring compiled configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.