Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthN ¶
AuthN is an authentication provider.
It is responsible for taking raw HTTP Authorization data and determining whether the request is authenticated.
type BasicAuth ¶
type BasicAuth struct {
Users UserPasswordLookup
}
BasicAuth is an authentication provider for type HTTP Basic Auth.
type HTTPAuth ¶
type HTTPAuth struct { Realm string // contains filtered or unexported fields }
HTTPAuth provides HTTP authentication services.
func NewBasicHTTPAuth ¶
func NewBasicHTTPAuth(pwdb UserPasswordLookup) *HTTPAuth
Create a new HTTPAuth object with HTTP Basic support.
This requires a UserPasswordLookup service.
func (*HTTPAuth) Authenticate ¶
This will attempt to authenticate, and return an HTTP error if auth fails.
If this returns `false`, a 403 Unauthorized response has already been sent.
type UserPasswordLookup ¶
type UserPasswordLookup interface { // IsValid looks up a username and password, and returns true if the auth is successful. // // An error is only returned if the underlying mechanism is failing. A false // with a nil error means the authentication simply failed. IsValid(username, password string) (bool, error) }
UserPasswordLookup provides services for lookup up a username/password combo.
Click to show internal directories.
Click to hide internal directories.