authspam

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRateLimited = errors.New("rate limited")

Functions

This section is empty.

Types

type RateLimitedError

type RateLimitedError struct {
	RetryAfter time.Duration
}

func (RateLimitedError) Error

func (e RateLimitedError) Error() string

func (RateLimitedError) Unwrap

func (e RateLimitedError) Unwrap() error

type Service

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

Service is a fixed-window limiter for the single API replica. Entries expire at the end of their configured window and are removed during checks.

func NewService

func NewService(cfg config.AuthRateLimitConfig) *Service

func (*Service) CheckDeviceCodeCreate

func (s *Service) CheckDeviceCodeCreate(ctx context.Context, clientInfo requestmeta.ClientInfo) error

func (*Service) CheckDeviceDecision

func (s *Service) CheckDeviceDecision(ctx context.Context, username string, clientInfo requestmeta.ClientInfo) error

func (*Service) CheckDeviceTokenExchange

func (s *Service) CheckDeviceTokenExchange(ctx context.Context, clientInfo requestmeta.ClientInfo) error

func (*Service) CheckLogout

func (s *Service) CheckLogout(ctx context.Context, clientInfo requestmeta.ClientInfo) error

func (*Service) CheckRefreshToken

func (s *Service) CheckRefreshToken(ctx context.Context, clientInfo requestmeta.ClientInfo) error

Jump to

Keyboard shortcuts

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