don't print duplicate org & user info #463
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
This is niche, but glaring once you notice it:
If Okta org and/or username aren't specified in BMX config file or provided via command line args, BMX will prompt the user to enter the info, and immediately print the same info again:
A good solution isn't exactly obvious or straightforward as one might think.
A few options:
Keep the behaviour as is:
Simple, but looks bad in niche cases
Print org or user at the time of password prompt, but only if there was no org or user prompt:
Simple, but the order can be inconsistent in certain cases.
E.g. if only org is prompted, we'd get this:
if only user is prompted, we'd get this:
Also, it'd be nice if people can see the Okta org when they're being prompted for their Okta username
Always print both Okta org and user (and potentially also AWS account name & role name) when not entered via a prompt
Simple and good interactive UX, but BMX will become a lot more chatty than before, which some users might find jarring? Possibly considered a breaking change for some scripts?
Print both Okta org and user exactly once and always in the same order if and only if one or more of org, user or password is prompted.
Most consistent with BMX 3.1.0- behaviour. Very self-consistent too. However, the implementation logic will be complex and unintuitive.
This PR implements this option to showcase its complexity.
Ticket
https://desire2learn.atlassian.net/browse/VUL-403