Documentation
¶
Index ¶
- func Text[T ~string](value T) pgtype.Text
- func TimestampTz(t time.Time) pgtype.Timestamptz
- func ToPointerString(value pgtype.Text) *string
- type AuthProvider
- type AuthProviderRequest
- type AuthRefreshToken
- type AuthRefreshTokenType
- type AuthRole
- type AuthSchemaMigration
- type AuthUser
- type AuthUserProvider
- type AuthUserRole
- type AuthUserSecurityKey
- type DBTX
- type FindUserProviderByProviderIdParams
- type GetUserByEmailAndTicketParams
- type GetUserByPhoneNumberAndOTPParams
- type GetUserByProviderIDParams
- type GetUserByRefreshTokenHashParams
- type InsertRefreshtokenParams
- type InsertSecurityKeyParams
- type InsertUserParams
- type InsertUserProviderParams
- type InsertUserRow
- type InsertUserWithRefreshTokenParams
- type InsertUserWithRefreshTokenRow
- type InsertUserWithSecurityKeyAndRefreshTokenParams
- type InsertUserWithSecurityKeyAndRefreshTokenRow
- type InsertUserWithSecurityKeyParams
- type InsertUserWithUserProviderAndRefreshTokenParams
- type InsertUserWithUserProviderAndRefreshTokenRow
- type InsertUserWithUserProviderParams
- type Queries
- func (q *Queries) CountSecurityKeysUser(ctx context.Context, userID uuid.UUID) (int64, error)
- func (q *Queries) DeleteRefreshToken(ctx context.Context, refreshTokenHash pgtype.Text) error
- func (q *Queries) DeleteRefreshTokens(ctx context.Context, userID uuid.UUID) error
- func (q *Queries) DeleteUserRoles(ctx context.Context, userID uuid.UUID) error
- func (q *Queries) FindUserProviderByProviderId(ctx context.Context, arg FindUserProviderByProviderIdParams) (AuthUserProvider, error)
- func (q *Queries) GetSecurityKeys(ctx context.Context, userID uuid.UUID) ([]AuthUserSecurityKey, error)
- func (q *Queries) GetUser(ctx context.Context, id uuid.UUID) (AuthUser, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email pgtype.Text) (AuthUser, error)
- func (q *Queries) GetUserByEmailAndTicket(ctx context.Context, arg GetUserByEmailAndTicketParams) (AuthUser, error)
- func (q *Queries) GetUserByPhoneNumber(ctx context.Context, phoneNumber pgtype.Text) (AuthUser, error)
- func (q *Queries) GetUserByPhoneNumberAndOTP(ctx context.Context, arg GetUserByPhoneNumberAndOTPParams) (AuthUser, error)
- func (q *Queries) GetUserByProviderID(ctx context.Context, arg GetUserByProviderIDParams) (AuthUser, error)
- func (q *Queries) GetUserByRefreshTokenHash(ctx context.Context, arg GetUserByRefreshTokenHashParams) (AuthUser, error)
- func (q *Queries) GetUserByTicket(ctx context.Context, dollar_1 pgtype.Text) (AuthUser, error)
- func (q *Queries) GetUserRoles(ctx context.Context, userID uuid.UUID) ([]AuthUserRole, error)
- func (q *Queries) InsertRefreshtoken(ctx context.Context, arg InsertRefreshtokenParams) (uuid.UUID, error)
- func (q *Queries) InsertSecurityKey(ctx context.Context, arg InsertSecurityKeyParams) (uuid.UUID, error)
- func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (InsertUserRow, error)
- func (q *Queries) InsertUserProvider(ctx context.Context, arg InsertUserProviderParams) (AuthUserProvider, error)
- func (q *Queries) InsertUserWithRefreshToken(ctx context.Context, arg InsertUserWithRefreshTokenParams) (InsertUserWithRefreshTokenRow, error)
- func (q *Queries) InsertUserWithSecurityKey(ctx context.Context, arg InsertUserWithSecurityKeyParams) (uuid.UUID, error)
- func (q *Queries) InsertUserWithSecurityKeyAndRefreshToken(ctx context.Context, arg InsertUserWithSecurityKeyAndRefreshTokenParams) (InsertUserWithSecurityKeyAndRefreshTokenRow, error)
- func (q *Queries) InsertUserWithUserProvider(ctx context.Context, arg InsertUserWithUserProviderParams) (uuid.UUID, error)
- func (q *Queries) InsertUserWithUserProviderAndRefreshToken(ctx context.Context, arg InsertUserWithUserProviderAndRefreshTokenParams) (InsertUserWithUserProviderAndRefreshTokenRow, error)
- func (q *Queries) RefreshTokenAndGetUserRoles(ctx context.Context, arg RefreshTokenAndGetUserRolesParams) ([]RefreshTokenAndGetUserRolesRow, error)
- func (q *Queries) UpdateUserActiveMFAType(ctx context.Context, arg UpdateUserActiveMFATypeParams) error
- func (q *Queries) UpdateUserChangeEmail(ctx context.Context, arg UpdateUserChangeEmailParams) (AuthUser, error)
- func (q *Queries) UpdateUserChangePassword(ctx context.Context, arg UpdateUserChangePasswordParams) (uuid.UUID, error)
- func (q *Queries) UpdateUserConfirmChangeEmail(ctx context.Context, id uuid.UUID) (AuthUser, error)
- func (q *Queries) UpdateUserDeanonymize(ctx context.Context, arg UpdateUserDeanonymizeParams) error
- func (q *Queries) UpdateUserLastSeen(ctx context.Context, id uuid.UUID) (pgtype.Timestamptz, error)
- func (q *Queries) UpdateUserOTPHash(ctx context.Context, arg UpdateUserOTPHashParams) (uuid.UUID, error)
- func (q *Queries) UpdateUserTicket(ctx context.Context, arg UpdateUserTicketParams) (uuid.UUID, error)
- func (q *Queries) UpdateUserTotpSecret(ctx context.Context, arg UpdateUserTotpSecretParams) error
- func (q *Queries) UpdateUserVerifyEmail(ctx context.Context, id uuid.UUID) (AuthUser, error)
- func (q *Queries) UpsertRoles(ctx context.Context, roles []string) ([]string, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RefreshTokenAndGetUserRolesParams
- type RefreshTokenAndGetUserRolesRow
- type RefreshTokenType
- type UpdateUserActiveMFATypeParams
- type UpdateUserChangeEmailParams
- type UpdateUserChangePasswordParams
- type UpdateUserDeanonymizeParams
- type UpdateUserOTPHashParams
- type UpdateUserTicketParams
- type UpdateUserTotpSecretParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimestampTz ¶
func TimestampTz(t time.Time) pgtype.Timestamptz
func ToPointerString ¶ added in v0.36.0
Types ¶
type AuthProvider ¶
type AuthProvider struct {
ID string
}
List of available Oauth providers. Don't modify its structure as Hasura Auth relies on it to function properly.
type AuthProviderRequest ¶
Oauth requests, inserted before redirecting to the provider's site. Don't modify its structure as Hasura Auth relies on it to function properly.
type AuthRefreshToken ¶
type AuthRefreshToken struct {
ID uuid.UUID
CreatedAt pgtype.Timestamptz
ExpiresAt pgtype.Timestamptz
UserID uuid.UUID
Metadata []byte
Type RefreshTokenType
RefreshTokenHash pgtype.Text
}
User refresh tokens. Hasura auth uses them to rotate new access tokens as long as the refresh token is not expired. Don't modify its structure as Hasura Auth relies on it to function properly.
type AuthRefreshTokenType ¶
type AuthRole ¶
type AuthRole struct {
Role string
}
Persistent Hasura roles for users. Don't modify its structure as Hasura Auth relies on it to function properly.
type AuthSchemaMigration ¶ added in v0.40.0
Internal table for tracking migrations. Don't modify its structure as Hasura Auth relies on it to function properly.
type AuthUser ¶
type AuthUser struct {
ID uuid.UUID
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
LastSeen pgtype.Timestamptz
Disabled bool
DisplayName string
AvatarUrl string
Locale string
Email pgtype.Text
PhoneNumber pgtype.Text
PasswordHash pgtype.Text
EmailVerified bool
PhoneNumberVerified bool
NewEmail pgtype.Text
OtpMethodLastUsed pgtype.Text
OtpHash pgtype.Text
OtpHashExpiresAt pgtype.Timestamptz
DefaultRole string
IsAnonymous bool
TotpSecret pgtype.Text
ActiveMfaType pgtype.Text
Ticket pgtype.Text
TicketExpiresAt pgtype.Timestamptz
Metadata []byte
WebauthnCurrentChallenge pgtype.Text
}
User account information. Don't modify its structure as Hasura Auth relies on it to function properly.
type AuthUserProvider ¶
type AuthUserProvider struct {
ID uuid.UUID
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
UserID uuid.UUID
AccessToken string
RefreshToken pgtype.Text
ProviderID string
ProviderUserID string
}
Active providers for a given user. Don't modify its structure as Hasura Auth relies on it to function properly.
type AuthUserRole ¶
Roles of users. Don't modify its structure as Hasura Auth relies on it to function properly.
type AuthUserSecurityKey ¶
type AuthUserSecurityKey struct {
ID uuid.UUID
UserID uuid.UUID
CredentialID string
CredentialPublicKey []byte
Counter int64
Transports string
Nickname pgtype.Text
}
User webauthn security keys. Don't modify its structure as Hasura Auth relies on it to function properly.
type FindUserProviderByProviderIdParams ¶ added in v0.35.0
type GetUserByEmailAndTicketParams ¶ added in v0.35.0
type GetUserByPhoneNumberAndOTPParams ¶ added in v0.39.1
type GetUserByProviderIDParams ¶ added in v0.35.0
type GetUserByRefreshTokenHashParams ¶ added in v0.28.0
type GetUserByRefreshTokenHashParams struct {
RefreshTokenHash pgtype.Text
Type RefreshTokenType
}
type InsertRefreshtokenParams ¶ added in v0.28.0
type InsertRefreshtokenParams struct {
UserID uuid.UUID
RefreshTokenHash pgtype.Text
ExpiresAt pgtype.Timestamptz
Type RefreshTokenType
Metadata []byte
}
type InsertSecurityKeyParams ¶ added in v0.39.0
type InsertUserParams ¶
type InsertUserParams struct {
ID uuid.UUID
Disabled bool
DisplayName string
AvatarUrl string
PhoneNumber pgtype.Text
Roles []string
Otp string
OtpMethodLastUsed pgtype.Text
Email pgtype.Text
PasswordHash pgtype.Text
Ticket pgtype.Text
TicketExpiresAt pgtype.Timestamptz
EmailVerified bool
Locale string
DefaultRole string
Metadata []byte
OtpHashExpiresAt pgtype.Timestamptz
}
type InsertUserProviderParams ¶ added in v0.35.0
type InsertUserRow ¶
type InsertUserRow struct {
UserID uuid.UUID
CreatedAt pgtype.Timestamptz
}
type InsertUserWithRefreshTokenParams ¶
type InsertUserWithRefreshTokenParams struct {
Disabled bool
DisplayName string
AvatarUrl string
Email pgtype.Text
PasswordHash pgtype.Text
Ticket pgtype.Text
TicketExpiresAt pgtype.Timestamptz
EmailVerified bool
Locale string
DefaultRole string
IsAnonymous bool
Metadata []byte
RefreshTokenHash pgtype.Text
RefreshTokenExpiresAt pgtype.Timestamptz
Roles []string
}
type InsertUserWithSecurityKeyAndRefreshTokenParams ¶ added in v0.28.0
type InsertUserWithSecurityKeyAndRefreshTokenParams struct {
ID uuid.UUID
Disabled bool
DisplayName string
AvatarUrl string
Email pgtype.Text
Ticket pgtype.Text
TicketExpiresAt pgtype.Timestamptz
EmailVerified bool
Locale string
DefaultRole string
Metadata []byte
RefreshTokenHash pgtype.Text
RefreshTokenExpiresAt pgtype.Timestamptz
CredentialID string
CredentialPublicKey []byte
Nickname pgtype.Text
Roles []string
}
type InsertUserWithSecurityKeyAndRefreshTokenRow ¶ added in v0.28.1
type InsertUserWithSecurityKeyParams ¶ added in v0.28.0
type InsertUserWithSecurityKeyParams struct {
ID uuid.UUID
Disabled bool
DisplayName string
AvatarUrl string
Email pgtype.Text
Ticket pgtype.Text
TicketExpiresAt pgtype.Timestamptz
EmailVerified bool
Locale string
DefaultRole string
Metadata []byte
Roles []string
CredentialID string
CredentialPublicKey []byte
Nickname pgtype.Text
}
type InsertUserWithUserProviderAndRefreshTokenParams ¶ added in v0.35.0
type InsertUserWithUserProviderAndRefreshTokenParams struct {
ID uuid.UUID
Disabled bool
DisplayName string
AvatarUrl string
Email pgtype.Text
Ticket pgtype.Text
TicketExpiresAt pgtype.Timestamptz
EmailVerified bool
Locale string
DefaultRole string
Metadata []byte
RefreshTokenHash pgtype.Text
RefreshTokenExpiresAt pgtype.Timestamptz
ProviderID string
ProviderUserID string
Roles []string
}
type InsertUserWithUserProviderAndRefreshTokenRow ¶ added in v0.35.0
type InsertUserWithUserProviderParams ¶ added in v0.35.0
type InsertUserWithUserProviderParams struct {
ID uuid.UUID
Disabled bool
DisplayName string
AvatarUrl string
Email pgtype.Text
Ticket pgtype.Text
TicketExpiresAt pgtype.Timestamptz
EmailVerified bool
Locale string
DefaultRole string
Metadata []byte
Roles []string
ProviderID string
ProviderUserID string
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountSecurityKeysUser ¶ added in v0.28.0
func (*Queries) DeleteRefreshToken ¶ added in v0.40.0
func (*Queries) DeleteRefreshTokens ¶ added in v0.28.0
func (*Queries) DeleteUserRoles ¶ added in v0.28.0
func (*Queries) FindUserProviderByProviderId ¶ added in v0.35.0
func (q *Queries) FindUserProviderByProviderId(ctx context.Context, arg FindUserProviderByProviderIdParams) (AuthUserProvider, error)
func (*Queries) GetSecurityKeys ¶ added in v0.36.0
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserByEmailAndTicket ¶ added in v0.35.0
func (*Queries) GetUserByPhoneNumber ¶ added in v0.39.1
func (*Queries) GetUserByPhoneNumberAndOTP ¶ added in v0.39.1
func (*Queries) GetUserByProviderID ¶ added in v0.35.0
func (*Queries) GetUserByRefreshTokenHash ¶ added in v0.28.0
func (*Queries) GetUserByTicket ¶ added in v0.34.0
func (*Queries) GetUserRoles ¶ added in v0.28.0
func (*Queries) InsertRefreshtoken ¶ added in v0.28.0
func (*Queries) InsertSecurityKey ¶ added in v0.39.0
func (*Queries) InsertUser ¶
func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (InsertUserRow, error)
func (*Queries) InsertUserProvider ¶ added in v0.35.0
func (q *Queries) InsertUserProvider(ctx context.Context, arg InsertUserProviderParams) (AuthUserProvider, error)
func (*Queries) InsertUserWithRefreshToken ¶
func (q *Queries) InsertUserWithRefreshToken(ctx context.Context, arg InsertUserWithRefreshTokenParams) (InsertUserWithRefreshTokenRow, error)
func (*Queries) InsertUserWithSecurityKey ¶ added in v0.28.0
func (*Queries) InsertUserWithSecurityKeyAndRefreshToken ¶ added in v0.28.0
func (q *Queries) InsertUserWithSecurityKeyAndRefreshToken(ctx context.Context, arg InsertUserWithSecurityKeyAndRefreshTokenParams) (InsertUserWithSecurityKeyAndRefreshTokenRow, error)
func (*Queries) InsertUserWithUserProvider ¶ added in v0.35.0
func (*Queries) InsertUserWithUserProviderAndRefreshToken ¶ added in v0.35.0
func (q *Queries) InsertUserWithUserProviderAndRefreshToken(ctx context.Context, arg InsertUserWithUserProviderAndRefreshTokenParams) (InsertUserWithUserProviderAndRefreshTokenRow, error)
func (*Queries) RefreshTokenAndGetUserRoles ¶ added in v0.29.0
func (q *Queries) RefreshTokenAndGetUserRoles(ctx context.Context, arg RefreshTokenAndGetUserRolesParams) ([]RefreshTokenAndGetUserRolesRow, error)
func (*Queries) UpdateUserActiveMFAType ¶ added in v0.38.1
func (q *Queries) UpdateUserActiveMFAType(ctx context.Context, arg UpdateUserActiveMFATypeParams) error
func (*Queries) UpdateUserChangeEmail ¶ added in v0.28.0
func (*Queries) UpdateUserChangePassword ¶ added in v0.34.0
func (*Queries) UpdateUserConfirmChangeEmail ¶ added in v0.35.0
func (*Queries) UpdateUserDeanonymize ¶ added in v0.28.0
func (q *Queries) UpdateUserDeanonymize(ctx context.Context, arg UpdateUserDeanonymizeParams) error
func (*Queries) UpdateUserLastSeen ¶ added in v0.28.0
func (*Queries) UpdateUserOTPHash ¶ added in v0.39.1
func (*Queries) UpdateUserTicket ¶ added in v0.28.0
func (*Queries) UpdateUserTotpSecret ¶ added in v0.38.1
func (q *Queries) UpdateUserTotpSecret(ctx context.Context, arg UpdateUserTotpSecretParams) error
func (*Queries) UpdateUserVerifyEmail ¶ added in v0.35.0
func (*Queries) UpsertRoles ¶ added in v0.40.0
type RefreshTokenAndGetUserRolesParams ¶ added in v0.29.0
type RefreshTokenAndGetUserRolesRow ¶ added in v0.29.0
type RefreshTokenType ¶ added in v0.28.0
type RefreshTokenType string
const ( RefreshTokenTypeRegular RefreshTokenType = "regular" RefreshTokenTypePAT RefreshTokenType = "pat" )