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

Fix GCP environment variable usage #656

Open
gfting opened this issue Jul 3, 2020 · 5 comments
Open

Fix GCP environment variable usage #656

gfting opened this issue Jul 3, 2020 · 5 comments
Labels
bite size For small issues approachable by first-timers Type: Bug Something isn't working

Comments

@gfting
Copy link
Member

gfting commented Jul 3, 2020

Currently, using the JSON as a string can lead to errors and inconsistencies. We should instead factor out individual properties into their own environment variables, as Dmitry suggested.

@gfting gfting added Type: Bug Something isn't working bite size For small issues approachable by first-timers labels Jul 3, 2020
@semenodp
Copy link
Collaborator

semenodp commented Jul 3, 2020

@gfting i will take this one

@gfting
Copy link
Member Author

gfting commented Jul 3, 2020

Thanks! I think after this is merged in, then we can merge in #630.

@aadibajpai
Copy link
Member

Currently, using the JSON as a string can lead to errors and inconsistencies. We should instead factor out individual properties into their own environment variables, as Dmitry suggested.

can't we just put the env var base64 encoded and then decode it from the env var? that's what I do at https://github.com/aadibajpai/VandyPurger/blob/master/bot.py#L24 for using the Google Sheets API and it works well enough

@leonm1
Copy link
Member

leonm1 commented Feb 28, 2021

I'm not sure I agree with splitting up the GCP service account env var, as the properties come from a service account JSON config file download and can't be used separately.

base64 encoding is a good option, although will be just as long, only prevents weird newline issues depending on what format you're keeping the env var.

@semenodp
Copy link
Collaborator

semenodp commented Feb 28, 2021

Aren't the properties consist though? It's just seems unnatural to have entire json as env variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bite size For small issues approachable by first-timers Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants