Documentation
¶
Overview ¶
Package authenticator provides allows to authorize request
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CredentialsAuthFunc ¶
CredentialsAuthFunc returns Identity from username and password combination
type CredentialsAuthenticator ¶
type CredentialsAuthenticator interface { // FromBasicAuth authorize by the username and password provided in the request's // Authorization header, if the request uses HTTP Basic Authentication. FromBasicAuth(name string) func(next http.Handler) http.Handler }
CredentialsAuthenticator authorize by the username and password and adds Identity to request's Context
func NewCredentials ¶
func NewCredentials(afn CredentialsAuthFunc) CredentialsAuthenticator
NewCredentials returns new credentials authenticator
type TokenAuthFunc ¶
TokenAuthFunc returns Identity from token
type TokenAuthenticator ¶
type TokenAuthenticator interface { // FromHeader authorize by the token provided in the request's Authorization header FromHeader(realm string) func(next http.Handler) http.Handler // FromQuery authorize by the token provided in the request's query parameter FromQuery(name string) func(next http.Handler) http.Handler // FromCookie authorize by the token provided in the request's cookie FromCookie(name string) func(next http.Handler) http.Handler }
TokenAuthenticator authorize by token and adds Identity to request's Context
func NewToken ¶
func NewToken(afn TokenAuthFunc) TokenAuthenticator
NewToken returns new token authenticator
Click to show internal directories.
Click to hide internal directories.