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

Don't write token to ~/.config/lab/lab.toml if environment is used #863

Open
doronbehar opened this issue Jun 9, 2023 · 4 comments
Open

Comments

@doronbehar
Copy link

Hello

Running lab for the first time. The experience is still not fluid as with gh by GitHub, but still it's a nice to have!

I am trying to avoid putting tokens and passwords in configuration files. I tried to use the $LAB_CORE_TOKEN environment variable, and lab managed to authenticate, but I noticed that the token is never the less written into ~/.config/lab/lab.toml. Why is that? Doesn't make sense to me.

@prarit
Copy link
Collaborator

prarit commented Jun 13, 2023

Oh interesting. I'm going to play around with this and see what I can come up with. What you said makes complete sense to me; if the TOKEN is specified on the command line it shouldn't be saved to the toml file.

@prarit
Copy link
Collaborator

prarit commented Jul 13, 2023

Hi @doronbehar . My apologies for not getting to this sooner. I finally found some time to investigate this issue.

I did

LAB_CORE_TOKEN="<secret> lab mr list

and do not see that the lab.toml file is overwritten? Is there some command you executed where the file was written?

@doronbehar
Copy link
Author

and do not see that the lab.toml file is overwritten?

Should I understand from #868 that you did find the place where the config is written?

Is there some command you executed where the file was written?

I'm pretty sure it was lab project create.

@prarit
Copy link
Collaborator

prarit commented Jul 14, 2023

@doronbehar is there any chance you could try to reproduce using latest lab top-of-tree? I did

cp ~/.config/lab/lab.toml /tmp/lab.toml.hold
# edited ~/.config/lab/lab.toml to remove the token entry
LAB_CORE_TOKEN="<secret>" lab project create

And I do not see that the ~/.config/lab/lab.toml is overwritten? I could be doing it differently than you are.

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

2 participants