Skip to content

Conversation

@bmonkman
Copy link
Contributor

No description provided.

@bmonkman bmonkman requested a review from a team as a code owner March 12, 2021 22:36
@bmonkman bmonkman requested a review from davidcheung March 12, 2021 22:36
// Split the string on commas, viper doesn't support doing this to env vars
domains := []string{}
if viper.GetString(AllowEmailToDomains) != "" {
domains = strings.Split(viper.GetString(AllowEmailToDomains), ",")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would we need to trim the domains? many people type coma separated list with a space in between

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's an env var you would have to quote it to even put a space into it, and if you use the config via zero-aws-eks-stack it creates the contents of this env var automatically using TF and helm. I'll trim it too though, might as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right 👍 , didnt see the usage from the infra PR at the time
yeah so will never really have that problem in our setup

@bmonkman bmonkman merged commit 19dc518 into main Mar 12, 2021
@bmonkman bmonkman deleted the fix-allowed-domains-splitting branch March 12, 2021 23:10
dtoki pushed a commit to dtoki/zero-notification-service that referenced this pull request Apr 9, 2021
commitdev#22)

* fix: Properly split domains on comma, viper doesn't do it for env vars

* Trim spaces from domains in allow list
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

Successfully merging this pull request may close these issues.

3 participants