authproxy

package
v0.0.0-...-34898ab Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 18 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 New

func New(cfg *setting.Cfg, options *Options) *AuthProxy

New instance of the AuthProxy.

func (*AuthProxy) GetSignedInUser

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

GetSignedUser gets full signed in 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() 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(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 the error message.

type Options

type Options struct {
	RemoteCache *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