-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: add --sfdx-url-stdin flag #765
feat: add --sfdx-url-stdin flag #765
Conversation
d6c9d5d
to
c9723ee
Compare
This issue has been linked to a new work item: W-13860214 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking at that NUT now, but wouldn't be surprirsed if we couldn't hack the execCmd
method to get this working correctly, I think the UTs could cover it
Hey @AllanOricil , I'm taking this over from Willie. some options discussed:
but it would require a bit of work on the parser get it working and would still have limitations (can this support
This is a common pattern in CLIs and should be easy to re-use stdin helpers for args to implement in oclif. I'm sorry I missed your feature request, usually we try to catch these things while discussing a solution before opening an issue for contribution but I didn't follow up about your question after docs were fixed. If you are interested in proposal to do this in oclif and want to grab it, let us know and we can assign it to you on GH. If not, we can leave this PR open and make it use Again, thanks for all your work! 🏆 |
@cristiand391 what if we merge this now and later, when oclif is changed, we can just rework this to use oclif's native solution? I was also thinking that this command could be simplified to this
When not passing I can do this change quickly if you agree. Pros:
Cons: The same changes could be applied to other auth commands. People are storing keys in disk instead of fetching from memory only. They are doing it on PUBLIC NON EPHEMERAL job runners (gitlab, github, ...) |
closed in favor of oclif/core#894 |
What does this PR do?
With these changes developers can pipe the sfdx auth url from stdin as follows:
echo 'force://PlatformCLI::CoffeeAndBacon@su0503.my.salesforce.com' | sfdx org:login:sfdx-url --sfdx-url-stdin
Why? because it is not safe to store
force://<clientId>:<clientSecret>:<refreshToken>
in diskinspired by https://docs.docker.com/engine/reference/commandline/login/
I know that this isnt really that useful because nobody is ever going to memorise these long numbers but at least it will discourage people from ever storing this info in files.
What issues does this PR fix or reference?
forcedotcom/cli#2120
@W-13176733@