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

database

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertAuthentication

func InsertAuthentication(
	ctx context.Context,
	accountId string,
	idTokenHash []byte,
	expirationDuration time.Duration,
	metadata *authenticationPkg.ClientMetadata,
	database *sql.DB,
) (*authenticationPkg.Authentication, error)

func InsertDbscChallenge

func InsertDbscChallenge(
	ctx context.Context,
	challenge string,
	authenticationId string,
	expirationDuration time.Duration,
	db *sql.DB,
) error

func InsertOauthFlow

func InsertOauthFlow(
	ctx context.Context,
	state string,
	codeVerifier string,
	redirectUrl string,
	expirationDuration time.Duration,
	database *sql.DB,
) (*oauth_flow.Flow, error)

func PopDbscChallenge

func PopDbscChallenge(ctx context.Context, challenge string, authenticationId string, db *sql.DB) (*dbsc_challenge.Challenge, error)

func PopExpiredOauthFlowByState added in v1.22.0

func PopExpiredOauthFlowByState(ctx context.Context, state string, now time.Time, db *sql.DB) (*oauth_flow.Flow, error)

PopExpiredOauthFlowByState removes and returns the flow the state names if it expired by now; a live flow is neither removed nor returned. The code verifier is not returned: what is popped this way is never redeemed.

func PopOauthFlow

func PopOauthFlow(ctx context.Context, id string, db *sql.DB) (*oauth_flow.Flow, error)

func SelectEmailAddressAccount

func SelectEmailAddressAccount(ctx context.Context, emailAddress string, database *sql.DB) (*accountPkg.Account, error)

func SelectIdTokenHashUsed added in v1.13.0

func SelectIdTokenHashUsed(ctx context.Context, idTokenHash []byte, database *sql.DB) (bool, error)

SelectIdTokenHashUsed reports whether an authentication was already created from the token the hash names, which is what InsertAuthentication refuses a second time.

func SelectRefreshAuthentication

func SelectRefreshAuthentication(ctx context.Context, id string, database *sql.DB) (*authenticationPkg.Authentication, error)

func UpdateAuthenticationWithDbscPublicKey

func UpdateAuthenticationWithDbscPublicKey(ctx context.Context, id string, key []byte, database *sql.DB) error

func UpdateAuthenticationWithEnded

func UpdateAuthenticationWithEnded(ctx context.Context, id string, database *sql.DB) error

Types

This section is empty.

Directories

Path Synopsis
types
api_key
Package api_key holds the public keys an account registers to mint tokens with.
Package api_key holds the public keys an account registers to mint tokens with.
api_key_assertion
Package api_key_assertion remembers the assertions a key has already minted with, for as long as they could still be presented again.
Package api_key_assertion remembers the assertions a key has already minted with, for as long as they could still be presented again.
api_key_authentication
Package api_key_authentication links a sign-in to the key that minted it.
Package api_key_authentication links a sign-in to the key that minted it.
oauth_authorization
Package oauth_authorization is what the OAuth authorization server keeps, as tables.
Package oauth_authorization is what the OAuth authorization server keeps, as tables.

Jump to

Keyboard shortcuts

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