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

support optional trim #195

Open
fernandodr19 opened this issue Jun 23, 2021 · 0 comments
Open

support optional trim #195

fernandodr19 opened this issue Jun 23, 2021 · 0 comments

Comments

@fernandodr19
Copy link

I've ran into an issue recently where a subtle new line character was incorrectly added by the devops team at the end of a password in a config file, which led to an error in authentication. This took me quite some time to figure out as we were moving into new servers with new credentials and the env output was rather subtle as I didn't really expect this to be an issue.

As these secrets are handled by different teams, I cannot be sure that this won't happen again and would like to defend against it. This could easily be avoided if we had an option to trim variables, for example. I was thinking of something like

type config struct {
    MyPass string `envconfig:"MY_PASS" trim:"true"`
}

Or something along those lines. What do you guys think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant