Commit b95f794
authored
Default --credential-auto to true when --credential-provider is set alone (#152)
## Summary
- `kernel auth connections create --domain foo.com --credential-provider
my-1p` currently builds a `CredentialReference` of `{ provider: "my-1p"
}` with no `path` and no `auto` flag. The API accepts that as a
valid-but-inert reference, so the managed auth session never fetches
credentials and dead-ends in `awaiting_input` (user gets prompted for
manual input).
- Default `auto: true` in that branch to match the dashboard's UX
([create-managed-auth-dialog.tsx](https://github.com/kernel/kernel/blob/main/packages/dashboard/src/components/create-managed-auth-dialog.tsx)),
where picking a provider without a specific item always means "look up
by domain".
- Explicit `--credential-path` still pins the reference (no implicit
auto). Explicit `--credential-auto` is now redundant but still honored.
- Update the help text to document the new default.
Companion API/workflow fix: kernel/kernel#1794 —
without that PR, even a correctly-sent `auto: true` is ignored by the
CUA managed auth path.
## Test plan
- [x] `go build ./...`
- [x] `go test ./cmd/ -count=1` (full suite passes; 4 new focused cases)
- [x] New cases pin all four branches:
- `--credential-provider` alone → `auto: true` defaulted
- `--credential-provider` + `--credential-path` → no implicit auto
- `--credential-provider` + `--credential-auto` → auto honored
- `--credential-name` → unaffected by auto default
- [ ] Smoke: against staging, run `kernel auth connections create
--domain google.com --profile-name pn --credential-provider my-1p` and
confirm the resulting connection resolves credentials without prompting.
Made with [Cursor](https://cursor.com)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Small CLI request-mapping change with targeted tests; primary risk is
a behavior change for users who previously relied on provider-only
meaning “no lookup,” which is unlikely/intended to be inert anyway.
>
> **Overview**
> Fixes `kernel auth connections create` so that providing
`--credential-provider` without `--credential-path` implicitly sets
`credential.auto=true`, avoiding a valid-but-inert credential reference
that would stall managed auth sessions.
>
> Updates the `--credential-auto` flag help text to document the new
default, and adds focused regression tests covering provider-only,
provider+path, explicit `--credential-auto`, and `--credential-name`
branches.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
39c0423. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent f83a233 commit b95f794
2 files changed
Lines changed: 125 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
| |||
797 | 805 | | |
798 | 806 | | |
799 | 807 | | |
800 | | - | |
| 808 | + | |
801 | 809 | | |
802 | 810 | | |
803 | 811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
208 | 324 | | |
209 | 325 | | |
210 | 326 | | |
| |||
0 commit comments