sqlcgen

package
v1.135.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRefreshTokenParams

type CreateRefreshTokenParams struct {
	Signature            string
	RequestID            string
	ClientID             string
	Subject              string
	RequestedScopes      []string
	GrantedScopes        []string
	RequestedAudiences   []string
	GrantedAudiences     []string
	FormData             string
	SessionData          []byte
	AccessTokenSignature string
	RequestedAt          pgtype.Timestamptz
	ExpiresAt            pgtype.Timestamptz
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type ListLiveScopesBySubjectAndClientParams added in v1.118.0

type ListLiveScopesBySubjectAndClientParams struct {
	Subject  string
	ClientID string
}

type LockSubjectClientParams added in v1.69.1

type LockSubjectClientParams struct {
	Subject  string
	ClientID string
}

type Querier

type Querier interface {
	CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) error
	// Only the signature names the presented token: request_id is shared by the
	// whole grant.
	DeactivateRefreshToken(ctx context.Context, signature string) (int64, error)
	DeleteRefreshToken(ctx context.Context, signature string) (int64, error)
	GetRefreshToken(ctx context.Context, signature string) (RefreshToken, error)
	ListLiveScopesBySubjectAndClient(ctx context.Context, arg ListLiveScopesBySubjectAndClientParams) ([][]string, error)
	// Rotation and de-authorization take this lock before touching any row of
	// the pair, so neither can commit rows the other's statements do not see.
	LockSubjectClient(ctx context.Context, arg LockSubjectClientParams) error
	// Rotation knows only the presented signature. Zero rows means the token is
	// gone, which the caller treats as inactive.
	LockSubjectClientBySignature(ctx context.Context, signature string) (int64, error)
	RevokeRefreshTokensByRequestID(ctx context.Context, requestID string) error
	RevokeRefreshTokensBySubjectAndClient(ctx context.Context, arg RevokeRefreshTokensBySubjectAndClientParams) (int64, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateRefreshToken

func (q *Queries) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) error

func (*Queries) DeactivateRefreshToken added in v1.82.1

func (q *Queries) DeactivateRefreshToken(ctx context.Context, signature string) (int64, error)

Only the signature names the presented token: request_id is shared by the whole grant.

func (*Queries) DeleteRefreshToken

func (q *Queries) DeleteRefreshToken(ctx context.Context, signature string) (int64, error)

func (*Queries) GetRefreshToken

func (q *Queries) GetRefreshToken(ctx context.Context, signature string) (RefreshToken, error)

func (*Queries) ListLiveScopesBySubjectAndClient added in v1.118.0

func (q *Queries) ListLiveScopesBySubjectAndClient(ctx context.Context, arg ListLiveScopesBySubjectAndClientParams) ([][]string, error)

func (*Queries) LockSubjectClient added in v1.69.1

func (q *Queries) LockSubjectClient(ctx context.Context, arg LockSubjectClientParams) error

Rotation and de-authorization take this lock before touching any row of the pair, so neither can commit rows the other's statements do not see.

func (*Queries) LockSubjectClientBySignature added in v1.69.1

func (q *Queries) LockSubjectClientBySignature(ctx context.Context, signature string) (int64, error)

Rotation knows only the presented signature. Zero rows means the token is gone, which the caller treats as inactive.

func (*Queries) RevokeRefreshTokensByRequestID

func (q *Queries) RevokeRefreshTokensByRequestID(ctx context.Context, requestID string) error

func (*Queries) RevokeRefreshTokensBySubjectAndClient added in v1.63.0

func (q *Queries) RevokeRefreshTokensBySubjectAndClient(ctx context.Context, arg RevokeRefreshTokensBySubjectAndClientParams) (int64, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type RefreshToken

type RefreshToken struct {
	Signature            string
	RequestID            string
	ClientID             string
	Subject              string
	RequestedScopes      []string
	GrantedScopes        []string
	RequestedAudiences   []string
	GrantedAudiences     []string
	FormData             string
	SessionData          []byte
	AccessTokenSignature string
	Active               bool
	RequestedAt          pgtype.Timestamptz
	ExpiresAt            pgtype.Timestamptz
	RevokedAt            pgtype.Timestamptz
}

type RevokeRefreshTokensBySubjectAndClientParams added in v1.63.0

type RevokeRefreshTokensBySubjectAndClientParams struct {
	Subject  string
	ClientID string
}

Jump to

Keyboard shortcuts

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