DiscoveryToken returns OmitAuthToken if the first registered auth mode is of type None, and Token() otherwise.
()
| 457 | // DiscoveryToken returns OmitAuthToken if the first registered auth mode is of |
| 458 | // type None, and Token() otherwise. |
| 459 | func DiscoveryToken() string { |
| 460 | if len(modes) == 0 { |
| 461 | return Token() |
| 462 | } |
| 463 | if _, ok := modes[0].(None); ok { |
| 464 | return OmitAuthToken |
| 465 | } |
| 466 | return Token() |
| 467 | } |
| 468 | |
| 469 | // TokenOrNone returns a token auth mode if token is not OmitAuthToken, and |
| 470 | // otherwise a None auth mode. |