tokidoki/auth/interface.go
2022-02-23 21:09:20 +01:00

24 lines
392 B
Go

package auth
import (
"net/http"
)
var AuthCtxKey = &contextKey{"auth"}
type contextKey struct {
name string
}
type AuthContext struct {
AuthMethod string
UserName string
// TODO more?
}
// Abstracts the authentication backend for the server.
type AuthProvider interface {
// Returns HTTP middleware for performing authentication.
Middleware() func(http.Handler) http.Handler
}