Documentation
¶
Overview ¶
Package core holds what both the admin and the auth package need, so neither imports the other for it: auth registers its pages on a Site, and the Site takes an Authenticator. The public names are aliases of these (jetadmin.Authenticator, auth.User).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authenticator ¶
type Authenticator interface {
// Authenticate returns the admin user signed in on r.
Authenticate(r *http.Request) (User, bool)
}
Authenticator tells who is signed in on a request.
type Chrome ¶
Chrome is what a page outside the Site's own handlers (the login page of an Authenticator) needs to look like the rest of the admin. The Site puts it in the request's context.
func ChromeFrom ¶
ChromeFrom is the Chrome of ctx, or a plain one when the handler runs outside a Site (a test).
type LoginProvider ¶
type LoginProvider interface {
Authenticator
LoginHandler() http.Handler
LogoutHandler() http.Handler
}
LoginProvider is an Authenticator that also serves the sign-in and sign-out pages; the Site mounts them at BasePath/login and BasePath/logout.