Documentation ¶
Index ¶
- func NewContext(ctx context.Context, a *AuthContext) context.Context
- type AuthContext
- type AuthProvider
- func NewFromURL(authURL string) (AuthProvider, error)
- func NewHtpasswd(location string) (AuthProvider, error)
- func NewIMAP(addr string, tls bool) AuthProvider
- func NewNull() (AuthProvider, error)
- func NewOAuth2(endpoint, clientID, clientSecret string) (AuthProvider, error)
- func NewPAM() (AuthProvider, error)
- type IMAPProvider
- type OAuth2Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext(ctx context.Context, a *AuthContext) context.Context
Types ¶
type AuthContext ¶
func FromContext ¶
func FromContext(ctx context.Context) (*AuthContext, bool)
type AuthProvider ¶
type AuthProvider interface { // Returns HTTP middleware for performing authentication. Middleware() func(http.Handler) http.Handler }
Abstracts the authentication backend for the server.
func NewFromURL ¶
func NewFromURL(authURL string) (AuthProvider, error)
func NewHtpasswd ¶
func NewHtpasswd(location string) (AuthProvider, error)
func NewIMAP ¶
func NewIMAP(addr string, tls bool) AuthProvider
Initializes a new IMAP auth provider with the given connection string.
func NewNull ¶
func NewNull() (AuthProvider, error)
func NewOAuth2 ¶
func NewOAuth2(endpoint, clientID, clientSecret string) (AuthProvider, error)
Initializes a new OAuth 2.0 auth provider with the given connection string.
func NewPAM ¶
func NewPAM() (AuthProvider, error)
type IMAPProvider ¶
type IMAPProvider struct {
// contains filtered or unexported fields
}
func (*IMAPProvider) Middleware ¶
func (prov *IMAPProvider) Middleware() func(http.Handler) http.Handler
type OAuth2Provider ¶
type OAuth2Provider struct {
// contains filtered or unexported fields
}
func (*OAuth2Provider) Middleware ¶
func (prov *OAuth2Provider) Middleware() func(http.Handler) http.Handler
Click to show internal directories.
Click to hide internal directories.