v5

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 1 Imported by: 1 module, 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 v5 defines version 5 of the persisted OAuth store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ID                      string           `json:"id"`
	Name                    string           `json:"name"`
	RedirectURIs            []string         `json:"redirectURIs"`
	TokenEndpointAuthMethod string           `json:"tokenEndpointAuthMethod"`
	GrantTypes              []string         `json:"grantTypes,omitempty"`
	CreatedAt               time.Time        `json:"createdAt"`
	Provenance              ClientProvenance `json:"provenance,omitempty"`
}

Client is an OAuth client established by dynamic registration or verified metadata.

type ClientProvenance

type ClientProvenance string

ClientProvenance records how the authorization server established a client identity.

const (
	// ClientProvenanceDynamic identifies a locally persisted RFC 7591 registration.
	ClientProvenanceDynamic ClientProvenance = "dynamic_registration"
	// ClientProvenanceMetadata identifies a remotely verified Client ID Metadata Document.
	ClientProvenanceMetadata ClientProvenance = "client_id_metadata_document"
)

type Code

type Code struct {
	Authority     string    `json:"authority,omitempty"`
	UserID        string    `json:"userID"`
	ClientID      string    `json:"clientID"`
	RedirectURI   string    `json:"redirectURI"`
	CodeChallenge string    `json:"codeChallenge"`
	Resource      string    `json:"resource"`
	Scope         string    `json:"scope"`
	ExpiresAt     time.Time `json:"expiresAt"`
}

Code is an issued authorization code with PKCE binding.

type ConsentParams

type ConsentParams struct {
	Authority string            `json:"authority,omitempty"`
	UserID    string            `json:"userID"`
	Params    map[string]string `json:"params"`
	ExpiresAt time.Time         `json:"expiresAt"`
}

ConsentParams holds in-progress OAuth authorization consent state.

type DeviceCode

type DeviceCode struct {
	Authority   string    `json:"authority,omitempty"`
	UserCodeKey string    `json:"userCodeKey,omitempty"`
	ClientID    string    `json:"clientID"`
	Scope       string    `json:"scope"`
	UserID      string    `json:"userID,omitempty"`
	Status      string    `json:"status"`
	ExpiresAt   time.Time `json:"expiresAt"`
	IssuedAt    time.Time `json:"issuedAt"`
}

DeviceCode holds an in-progress device authorization flow (RFC 8628).

type Grant

type Grant struct {
	Authority  string    `json:"authority,omitempty"`
	ID         string    `json:"id"`
	UserID     string    `json:"userID"`
	ClientID   string    `json:"clientID"`
	ClientName string    `json:"clientName"`
	Resource   string    `json:"resource"`
	Scope      string    `json:"scope"`
	CreatedAt  time.Time `json:"createdAt"`
	LastUsedAt time.Time `json:"lastUsedAt,omitzero"`
	ExpiresAt  time.Time `json:"expiresAt"`
	RevokedAt  time.Time `json:"revokedAt,omitzero"`
}

Grant ties a user authorization grant to a client and token.

type RefreshToken

type RefreshToken struct {
	GrantID   string    `json:"grantID"`
	UserID    string    `json:"userID"`
	ClientID  string    `json:"clientID"`
	Resource  string    `json:"resource"`
	Scope     string    `json:"scope"`
	DPoPJKT   string    `json:"dpopJKT,omitempty"`
	ExpiresAt time.Time `json:"expiresAt"`
	UsedAt    time.Time `json:"usedAt,omitzero"`
	RevokedAt time.Time `json:"revokedAt,omitzero"`
}

RefreshToken is an opaque refresh token persisted by hash.

type SigningKey

type SigningKey struct {
	KID           string    `json:"kid"`
	PrivateKeyPEM string    `json:"privateKeyPEM"`
	VerifyUntil   time.Time `json:"verifyUntil,omitzero"`
}

SigningKey is the persisted OAuth access-token signing key.

type Store

type Store struct {
	Version                int                      `json:"version"`
	Clients                map[string]Client        `json:"clients,omitempty"`
	RefreshTokens          map[string]RefreshToken  `json:"refreshTokens,omitempty"`
	Grants                 map[string]Grant         `json:"grants,omitempty"`
	Codes                  map[string]Code          `json:"codes,omitempty"`
	Consents               map[string]ConsentParams `json:"consents,omitempty"`
	DeviceCodes            map[string]*DeviceCode   `json:"deviceCodes,omitempty"`
	DPoPProofs             map[string]time.Time     `json:"dpopProofs,omitempty"`
	DPoPNonces             map[string]time.Time     `json:"dpopNonces,omitempty"`
	ClientAssertionJTIs    map[string]time.Time     `json:"clientAssertionJTIs,omitempty"`
	AccessTokenSigningKeys []SigningKey             `json:"accessTokenSigningKeys,omitempty"`
	CurrentSigningKID      string                   `json:"currentSigningKID,omitempty"`
}

Store is the persisted OAuth store.

Jump to

Keyboard shortcuts

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