Commit 635ec36
committed
examples: honor allowed credential types when prompting user
Credential callback are being passed a bitset that indicates
which credential types are allowed in the current context. In our
examples code, we completely ignore that field and always return
username/password credentials, which doesn't necessarily make
sense e.g. when only SSH keys are allowed.
Refactor the code and only return username/password credentials
in the case where `USERPASS_PLAINTEXT` credentials are allowed.
Otherwise, return a positive error code to indicate that no
credentials could be acquired.1 parent b106620 commit 635ec36
1 file changed
+20
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
333 | 346 | | |
334 | 347 | | |
335 | 348 | | |
336 | 349 | | |
337 | 350 | | |
338 | 351 | | |
339 | 352 | | |
340 | | - | |
| 353 | + | |
341 | 354 | | |
342 | 355 | | |
343 | 356 | | |
344 | | - | |
345 | 357 | | |
346 | 358 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
352 | 363 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
| 364 | + | |
359 | 365 | | |
360 | 366 | | |
361 | | - | |
362 | | - | |
| 367 | + | |
363 | 368 | | |
364 | 369 | | |
365 | | - | |
366 | 370 | | |
367 | 371 | | |
0 commit comments