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

don't print duplicate org & user info #463

Closed
wants to merge 1 commit into from
Closed

don't print duplicate org & user info #463

wants to merge 1 commit into from

Conversation

cfbao
Copy link
Member

@cfbao cfbao commented Jul 22, 2024

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:

Screenshot 2024-07-20 092346

A good solution isn't exactly obvious or straightforward as one might think.

A few options:

  1. Keep the behaviour as is:
    Simple, but looks bad in niche cases

  2. 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:

    Okta org name or domain name: d2l
    Okta username: cbao
    Okta password: ***
    

    if only user is prompted, we'd get this:

    Okta username: cbao
    Okta org name or domain name: d2l
    Okta password: ***
    

    Also, it'd be nice if people can see the Okta org when they're being prompted for their Okta username

  3. 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?

  4. 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

@cfbao cfbao marked this pull request as ready for review July 22, 2024 20:05
@cfbao cfbao requested a review from a team as a code owner July 22, 2024 20:05
@cfbao
Copy link
Member Author

cfbao commented Jul 22, 2024

As per discussion, will proceed with option 3.
Will open a different PR for it.

@cfbao cfbao closed this Jul 22, 2024
@cfbao cfbao deleted the print-less branch July 22, 2024 20:29
cfbao added a commit that referenced this pull request Jul 24, 2024
…464)

Follow up to #463
As per Zoom discussion, BMX will always print parameter value & source
if and only if it's provided via CLI args or config file.

I also made it colourful for legibility. The line seems too long and
crowded without these colours.
![image](https://github.com/user-attachments/assets/27461fa6-2b9a-48a1-946e-5db92d244235)

The colours don't work if stdout is redirected, which is typical when
using `bmx print`. I know why this is happening. Will try to fix in a
separate PR.

https://desire2learn.atlassian.net/browse/VUL-423
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant