libhttp/auth.go

19 lines
390 B
Go

package libhttp
import "net/http"
type Authorizer[S Server] interface {
Module[S]
RequireAuth(r *http.Request) (Authorization, int, error)
}
type Authorization interface {
// AuthID returns a unique identifier for this account/user
AuthID() string
// Username returns the preferred username
Username() string
// Groups returns the resolved group memberships
Groups() []string
}