Help us shape the future of Go! Take the 2026 Go Developer Survey

refresh

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package refresh implements rotating refresh-token exchange logic.

Index

Constants

View Source
const (
	// InvalidGrant means the supplied grant is unusable.
	InvalidGrant = "invalid_grant"
	// InvalidScope means the requested scope exceeds the original grant.
	InvalidScope = "invalid_scope"
	// Temporary means the operation can be retried.
	Temporary = "temporarily_unavailable"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Failure

type Failure struct {
	Code                    string
	Description, RetryAfter string
}

Failure is a sanitized refresh exchange failure.

type Request

type Request struct{ Token, ClientID, Scope string }

Request contains the protocol-independent refresh request.

type Result

type Result struct {
	AccessToken, IDToken, RefreshToken, Scope, SID, DPoPJKT string
	AccessExpiry                                            time.Time
}

Result contains newly issued rotating token material.

type Service

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

Service executes refresh grants against current policy and upstream state.

func NewService

func NewService(cfg *config.Config, store *statedb.Store, signer *tokens.Signer, connectors map[string]upstream.Connector, logger *slog.Logger, resolver policyResolver) *Service

NewService creates a refresh exchange service.

func (*Service) Exchange

func (s *Service) Exchange(ctx context.Context, req Request) (Result, *Failure)

Exchange validates, narrows, and rotates one refresh grant.

Jump to

Keyboard shortcuts

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