Commit e30f8ae
committed
fix(cli): accept --auth=false / --auth false (and same for every bool flag)
Operator feedback: someone tried `--auth=false` and `--auth false` to
explicitly disable auth, both errored with "unexpected value 'false'
for '--auth' found". They then read the policy error message — which
described state as "auth=false on a non-loopback bind ..." — and
reasonably mistook that for a CLI hint.
Two changes to make the surface match the expectation.
1. Every `bool` flag in `Config` now accepts:
- `--flag` (bare, resolves to true)
- `--flag=true`
- `--flag=false`
- `--flag true`
- `--flag false`
Absence still falls through to `default_value_t = false`.
Implementation: clap's default `bool` action is `SetTrue`, which is
the bare-`--flag`-only form. Switching to `ArgAction::Set` with
`num_args = 0..=1` + `default_missing_value = "true"` keeps the
bare form working and adds the explicit-value forms most operators
expect from kubectl/helm.
Applied uniformly to: `trino_ssl`, `trino_tls_no_verify`,
`trino_allow_plaintext_auth`, `auth`, `allow_insecure_listener`.
2. The policy error for "auth disabled on non-loopback bind" used to
open with the phrase `--auth=false on a non-loopback bind ...`,
which reads as if `--auth=false` is a valid CLI flag (the source
of the original confusion). Reworded to describe the state in
plain English and lay out the three opt-in choices (loopback,
`--auth` + TLS, `--allow-insecure-listener`) as a numbered list
so the user can pick directly. No information lost; clarity
added.
Verified manually with the gateway binary: all five `--auth`
forms parse, both with and without the surrounding policy gates
firing. Existing policy unit tests (191 passing) unchanged.1 parent 5b544f3 commit e30f8ae
2 files changed
Lines changed: 26 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
6 | 18 | | |
7 | 19 | | |
8 | 20 | | |
| |||
47 | 59 | | |
48 | 60 | | |
49 | 61 | | |
50 | | - | |
| 62 | + | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
56 | | - | |
| 68 | + | |
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
63 | 75 | | |
64 | | - | |
| 76 | + | |
65 | 77 | | |
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
69 | 81 | | |
70 | | - | |
| 82 | + | |
71 | 83 | | |
72 | 84 | | |
73 | 85 | | |
| |||
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
79 | | - | |
| 91 | + | |
80 | 92 | | |
81 | 93 | | |
82 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
| |||
0 commit comments