oauthstate

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClaimSingleUse added in v1.15.14

func ClaimSingleUse(ctx context.Context, client *redis.Client, key string, now time.Time, grace, ttl time.Duration) (bool, error)

ClaimSingleUse reports whether a signed callback payload may be redeemed. It returns false once the payload has already been redeemed outside the retry grace window. The clock is supplied by the caller so the window is evaluated against the same time source as the payload's own freshness check.

func Consume

func Consume(ctx context.Context, client *redis.Client, key string) (string, error)

Consume atomically returns and deletes an OAuth state value. The Lua implementation keeps compatibility with Redis versions older than 6.2.

func PayloadFingerprint added in v1.15.14

func PayloadFingerprint(payload string) string

PayloadFingerprint derives the key material for a single-use claim. The signed callback itself is never stored, only its digest.

func ValidateRedirect added in v1.15.12

func ValidateRedirect(redirect, siteHost string) error

ValidateRedirect checks a client-supplied OAuth redirect target before it is stored as state and later used as a browser redirect. The scheme must be web-safe, and when the administrator configured a site host the redirect must stay on that host or one of its subdomains; an empty site host disables the host pin so existing deployments keep working.

Types

This section is empty.

Jump to

Keyboard shortcuts

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