| 364 | } |
| 365 | |
| 366 | func (c GSSAPIAuthConfig) Validate() error { |
| 367 | if err := c.Method.Validate(); err != nil { |
| 368 | return wrap(err, "method") |
| 369 | } |
| 370 | switch c.Method { |
| 371 | case GSSAPIAuthMethodDisabled: |
| 372 | return nil |
| 373 | case GSSAPIAuthMethodKerberos: |
| 374 | return wrap(c.Kerberos.Validate(), "kerberos") |
| 375 | default: |
| 376 | return newError("method", "BUG: unsupported GSSAPI authentication method: %s", c.Method) |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | // GSSAPIAuthMethod provides the methods usable for GSSAPI authentication. |
| 381 | type GSSAPIAuthMethod string |