Commit 4e5e37a
authored
fix(cli-repl): invert and fix passwordless-auth-mechanism check (#1533)
Currently, if a username is specified but no password, mongosh
will prompt for a password before connecting.
Kerberos/GSSAPI was made an exception, since it rarely makes use
of a password. However, there are other mechanisms where a username
can, and often will, be provided without a password (AWS, OIDC,
and technically even X.509).
This commit prevents mongosh from prompting for a password for those
mechanisms, and inverts the check to explicitly list the mechanisms
that *do* require a password (the list of auth mechanisms is unlikely
to change soon, but if it does, it likely wouldn’t include a new
password-based auth mechanism, so avoiding false positive return values
seems like a better choice than avoiding false negative return values).1 parent d5530af commit 4e5e37a
2 files changed
+22
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
812 | 813 | | |
813 | 814 | | |
814 | 815 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
147 | 163 | | |
148 | 164 | | |
149 | 165 | | |
| |||
0 commit comments