postgres

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package postgres provides PostgreSQL storage for OAuth.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements oauth.Storage using PostgreSQL.

func New

func New(db *sql.DB) *Store

New creates a new PostgreSQL OAuth store.

func (*Store) CleanupExpiredCodes

func (s *Store) CleanupExpiredCodes(ctx context.Context) error

CleanupExpiredCodes removes expired authorization codes.

func (*Store) CleanupExpiredTokens

func (s *Store) CleanupExpiredTokens(ctx context.Context) error

CleanupExpiredTokens removes expired refresh tokens.

func (*Store) CreateClient

func (s *Store) CreateClient(ctx context.Context, client *oauth.Client) error

CreateClient creates a new OAuth client.

func (*Store) DeleteAuthorizationCode

func (s *Store) DeleteAuthorizationCode(ctx context.Context, codeValue string) error

DeleteAuthorizationCode deletes an authorization code.

func (*Store) DeleteClient

func (s *Store) DeleteClient(ctx context.Context, clientID string) error

DeleteClient deletes a client.

func (*Store) DeleteRefreshToken

func (s *Store) DeleteRefreshToken(ctx context.Context, tokenValue string) error

DeleteRefreshToken deletes a refresh token.

func (*Store) DeleteRefreshTokensForClient

func (s *Store) DeleteRefreshTokensForClient(ctx context.Context, clientID string) error

DeleteRefreshTokensForClient deletes all refresh tokens for a client.

func (*Store) GetAuthorizationCode

func (s *Store) GetAuthorizationCode(ctx context.Context, codeValue string) (*oauth.AuthorizationCode, error)

GetAuthorizationCode retrieves an authorization code.

func (*Store) GetClient

func (s *Store) GetClient(ctx context.Context, clientID string) (*oauth.Client, error)

GetClient retrieves a client by client ID.

func (*Store) GetRefreshToken

func (s *Store) GetRefreshToken(ctx context.Context, tokenValue string) (*oauth.RefreshToken, error)

GetRefreshToken retrieves a refresh token.

func (*Store) ListClients

func (s *Store) ListClients(ctx context.Context) ([]*oauth.Client, error)

ListClients lists all clients.

func (*Store) SaveAuthorizationCode

func (s *Store) SaveAuthorizationCode(ctx context.Context, code *oauth.AuthorizationCode) error

SaveAuthorizationCode saves an authorization code.

func (*Store) SaveRefreshToken

func (s *Store) SaveRefreshToken(ctx context.Context, token *oauth.RefreshToken) error

SaveRefreshToken saves a refresh token.

func (*Store) UpdateClient

func (s *Store) UpdateClient(ctx context.Context, client *oauth.Client) error

UpdateClient updates a client.

Jump to

Keyboard shortcuts

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