mod_auth_request

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModAuthRequest         = "mod_auth_request"
	DiffInterval           = 20 // interval for diff counter (in seconds)
	DelayConterInterval    = 60 // interval for moving current to past (in s)
	DelayCounterBucketSize = 1  // size of delay counter bucket (in ms)
	DelayCounterBucketNum  = 20 // number of delay counter bucket

	XForwardedMethod = "X-Forwarded-Method"
	XForwardedURI    = "X-Forwarded-Uri"
)

Variables

View Source
var (
	ErrAuthRequest = errors.New("AUTH_REQ_FORBIDDEN")
)

Functions

func AuthRequestRuleCheck

func AuthRequestRuleCheck(authRequestRuleFile *AuthRequestRuleFile) error

Types

type AuthRequestRule

type AuthRequestRule struct {
	Cond   condition.Condition
	Enable bool
}

type AuthRequestRuleConf

type AuthRequestRuleConf struct {
	Version string
	Config  ProductRuleList // product => rule list
}

func AuthRequestRuleFileLoad

func AuthRequestRuleFileLoad(filename string) (*AuthRequestRuleConf, error)

type AuthRequestRuleFile

type AuthRequestRuleFile struct {
	Version string
	Config  ProductRuleRawList // product => raw rule list
}

type AuthRequestRuleList

type AuthRequestRuleList []AuthRequestRule // rule list

type AuthRequestRuleRaw

type AuthRequestRuleRaw struct {
	Cond   string // condition
	Enable bool   // whether enable auth request
}

type AuthRequestRuleTable

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

func NewAuthRequestRuleTable

func NewAuthRequestRuleTable() *AuthRequestRuleTable

func (*AuthRequestRuleTable) Search

func (t *AuthRequestRuleTable) Search(product string) (AuthRequestRuleList, bool)

func (*AuthRequestRuleTable) Update

func (t *AuthRequestRuleTable) Update(ruleConf *AuthRequestRuleConf)

type ConfModAuthRequest

type ConfModAuthRequest struct {
	Basic struct {
		DataPath    string // path of rule data
		AuthAddress string // address of auth server
		AuthTimeout int    // timeout for auth request (in ms)
	}

	Log struct {
		OpenDebug bool
	}
}

func ConfLoad

func ConfLoad(filePath string, confRoot string) (*ConfModAuthRequest, error)

func (*ConfModAuthRequest) Check

func (cfg *ConfModAuthRequest) Check(confRoot string) error

type ModuleAuthRequest

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

func NewModuleAuthRequest

func NewModuleAuthRequest() *ModuleAuthRequest

func (*ModuleAuthRequest) Init

func (*ModuleAuthRequest) Name

func (m *ModuleAuthRequest) Name() string

type ModuleAuthRequestState

type ModuleAuthRequestState struct {
	AuthRequestChecked      *metrics.Counter
	AuthRequestPass         *metrics.Counter
	AuthRequestForbidden    *metrics.Counter
	AuthRequestUnauthorized *metrics.Counter
	AuthRequestFail         *metrics.Counter
	AuthRequestUncertain    *metrics.Counter
}

type ProductRuleList

type ProductRuleList map[string]AuthRequestRuleList // product => rule list

type ProductRuleRawList

type ProductRuleRawList map[string]RuleRawList // product => raw rule list

type RuleRawList

type RuleRawList []AuthRequestRuleRaw // raw rule list

Jump to

Keyboard shortcuts

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