mod_auth_request

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 19 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 (
	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
}

rule conf parsed from rule file

func AuthRequestRuleFileLoad

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

type AuthRequestRuleFile

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

rule loaded from file

type AuthRequestRuleList

type AuthRequestRuleList []AuthRequestRule // rule list

type AuthRequestRuleRaw

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

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