bouncer/internal/proxy/director/layer/authn/authenticator.go
William Petit 22fda4ed54
All checks were successful
Cadoles/bouncer/pipeline/pr-develop This commit looks good
feat: new openid connect authentication layer
2024-05-17 11:07:21 +02:00

27 lines
643 B
Go

package authn
import (
"net/http"
"forge.cadoles.com/cadoles/bouncer/internal/store"
"github.com/pkg/errors"
)
var (
ErrUnauthorized = errors.New("unauthorized")
ErrForbidden = errors.New("forbidden")
ErrSkipRequest = errors.New("skip request")
)
type Authenticator interface {
Authenticate(w http.ResponseWriter, r *http.Request, layer *store.Layer) (*User, error)
}
type PreAuthentication interface {
PreAuthentication(w http.ResponseWriter, r *http.Request, layer *store.Layer) error
}
type PostAuthentication interface {
PostAuthentication(w http.ResponseWriter, r *http.Request, layer *store.Layer, user *User) error
}