services

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AntiBruteForceService

type AntiBruteForceService struct {
	BucketStorage interfaces.BucketStorage
	ConfigStorage interfaces.ConfigStorage
	LoginLimit    uint64
	PasswordLimit uint64
	IPLimit       uint64
}

AntiBruteForceService struct

func NewAntiBruteForceService

func NewAntiBruteForceService(
	bucketStorage interfaces.BucketStorage, configStorage interfaces.ConfigStorage, loginLimit uint64,
	passwordLimit uint64, ipLimit uint64) *AntiBruteForceService

NewAntiBruteForceService Constructor for AntiBruteForceService

func (*AntiBruteForceService) AddToBlackList

func (a *AntiBruteForceService) AddToBlackList(ctx context.Context, n *net.IPNet) error

AddToBlackList Method to add IP address to Blacklist

func (*AntiBruteForceService) AddToWhiteList

func (a *AntiBruteForceService) AddToWhiteList(ctx context.Context, n *net.IPNet) error

AddToWhiteList Method to add IP address to Whitelist

func (*AntiBruteForceService) CheckAuth

func (a *AntiBruteForceService) CheckAuth(ctx context.Context, auth *models.Auth) (bool, error)

CheckAuth Method to check limits for Auth

func (*AntiBruteForceService) CheckBucketLimit

func (a *AntiBruteForceService) CheckBucketLimit(ctx context.Context, id string, rate uint64) (bool, error)

CheckBucketLimit Method to check limit for particular bucket

func (*AntiBruteForceService) DeleteFromBlackList

func (a *AntiBruteForceService) DeleteFromBlackList(ctx context.Context, n *net.IPNet) error

DeleteFromBlackList Method to add IP address from Blacklist

func (*AntiBruteForceService) DeleteFromWhiteList

func (a *AntiBruteForceService) DeleteFromWhiteList(ctx context.Context, n *net.IPNet) error

DeleteFromWhiteList Method to delete IP address from Whitelist

func (*AntiBruteForceService) ResetLimit

func (a *AntiBruteForceService) ResetLimit(ctx context.Context, login string, ip *net.IP) error

ResetLimit Method to reset limits for login/IP address pair

Jump to

Keyboard shortcuts

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