daytonaio/enterprise-demo

Idp Client Secret TUI has no feedback for the value

SvenDowideit opened this issue · 6 comments

so I ended up pasting it three times before deciding that maybe the field didn't have **** like feedback

at this point, I don't know if daytona-enterprise has the ability to check my choices, and tell me to try again

Hi @SvenDowideit!

First one is more of a design/simplicity question. So, in bash, for example to show the asterisk for every character input code would need to be adjusted from

            if [ "$var_name" == "IDP_SECRET" ]; then
                read -rs -p "$prompt" "${var_name?}"

to

            if [ "$var_name" == "IDP_SECRET" ]; then
                unset password
                echo -n "$prompt"
                while IFS= read -r -s -n 1 char; do
                    # Enter - accept password
                    if [[ $char == $'\0' ]] || [[ $char == $'\n' ]]; then
                        break
                    fi
                    # Backspace
                    if [[ $char == $'\177' ]]; then
                        prompt=$'\b \b'
                        password="${password%?}"
                    else
                        prompt='*'
                        password+="$char"
                        echo -n "*"
                    fi
                done
                echo
                declare -g "$var_name=$password"

And probably backspace handling is also dependent on the terminal setting, environment etc. So we decided to be simple and just inform user that input will not be shown Enter IdP Client Secret [IDP_SECRET] (input hidden):. Also usually people will c/p this anyway.

As for validation part...To tell you the truth, I wasn't considering that before, but it is also a little bit complicated. After you set those 2 IDP values (ID and SECRET) we would need to check it agains provider API if they are valid. Since we support multiple IdP it would be some IFs to do it. Haven't tried it though...

But recommendation to run the setup.sh script is to provide all those values via CLI so you are sure in values and all. I run it only like that since its a lot easier to quickly remove everything and rerun it.

Let me know if this helps, and also if you have any idea how to simply do both...by all means 😄

This Issue has been automatically marked as "stale" because it has not had recent activity (for 14 days). It will be closed if no further activity occurs. Thanks for the feedback.

grin - yeah, my first thought was ... don't use bash, go straight to doing it in the go code using charmbracelet :)

This Issue has been automatically marked as "stale" because it has not had recent activity (for 14 days). It will be closed if no further activity occurs. Thanks for the feedback.

Due to the lack of activity in the last 7 days since it was marked as "stale", we are closing this Issue. Do not hesitate to reopen it later if necessary.

Closed with #52

This is not needed anymore. IdP is set through admin portal once installation is done.