Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DenyWith ¶
func DenyWith(info AuthFailureInfo) error
func ErrorWith ¶
func ErrorWith(err error, info AuthFailureInfo) error
Types ¶
type AnyOfGatekeepers ¶
type AnyOfGatekeepers []Gatekeeper
func (AnyOfGatekeepers) CheckAuth ¶
func (a AnyOfGatekeepers) CheckAuth(r *http.Request) (*AuthSuccessInfo, error)
func (AnyOfGatekeepers) DemandAuth ¶
func (a AnyOfGatekeepers) DemandAuth(w http.ResponseWriter) error
func (AnyOfGatekeepers) GatekeeperDescription ¶
func (a AnyOfGatekeepers) GatekeeperDescription() string
type AttemptInfo ¶
type AuthFailureInfo ¶
type AuthFailureInfo struct {
Attempt AttemptInfo `json:"attempt"`
}
type AuthProvider ¶
type AuthProvider interface {
MakeAuthHeaders(ctx RequestContext) (map[string]string, error)
}
type AuthSuccessInfo ¶
type AuthSuccessInfo struct {
Attempt AttemptInfo `json:"attempt"`
}
type ErrorWithFailureInfo ¶
type ErrorWithFailureInfo interface {
AuthFailureInfo() AuthFailureInfo
}
type Gatekeeper ¶
type Gatekeeper interface { CheckAuth(r *http.Request) (*AuthSuccessInfo, error) DemandAuth(w http.ResponseWriter) error GatekeeperDescription() string }
var AllowAll Gatekeeper = allowAll{}
var DenyAll Gatekeeper = denyAll{}
type RequestContext ¶
Click to show internal directories.
Click to hide internal directories.