oauthrefresh

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 10 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

Overview

Package oauthrefresh exchanges a stored OAuth refresh grant for an access token.

Index

Constants

This section is empty.

Variables

View Source
var ErrRefresh = errors.New("OAuth credential refresh failed")

Functions

This section is empty.

Types

type Client

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

Client has immutable network policy. Grant state belongs to PostgreSQL, not a process-local TokenSource cache, so replacement and deletion stay authoritative.

func NewClient

func NewClient(privateOrigins []string) (*Client, error)

NewClient permits public HTTPS endpoints by default. Operators may trust exact HTTPS origins for private issuers; tenants cannot relax this network policy.

func (*Client) Refresh

func (c *Client) Refresh(ctx context.Context, input Request) (Token, error)

type Refresher

type Refresher interface {
	Refresh(context.Context, Request) (Token, error)
}

Refresher is the narrow network boundary used by credential persistence.

type Request

type Request struct {
	TokenEndpoint, ClientID, AuthMethod, ClientSecret, RefreshToken string
	Resource, Scope                                                 *string
}

Request is private execution input. Never log it or return it as metadata.

type Token

type Token struct {
	AccessToken, RefreshToken string
	ExpiresAt                 *time.Time
}

Token contains only the new grant material returned by the token endpoint. An omitted RefreshToken leaves the stored refresh token unchanged.

Jump to

Keyboard shortcuts

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