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

story: move CHECKLY prefixed envs to AuthCommand base class so they are documented #588

Closed
umutuzgur opened this issue Mar 16, 2023 · 8 comments
Assignees

Comments

@umutuzgur
Copy link
Member

Story description

We have 2 special env vars for bypassing the auth flow which we use heavily with the CI use case. We are not using the oclif framework to set this env vars which then causes it not to be printed when a user invokes the --help command. Instead, we should move these to the AuthCommand so they are documented and easier to be discovered by the user

Shortcut link

No response

Additional resources

No response

@umutuzgur umutuzgur changed the title story: Move CHECKLY prefixed envs to AuthCommand base class so they are documented story: move CHECKLY prefixed envs to AuthCommand base class so they are documented Mar 16, 2023
@nahuelon
Copy link
Contributor

nahuelon commented May 11, 2023

I tried to add the env variables to the flags but the --help doesn't show any environment variable description. I found someone that is asking for that feature in oclif/core#981

@tnolet
Copy link
Member

tnolet commented May 22, 2023

@umutuzgur is this still relevant?

@umutuzgur
Copy link
Member Author

@tnolet yeah

@nahuelon
Copy link
Contributor

@umutuzgur , @tnolet , yesterday I tried to move the --api-key and --account-id flags to the AuthCommand class. That made them available for all the commands that required authentication and let the users send their credentials in one line command (f.ex. run test without any previous login or env var configuration). Let me know what you think about this behavior. I know this is not what we should do here but I tried to use oclif env var definition and they weren't shown in the --help information output (issue here)
Can you suggest me a potential --help output so I can tweak the help output. Thanks.

@tnolet
Copy link
Member

tnolet commented May 24, 2023

no, this is an antipattern. We should not have flags to set credentials. You cannot encourage users to visibly set credentials in a command line app which will be logged by CI systems etc. They should always be ENV VARS.

@nahuelon
Copy link
Contributor

no, this is an antipattern. We should not have flags to set credentials. You cannot encourage users to visibly set credentials in a command line app which will be logged by CI systems etc. They should always be ENV VARS.

@tnolet , I agree. And, is it OK to keep the flags for the login?

@tnolet
Copy link
Member

tnolet commented May 25, 2023

no, this is an antipattern. We should not have flags to set credentials. You cannot encourage users to visibly set credentials in a command line app which will be logged by CI systems etc. They should always be ENV VARS.

@tnolet , I agree. And, is it OK to keep the flags for the login?

No, no flag at all. Login is interactive. If you don't want interactive, use env vars.

@nahuelon
Copy link
Contributor

I created checkly/docs.checklyhq.com#813 to add the CHECKLY_ACCOUNT_NAME description to the /docs

nahuelon pushed a commit that referenced this issue May 30, 2023
* chore: remove login command flags [gh-588]

* chore: remove CHECKLY_ACCOUNT_NAME from help [gh-588]
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

3 participants