authproxy

package
v0.0.0-cloud Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 23 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, error)

Types

type AuthProxy

type AuthProxy struct {
	// contains filtered or unexported fields
}

AuthProxy struct

func ProvideAuthProxy

func ProvideAuthProxy(cfg *setting.Cfg, remoteCache *remotecache.RemoteCache,
	loginService login.Service, userService user.Service,
	sqlStore db.DB, ldapService service.LDAP) *AuthProxy

func (*AuthProxy) GetSignedInUser

func (auth *AuthProxy) GetSignedInUser(userID int64, orgID int64) (*user.SignedInUser, error)

GetSignedInUser gets full signed in user info.

func (*AuthProxy) HasHeader

func (auth *AuthProxy) HasHeader(reqCtx *contextmodel.ReqContext) bool

HasHeader checks if we have specified header

func (*AuthProxy) IsAllowedIP

func (auth *AuthProxy) IsAllowedIP(ip string) error

IsAllowedIP returns whether provided IP is allowed.

func (*AuthProxy) IsEnabled

func (auth *AuthProxy) IsEnabled() bool

IsEnabled checks if the auth proxy is enabled.

func (*AuthProxy) Login

func (auth *AuthProxy) Login(reqCtx *contextmodel.ReqContext, ignoreCache bool) (int64, error)

Login logs in user ID by whatever means possible.

func (*AuthProxy) LoginViaLDAP

func (auth *AuthProxy) LoginViaLDAP(reqCtx *contextmodel.ReqContext) (int64, error)

LoginViaLDAP logs in user via LDAP request

func (*AuthProxy) Remember

func (auth *AuthProxy) Remember(reqCtx *contextmodel.ReqContext, id int64) error

Remember user in cache

func (*AuthProxy) RemoveUserFromCache

func (auth *AuthProxy) RemoveUserFromCache(reqCtx *contextmodel.ReqContext) 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 the error message.

Jump to

Keyboard shortcuts

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