webhookd/pkg/auth/authenticator.go
2023-10-03 20:57:24 +00:00

12 lines
296 B
Go

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