oauthgoreplay

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryReplayProtector

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

MemoryReplayProtector backed by memory using a map.

func (*MemoryReplayProtector) FirstSeen

func (m *MemoryReplayProtector) FirstSeen(ctx context.Context, key string, ttl time.Duration) (bool, error)

FirstSeen returns true on first observation, false if seen before.

type RedisReplayProtector

type RedisReplayProtector struct {
	Client *redis.Client
	Prefix string
}

RedisReplayProtector backed by Redis.

func (*RedisReplayProtector) FirstSeen

func (r *RedisReplayProtector) FirstSeen(ctx context.Context, key string, ttl time.Duration) (bool, error)

FirstSeen returns true on first observation, false if seen before.

type ReplayProtector

type ReplayProtector interface {
	// FirstSeen returns true on first observation, false if seen before.
	FirstSeen(ctx context.Context, key string, ttl time.Duration) (bool, error)
}

ReplayProtector prevents state/nonce reuse. FirstSeen returns true on first observation, false if seen before.

func NewMemoryReplayProtector

func NewMemoryReplayProtector() ReplayProtector

NewMemoryReplayProtector creates a new MemoryReplayProtector.

func NewRedisReplayProtector

func NewRedisReplayProtector(client *redis.Client, prefix string) ReplayProtector

NewRedisReplayProtector creates a new RedisReplayProtector.

Jump to

Keyboard shortcuts

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