auth

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	KindNop     = "nop"
	KindIguazio = "iguazio"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	Authenticate(request *http.Request, options *Options) (Session, error)
	Middleware(options *Options) func(http.Handler) http.Handler
	Kind() Kind
}

type Config

type Config struct {
	Kind    Kind
	Iguazio *IguazioConfig
}

func NewConfig

func NewConfig(kind Kind) *Config

type IguazioConfig

type IguazioConfig struct {
	Timeout                       time.Duration
	VerificationURL               string
	VerificationMethod            string
	VerificationDataEnrichmentURL string
	CacheSize                     int
	CacheExpirationTimeout        time.Duration
	SkipTLSVerification           bool
}

type IguazioSession

type IguazioSession struct {
	Username   string
	SessionKey string
	UserID     string
	GroupIDs   []string
	// contains filtered or unexported fields
}

func (*IguazioSession) CompileAuthorizationBasic

func (a *IguazioSession) CompileAuthorizationBasic() string

func (*IguazioSession) GetGroupIDs

func (a *IguazioSession) GetGroupIDs() []string

func (*IguazioSession) GetPassword

func (a *IguazioSession) GetPassword() string

func (*IguazioSession) GetUserID

func (a *IguazioSession) GetUserID() string

func (*IguazioSession) GetUsername

func (a *IguazioSession) GetUsername() string

type Kind

type Kind string

type NopSession

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

func (NopSession) CompileAuthorizationBasic

func (a NopSession) CompileAuthorizationBasic() string

func (NopSession) GetGroupIDs

func (a NopSession) GetGroupIDs() []string

func (NopSession) GetPassword

func (a NopSession) GetPassword() string

func (NopSession) GetUserID

func (a NopSession) GetUserID() string

func (NopSession) GetUsername

func (a NopSession) GetUsername() string

type Options

type Options struct {
	EnrichDataPlane bool
}

type Session

type Session interface {
	GetUsername() string
	GetPassword() string
	GetUserID() string
	GetGroupIDs() []string
	CompileAuthorizationBasic() string
}

type SessionContextKey

type SessionContextKey string
const (
	IguazioContextKey     SessionContextKey = "IguazioSession"
	NopContextKey         SessionContextKey = "NopSession"
	AuthSessionContextKey SessionContextKey = "AuthSession"
)

func ContextKeyByKind

func ContextKeyByKind(kind Kind) SessionContextKey

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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