Documentation ¶
Overview ¶
Package auth provides authentication method
Index ¶
Constants ¶
View Source
const ( Username string = "admin" Password string = "nimda" )
Variables ¶
This section is empty.
Functions ¶
func GetAuthenticationHeader ¶
func GetAuthenticationHeader(authentication Authentication, token string) string
func RegisterAuthentication ¶
func RegisterAuthentication(name string, f AuthenticationFunc)
Types ¶
type Authentication ¶
type Authentication interface { // Name identify the system Name() string // Scheme used into the :authorization header Key() string // Credentials check username and password and returns a token Credentials(ctx context.Context, parentSpan opentracing.Span, username string, password string) (string, error) // Authenticate check the authentication challenge Authenticate(ctx context.Context, parentSpan opentracing.Span, token string) (map[string]string, error) }
Authentication define an authentication system
func New ¶
func New(conf *config.Configuration) (Authentication, error)
New returns a new authentication system using the name
type AuthenticationFunc ¶
type AuthenticationFunc func(config *config.Configuration) (Authentication, error)
Click to show internal directories.
Click to hide internal directories.