Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RealIPFromRequest ¶
func Register ¶
func Register(name string, factory FactoryFunc)
func WithCredentials ¶
func WithCredentials(ctx context.Context, credentials Credentials) context.Context
WithCredentials creates a child context containing in it the `Credentials` object.
Types ¶
type AnonymousCredentials ¶
type AnonymousCredentials struct {
// contains filtered or unexported fields
}
func (*AnonymousCredentials) GetLogFields ¶
func (c *AnonymousCredentials) GetLogFields() []zap.Field
func (*AnonymousCredentials) GetUserID ¶
func (c *AnonymousCredentials) GetUserID() string
type Authenticator ¶
type Authenticator interface { IsAuthenticationTokenRequired() bool Check(ctx context.Context, token, ipAddress string) (context.Context, error) }
func New ¶
func New(config string) (Authenticator, error)
type Credentials ¶
func GetCredentials ¶
func GetCredentials(ctx context.Context) Credentials
GetCredentials extracts `Credentials` object from context if it exists, returning it if present and `nil` if not found.
type FactoryFunc ¶
type FactoryFunc func(config string) (Authenticator, error)
Click to show internal directories.
Click to hide internal directories.