-
Notifications
You must be signed in to change notification settings - Fork 934
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
add sso passcode option #1052
add sso passcode option #1052
Conversation
Hey h0nIg! Thanks for submitting this pull request! All pull request submitters and commit authors must have a Contributor License Agreement (CLA) on-file with us. Please sign the appropriate CLA (individual or corporate). When sending signed CLA please provide your github username in case of individual CLA or the list of github usernames that can make pull requests on behalf of your organization. If you are confident that you're covered under a Corporate CLA, please make sure you've publicized your membership in the appropriate Github Org, per these instructions. Once you've publicized your membership, one of the owners of this repository can close and reopen this pull request, and dreddbot will take another look. |
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/137267221 The labels on this github issue will be updated when the story is started. |
Hey h0nIg! Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA. |
ping @dkoper |
@h0nIg Sorry, I asked the UAA PM to take a look as well. I'll ping her again. |
ping @dkoper again :( |
ping @sreetummidi again |
@dkoper i dont think get this working again is an option, because it seems that CF switched to stty for security reasons. go support for terminals in combination with windows <--> linux toolsets like mingw / cygwin is horrible. checkout #171, therefore from my point of view implementing a cli option like the present option for password is a good way to go. |
@h0nIg UAA PM said she sees no issues with it.
I don't think this option needs an example (trivial enough), but we should be consistent in use of password vs. passcode in relation to SSO. (UAA PM agreed to using "passcode"). |
@dkoper @sreetummidi passcode vs password should be consistent after last commit (in favour of passcode). when do you expect this will be available as a release version (2 months between v6.23.0 and v6.22.2)? |
@h0nIg I think we'll be ready for the next release in the next one or two weeks. |
@dkoper I did what you requested and changed password to passcode as requested by uaa pm. I created a description as part of my pull request description. |
@h0nIg Please copy & paste the help output here of this command with your patch applied and if there are any differences with what I mentioned I expected, enter into a discussion with me why yours is better. |
@dkoper now i understand what this is about. the UX you proposed was my first solution but i had to change for some reason. as far as i can remember, there was a problem with the presence of the parameter on https://github.com/cloudfoundry/cli/blob/master/cf/commands/login.go#L43, because if the parameter is present but no value is specified, then the cf cli will complain about a missing parameter. i will double check this tomorrow |
@h0nIg If you're OK with the UX and help text I proposed, you could make it as close to it as you can and my team can look into and fix the issue you're seeing (especially if it requires delving into existing code more than you'd care for)? |
@dkoper , its working and i made a mistake the last time. I changed it to be one option with optional argument |
@h0nIg So can you paste the command help after your change? |
@dkoper ok i was wrong again. i found the problem i came across with StringFlag without argument: original branch is available as https://github.com/h0nIg/cli/tree/ssopasscode_multi, because i forced push the pull request branch with the new content
|
this can only be solved with StringFLag ...(Value: "default") in combination with IsSet("sso") and String("sso") != default |
So what's the plan? |
2eea3bf
to
6903782
Compare
hi @dkoper , after checking the code again, i recognized the "default" feature is not a workaround. the problem is that its either "parameter with value present" or "parameter absent" but not "parameter present without value". see https://github.com/cloudfoundry/cli/blob/master/cf/flags/flags.go#L66 and https://github.com/cloudfoundry/cli/blob/master/cf/flags/flags.go#L135 (code is checking args directly). There are two possibilities:
help output / UX:
|
@h0nIg OK, thanks for your efforts so far. I'll ask my devs to take a look. |
We are very much interested to use this feature - any roadmap of the release with this feature --sso-passcode? |
@sbachuMSOL The PR's been merged so you can start using it with our edge binaries now. |
@dkoper Thank you for sharing the release date. |
What Need Does It Address?
we need to specify the sso passcode as an option on the command line. STDIN is not useful, because stty is used and it will give you errors. There is a password option so there is no reason for not adding an sso passcode option
echo PASSCODE | cf login -sso
will result in:
stty: 'standard input': Inappropriate ioctl for device
Possible Drawbacks
none, because if the user will see sso code via "ps" then its already too late / the code is valid only once
Why Should This Be In Core?
because CLI offers the sso login and therefore this should be part of the general CLI
Description of the Change
add sso passcode CLI option / added tests