authspam

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 8 Imported by: 0 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

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