authenticator.go 296 B

1234567891011
  1. package auth
  2. import (
  3. "net/http"
  4. )
  5. // Authenticator is a generic interface to validate HTTP request credentials.
  6. // It's returns the authentication result along with the principal (username) if it has one.
  7. type Authenticator interface {
  8. Validate(r *http.Request) (ok bool, username string)
  9. }