-
Notifications
You must be signed in to change notification settings - Fork 78
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
enable sfdx auth:login:sfdx-url to read the url from stdin #2120
Comments
Thank you for filing this feature request. We appreciate your feedback and will review the feature at our next grooming or sprint planning session. We prioritize feature requests with more upvotes and comments. |
This issue has been linked to a new work item: W-13176733 |
I'd love to see this natively supported as well. @AllanOricil Until this is implemented you could use the following workaround on UNIX and MacOS: sfdx auth sfdxurl store -d -a devhub -f <(echo "$SFDX_AUTH_URL_DEVHUB") This is using Bash Process Substitution. $ ls <(echo "hi ls")
/dev/fd/11
$ cat <(echo "hi cat")
hi cat |
I dont think it would solve the problem because process substitution saves the information you piped in it to a file at When we use process substitution, the file location is echoed. This means its location can be retrieved from history if not deleted. I can consult the history, find the file, read its content. Even without knowing its location, I could just search for the Auth Url Pattern in all files at |
@AllanOricil As far as I know it isn't written to disk. $ ls <(echo "hi ls")
/dev/fd/11
$ cat /dev/fd/11
cat: /dev/fd/11: Bad file descriptor |
According to this guide,
|
@AllanOricil Yes, I can reproduce your example. Can you reproduce my example?
|
@amtrack I can confirm that I can """read""" it using the browser, but it displays nothing the fs also shows that it has 0 bytes do you know why the number 11 is a constant in your example? I thought |
the following sfdx|sf docs could be updated with @amtrack solution By the way, just noticed that the new doc was not templated properly. |
FWIW, I love this idea!!!! |
I'd definitely prefer having it implemented using a new |
the same problems could happen with the jwt flow which also reads a key from disk |
reopened because I still think it does not make sense to read unencryted secrets from disk |
@AllanOricil thanks for the heads up! |
Here there is an example of how this could be achieved |
I opened a PR for this new flag |
It can be implemented with oclif/core#894 once core is updated to v3 |
The fix is now in the sf CLI release candidate version, v2.24.4. |
Is your feature request related to a problem? Please describe.
no
What are you trying to do
I don't want to store a secret in disk as a plain text.
Describe the solution you'd like
sfdx could read the auth url from stdin like docker login does
echo $PASSWORD | docker login --username foo --password-stdin
. Where$PASSWORD
is an env variable available in a single shell session. It isn't saved anywhere in disk as a plain text, also not loaded by~/.profile
, or rc files like~/.bashrc,~/.zshrc
It could work like this
echo $AUTH_URL | sfdx auth:login:sfdx-url --sfdx-auth-url
or
sfdx auth:login:sfdx-url --sfdx-auth-url $AUTH_URL
Then you can delete the
--sfdx-auth-url-file
flag.Describe alternatives you've considered
N/a
Additional context
N/A
The text was updated successfully, but these errors were encountered: