Documentation
¶
Overview ¶
Package store is the database of accounts and sign-in (schema auth): the schema (migrations), the queries (sqlc) and the migration runner.
After editing migrations/ or queries.sql:
go tool -modfile=tools/go.mod sqlc generate -f server/auth/store/sqlc.yaml
Index ¶
- func Migrate(ctx context.Context, pool *pgxpool.Pool) error
- type AddEventParams
- type ApproveDeviceCodeParams
- type AuthorizationCode
- type ConsumeChallengeParams
- type ConsumeDeviceCodeParams
- type CountChallengesByDeviceParams
- type CountChallengesByEmailParams
- type CountChallengesByIPParams
- type CreateAuthorizationCodeParams
- type CreateChallengeParams
- type CreateDeviceCodeParams
- type CreateRefreshTokenParams
- type CreateSessionParams
- type CreateSigningKeyParams
- type CreateUserParams
- type DBTX
- type DeviceCode
- type EmailChallenge
- type LiveSessionsParams
- type PollDeviceCodeParams
- type Queries
- func (q *Queries) AddChallengeAttempt(ctx context.Context, id string) error
- func (q *Queries) AddEvent(ctx context.Context, arg AddEventParams) error
- func (q *Queries) ApproveDeviceCode(ctx context.Context, arg ApproveDeviceCodeParams) (int64, error)
- func (q *Queries) AuthorizationCodeForUpdate(ctx context.Context, codeHash []byte) (AuthorizationCode, error)
- func (q *Queries) ChallengeForUpdate(ctx context.Context, id string) (EmailChallenge, error)
- func (q *Queries) ConsumeChallenge(ctx context.Context, arg ConsumeChallengeParams) error
- func (q *Queries) ConsumeDeviceCode(ctx context.Context, arg ConsumeDeviceCodeParams) error
- func (q *Queries) CountChallengesByDevice(ctx context.Context, arg CountChallengesByDeviceParams) (int64, error)
- func (q *Queries) CountChallengesByEmail(ctx context.Context, arg CountChallengesByEmailParams) (int64, error)
- func (q *Queries) CountChallengesByIP(ctx context.Context, arg CountChallengesByIPParams) (int64, error)
- func (q *Queries) CreateAuthorizationCode(ctx context.Context, arg CreateAuthorizationCodeParams) error
- func (q *Queries) CreateChallenge(ctx context.Context, arg CreateChallengeParams) error
- func (q *Queries) CreateDeviceCode(ctx context.Context, arg CreateDeviceCodeParams) error
- func (q *Queries) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) error
- func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)
- func (q *Queries) CreateSigningKey(ctx context.Context, arg CreateSigningKeyParams) error
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeleteExpired(ctx context.Context, expiresAt time.Time) error
- func (q *Queries) DeviceCodeByUserCode(ctx context.Context, userCode string) (DeviceCode, error)
- func (q *Queries) DeviceCodeForUpdate(ctx context.Context, deviceCodeHash []byte) (DeviceCode, error)
- func (q *Queries) LiveSessions(ctx context.Context, arg LiveSessionsParams) ([]Session, error)
- func (q *Queries) PollDeviceCode(ctx context.Context, arg PollDeviceCodeParams) error
- func (q *Queries) RefreshTokenForUpdate(ctx context.Context, tokenHash []byte) (RefreshToken, error)
- func (q *Queries) RevokeSession(ctx context.Context, arg RevokeSessionParams) error
- func (q *Queries) SessionByID(ctx context.Context, id string) (Session, error)
- func (q *Queries) SessionForUpdate(ctx context.Context, id string) (Session, error)
- func (q *Queries) SigningKeys(ctx context.Context) ([]SigningKey, error)
- func (q *Queries) TouchSession(ctx context.Context, arg TouchSessionParams) (Session, error)
- func (q *Queries) UseAuthorizationCode(ctx context.Context, arg UseAuthorizationCodeParams) error
- func (q *Queries) UseRefreshToken(ctx context.Context, arg UseRefreshTokenParams) error
- func (q *Queries) UserByEmail(ctx context.Context, email string) (User, error)
- func (q *Queries) UserByID(ctx context.Context, id string) (User, error)
- func (q *Queries) UserEvents(ctx context.Context, userID string) ([]SecurityEvent, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RefreshToken
- type RevokeSessionParams
- type SecurityEvent
- type Session
- type SigningKey
- type TouchSessionParams
- type UseAuthorizationCodeParams
- type UseRefreshTokenParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddEventParams ¶
type ApproveDeviceCodeParams ¶
type AuthorizationCode ¶
type ConsumeChallengeParams ¶
type ConsumeDeviceCodeParams ¶
type CreateChallengeParams ¶
type CreateDeviceCodeParams ¶
type CreateSessionParams ¶
type CreateSigningKeyParams ¶
type DeviceCode ¶
type EmailChallenge ¶
type LiveSessionsParams ¶
type PollDeviceCodeParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddChallengeAttempt ¶
func (*Queries) AddEvent ¶
func (q *Queries) AddEvent(ctx context.Context, arg AddEventParams) error
func (*Queries) ApproveDeviceCode ¶
func (*Queries) AuthorizationCodeForUpdate ¶
func (*Queries) ChallengeForUpdate ¶
func (*Queries) ConsumeChallenge ¶
func (q *Queries) ConsumeChallenge(ctx context.Context, arg ConsumeChallengeParams) error
func (*Queries) ConsumeDeviceCode ¶
func (q *Queries) ConsumeDeviceCode(ctx context.Context, arg ConsumeDeviceCodeParams) error
func (*Queries) CountChallengesByDevice ¶
func (*Queries) CountChallengesByEmail ¶
func (*Queries) CountChallengesByIP ¶
func (*Queries) CreateAuthorizationCode ¶
func (q *Queries) CreateAuthorizationCode(ctx context.Context, arg CreateAuthorizationCodeParams) error
func (*Queries) CreateChallenge ¶
func (q *Queries) CreateChallenge(ctx context.Context, arg CreateChallengeParams) error
func (*Queries) CreateDeviceCode ¶
func (q *Queries) CreateDeviceCode(ctx context.Context, arg CreateDeviceCodeParams) error
func (*Queries) CreateRefreshToken ¶
func (q *Queries) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) error
func (*Queries) CreateSession ¶
func (*Queries) CreateSigningKey ¶
func (q *Queries) CreateSigningKey(ctx context.Context, arg CreateSigningKeyParams) error
func (*Queries) CreateUser ¶
func (*Queries) DeleteExpired ¶
func (*Queries) DeviceCodeByUserCode ¶
func (*Queries) DeviceCodeForUpdate ¶
func (*Queries) LiveSessions ¶
func (*Queries) PollDeviceCode ¶
func (q *Queries) PollDeviceCode(ctx context.Context, arg PollDeviceCodeParams) error
func (*Queries) RefreshTokenForUpdate ¶
func (*Queries) RevokeSession ¶
func (q *Queries) RevokeSession(ctx context.Context, arg RevokeSessionParams) error
func (*Queries) SessionByID ¶
func (*Queries) SessionForUpdate ¶
func (*Queries) SigningKeys ¶
func (q *Queries) SigningKeys(ctx context.Context) ([]SigningKey, error)
func (*Queries) TouchSession ¶
func (*Queries) UseAuthorizationCode ¶
func (q *Queries) UseAuthorizationCode(ctx context.Context, arg UseAuthorizationCodeParams) error
func (*Queries) UseRefreshToken ¶
func (q *Queries) UseRefreshToken(ctx context.Context, arg UseRefreshTokenParams) error
func (*Queries) UserByEmail ¶
func (*Queries) UserEvents ¶
type RefreshToken ¶
type RevokeSessionParams ¶
type SecurityEvent ¶
type TouchSessionParams ¶
type UseRefreshTokenParams ¶
Click to show internal directories.
Click to hide internal directories.