How to pass the token without showing it #424
-
|
I would like to pass a token in gdg.yml but I do not want to make it in plain text. I tried to make the token as a environment variable. For example, GDG_CONTEXTS_DEV_TOKEN in my yaml file(config similar to the code below. But it still fails to read the value. Is there any other way to fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
That should work but that assumes a config similar to this: context_name: dev
contexts:
dev:
token: ""
connections: null
dashboard_settings:
...etcgdg tools contexts show ---dev:
token: ""
connections: null
dashboard_settings:
nested_folders: true
ignore_filters: false
ignore_bad_folders: false
...etc
GDG_CONTEXTS__DEV__TOKEN=1234 gdg tools contexts show ---dev:
token: "1234"
connections: null
dashboard_settings:
nested_folders: true
ignore_filters: false
ignore_bad_folders: false
...etcOne gotcha with the ENV overrides is that you need a value to override, so you still need to set a value in the config even if it won't be used. Also be aware that if you use: gdg tools contexts {copy,set,set} any write operation it'll merge the CFG + ENV and save it back to plain text. Just something to be aware of and careful of. |
Beta Was this translation helpful? Give feedback.
That should work but that assumes a config similar to this:
gdg tools contexts show
GDG_CONTEXTS__DEV__TOKEN=1234 gdg tools contexts show
One gotcha with the ENV overrides is that you need a value to override, so you still need to set a value in the config even if it won't be used.
Also…