Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppMetadata ¶
type AuthService ¶
type AuthService interface { AuthFromHeader(r *http.Request) (*http.Request, error) AuthFromCookie(r *http.Request) (*http.Request, error) HasRole(r *http.Request, role string) (err error) }
func NewService ¶
func NewService(isLambda bool) AuthService
type JWT ¶
type JWT struct { Identity Identity `json:"identity"` SiteURL string `json:"site_url"` User User `json:"user"` }
func FromContext ¶
func FromCookie ¶
Danger! Does not verify JWT! Do not use in insecure context.
type MockAuthService ¶
type MockAuthService struct{}
func (MockAuthService) AuthFromCookie ¶
func (MockAuthService) AuthFromHeader ¶
type NetlifyAuth ¶
type NetlifyAuth struct{}
func (NetlifyAuth) AuthFromCookie ¶
func (NetlifyAuth) AuthFromHeader ¶
type User ¶
type User struct { AppMetadata AppMetadata `json:"app_metadata"` Email string `json:"email"` Exp int `json:"exp"` Sub string `json:"sub"` UserMetadata UserMetadata `json:"user_metadata"` }
type UserMetadata ¶
type UserMetadata struct {
FullName string `json:"full_name"`
}
Click to show internal directories.
Click to hide internal directories.