authproxy

package
v0.0.0-...-34a2968 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// CachePrefix is a prefix for the cache key
	CachePrefix = "auth-proxy-sync-ttl:%s"
)

Variables

This section is empty.

Functions

func HashCacheKey

func HashCacheKey(key string) string

Types

type AuthProxy

type AuthProxy struct {
	LDAPAllowSignup     bool
	AuthProxyAutoSignUp bool
	// contains filtered or unexported fields
}

AuthProxy struct

func New

func New(options *Options) *AuthProxy

New instance of the AuthProxy

func (*AuthProxy) GetSignedUser

func (auth *AuthProxy) GetSignedUser(userID int64) (*models.SignedInUser, *Error)

GetSignedUser gets full signed user info.

func (*AuthProxy) GetUserViaCache

func (auth *AuthProxy) GetUserViaCache(logger log.Logger) (int64, error)

GetUserViaCache gets user ID from cache.

func (*AuthProxy) HasHeader

func (auth *AuthProxy) HasHeader() bool

HasHeader checks if the we have specified header

func (*AuthProxy) IsAllowedIP

func (auth *AuthProxy) IsAllowedIP() (bool, *Error)

IsAllowedIP compares presented IP with the whitelist one

func (*AuthProxy) IsEnabled

func (auth *AuthProxy) IsEnabled() bool

IsEnabled checks if the proxy auth is enabled

func (*AuthProxy) Login

func (auth *AuthProxy) Login(logger log.Logger, ignoreCache bool) (int64, *Error)

Login logs in user ID by whatever means possible.

func (*AuthProxy) LoginViaHeader

func (auth *AuthProxy) LoginViaHeader() (int64, error)

LoginViaHeader logs in user from the header only

func (*AuthProxy) LoginViaLDAP

func (auth *AuthProxy) LoginViaLDAP() (int64, *Error)

LoginViaLDAP logs in user via LDAP request

func (*AuthProxy) Remember

func (auth *AuthProxy) Remember(id int64) *Error

Remember user in cache

func (*AuthProxy) RemoveUserFromCache

func (auth *AuthProxy) RemoveUserFromCache(logger log.Logger) error

RemoveUserFromCache removes user from cache.

type Error

type Error struct {
	Message      string
	DetailsError error
}

Error auth proxy specific error

func (*Error) Error

func (err *Error) Error() string

Error returns a Error error string

type Options

type Options struct {
	Store *remotecache.RemoteCache
	Ctx   *models.ReqContext
	OrgID int64
}

Options for the AuthProxy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL