| 321 | } |
| 322 | |
| 323 | func (c KeyboardInteractiveAuthConfig) Validate() error { |
| 324 | if err := c.Method.Validate(); err != nil { |
| 325 | return wrap(err, "method") |
| 326 | } |
| 327 | switch c.Method { |
| 328 | case KeyboardInteractiveAuthMethodDisabled: |
| 329 | return nil |
| 330 | case KeyboardInteractiveAuthMethodOAuth2: |
| 331 | return wrap(c.OAuth2.Validate(), "oauth2") |
| 332 | default: |
| 333 | return newError("method", "BUG: unsupported keyboard-interactive authentication method: %s", c.Method) |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | // KeyboardInteractiveAuthMethod provides the methods usable for keyboard-interactive authentication. |
| 338 | type KeyboardInteractiveAuthMethod string |