Documentation
¶
Index ¶
- type ActOnInvitationParams
- type AddMFAFactorParams
- type AddUserToOrgParams
- type AssignRolesToUsersInOrgParams
- type AuditLog
- type CheckPendingInviteByEmailParams
- type CheckUserMembershipEmailParams
- type CheckUserMembershipIDParams
- type CountValidUsersInOrgParams
- type CreateAuditLogParams
- type CreateInvitationsParams
- type CreateOrgDomainParams
- type CreateOrgParams
- type CreateRolesParams
- type CreateSessionParams
- type CreateUserParams
- type CreateVerificationTokenParams
- type DBTX
- type DeleteMFAFactorParams
- type DeleteMFAFactorsWhereEmailNotParams
- type DisassignRolesFromUsersInOrgParams
- type ExpandedInvitation
- type GetBackupCodeStatsRow
- type GetInfoForSessionRefreshParams
- type GetInfoForSessionRefreshRow
- type GetInvitationByEmailParams
- type GetInvitationParams
- type GetInvitationsForUserParams
- type GetInvitationsForUserRow
- type GetMFAFactorsParams
- type GetOrgUsageRow
- type GetRolesMinimalRow
- type GetSessionParams
- type GetSessionsForUserInOrgParams
- type GetUserByEmailRow
- type GetUserByIDRow
- type GetUserInfoParams
- type GetUserLoginInfoRow
- type GetUserOrgsParams
- type GetUserOrgsRow
- type GetUserPermissionsParams
- type GetVerificationTokenParams
- type Invitation
- type InvitationStatus
- type MfaFactor
- type MfaType
- type NullInvitationStatus
- type NullMfaType
- type NullVerificationTokenType
- type Org
- type OrgDomain
- type Querier
- type Queries
- func (q *Queries) ActOnInvitation(ctx context.Context, arg ActOnInvitationParams) (uuid.UUID, error)
- func (q *Queries) AddMFAFactor(ctx context.Context, arg AddMFAFactorParams) error
- func (q *Queries) AddUserToOrg(ctx context.Context, arg AddUserToOrgParams) error
- func (q *Queries) AssignRolesToUsersInOrg(ctx context.Context, arg AssignRolesToUsersInOrgParams) error
- func (q *Queries) CheckPendingInviteByEmail(ctx context.Context, arg CheckPendingInviteByEmailParams) (bool, error)
- func (q *Queries) CheckUserMembershipEmail(ctx context.Context, arg CheckUserMembershipEmailParams) (bool, error)
- func (q *Queries) CheckUserMembershipID(ctx context.Context, arg CheckUserMembershipIDParams) (bool, error)
- func (q *Queries) CleanupOldAuditLogs(ctx context.Context, days *string) error
- func (q *Queries) CountValidRoles(ctx context.Context, roleIds []uuid.UUID) (int64, error)
- func (q *Queries) CountValidUsersInOrg(ctx context.Context, arg CountValidUsersInOrgParams) (int64, error)
- func (q *Queries) CountVerifiedMFAFactorsForUser(ctx context.Context, userID uuid.UUID) (int64, error)
- func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) error
- func (q *Queries) CreateInvitations(ctx context.Context, arg []CreateInvitationsParams) (int64, error)
- func (q *Queries) CreateOrg(ctx context.Context, arg CreateOrgParams) error
- func (q *Queries) CreateOrgDomain(ctx context.Context, arg CreateOrgDomainParams) (OrgDomain, error)
- func (q *Queries) CreateRoles(ctx context.Context, arg []CreateRolesParams) (int64, error)
- func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) error
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) error
- func (q *Queries) CreateVerificationToken(ctx context.Context, arg CreateVerificationTokenParams) error
- func (q *Queries) DeleteExpiredSessions(ctx context.Context) error
- func (q *Queries) DeleteExpiredVerificationTokens(ctx context.Context) error
- func (q *Queries) DeleteMFAFactor(ctx context.Context, arg DeleteMFAFactorParams) (MfaFactor, error)
- func (q *Queries) DeleteMFAFactorsWhereEmailNot(ctx context.Context, arg DeleteMFAFactorsWhereEmailNotParams) error
- func (q *Queries) DeleteOrg(ctx context.Context, id uuid.UUID) (Org, error)
- func (q *Queries) DeleteRole(ctx context.Context, id uuid.UUID) (Role, error)
- func (q *Queries) DeleteSession(ctx context.Context, id uuid.UUID) (Session, error)
- func (q *Queries) DeleteUserByID(ctx context.Context, id uuid.UUID) (User, error)
- func (q *Queries) DeleteVerificationToken(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DisassignRolesFromUsersInOrg(ctx context.Context, arg DisassignRolesFromUsersInOrgParams) error
- func (q *Queries) GetBackupCodeStats(ctx context.Context, userID uuid.UUID) (GetBackupCodeStatsRow, error)
- func (q *Queries) GetBackupCodes(ctx context.Context, id uuid.UUID) ([]models.BackupCode, error)
- func (q *Queries) GetInfoForSessionRefresh(ctx context.Context, arg GetInfoForSessionRefreshParams) (GetInfoForSessionRefreshRow, error)
- func (q *Queries) GetInvitation(ctx context.Context, arg GetInvitationParams) (Invitation, error)
- func (q *Queries) GetInvitationByEmail(ctx context.Context, arg GetInvitationByEmailParams) (Invitation, error)
- func (q *Queries) GetInvitationsForUser(ctx context.Context, arg GetInvitationsForUserParams) ([]GetInvitationsForUserRow, error)
- func (q *Queries) GetMFAFactorWithEmail(ctx context.Context, secret string) (bool, error)
- func (q *Queries) GetMFAFactors(ctx context.Context, arg GetMFAFactorsParams) ([]MfaFactor, error)
- func (q *Queries) GetMFAFactorsByUserID(ctx context.Context, userID uuid.UUID) ([]MfaFactor, error)
- func (q *Queries) GetOrg(ctx context.Context, id uuid.UUID) (Org, error)
- func (q *Queries) GetOrgDomain(ctx context.Context, domain string) (OrgDomain, error)
- func (q *Queries) GetOrgDomains(ctx context.Context, orgID uuid.UUID) ([]OrgDomain, error)
- func (q *Queries) GetOrgIDByDomain(ctx context.Context, domain string) (OrgDomain, error)
- func (q *Queries) GetOrgUsage(ctx context.Context, orgID uuid.UUID) (GetOrgUsageRow, error)
- func (q *Queries) GetRoleByID(ctx context.Context, id uuid.UUID) (Role, error)
- func (q *Queries) GetRolesMinimal(ctx context.Context) ([]GetRolesMinimalRow, error)
- func (q *Queries) GetSession(ctx context.Context, arg GetSessionParams) (Session, error)
- func (q *Queries) GetSessionsForOrg(ctx context.Context, orgID uuid.UUID) ([]Session, error)
- func (q *Queries) GetSessionsForUser(ctx context.Context, userID uuid.UUID) ([]Session, error)
- func (q *Queries) GetSessionsForUserInOrg(ctx context.Context, arg GetSessionsForUserInOrgParams) ([]Session, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)
- func (q *Queries) GetUserByID(ctx context.Context, id uuid.UUID) (GetUserByIDRow, error)
- func (q *Queries) GetUserEmail(ctx context.Context, id uuid.UUID) (string, error)
- func (q *Queries) GetUserInfo(ctx context.Context, arg GetUserInfoParams) ([]byte, error)
- func (q *Queries) GetUserLoginInfo(ctx context.Context, email string) (GetUserLoginInfoRow, error)
- func (q *Queries) GetUserOrgs(ctx context.Context, arg GetUserOrgsParams) ([]GetUserOrgsRow, error)
- func (q *Queries) GetUserPermissions(ctx context.Context, arg GetUserPermissionsParams) ([]string, error)
- func (q *Queries) GetVerificationToken(ctx context.Context, arg GetVerificationTokenParams) (VerificationToken, error)
- func (q *Queries) MarkUserEmailVerified(ctx context.Context, id uuid.UUID) error
- func (q *Queries) RefreshSession(ctx context.Context, arg RefreshSessionParams) error
- func (q *Queries) RemoveAllRolesFromUserInOrg(ctx context.Context, arg RemoveAllRolesFromUserInOrgParams) error
- func (q *Queries) RemoveDomainFromOrg(ctx context.Context, arg RemoveDomainFromOrgParams) (OrgDomain, error)
- func (q *Queries) RemoveUserFromOrg(ctx context.Context, arg RemoveUserFromOrgParams) (UserOrg, error)
- func (q *Queries) RevokeAllSessionsForUser(ctx context.Context, userID uuid.UUID) error
- func (q *Queries) RevokeAllSessionsForUserInOrg(ctx context.Context, arg RevokeAllSessionsForUserInOrgParams) error
- func (q *Queries) RevokeInvitation(ctx context.Context, arg RevokeInvitationParams) (uuid.UUID, error)
- func (q *Queries) UpdateBackupCodes(ctx context.Context, arg UpdateBackupCodesParams) error
- func (q *Queries) UpdateBackupCodesByEmail(ctx context.Context, arg UpdateBackupCodesByEmailParams) error
- func (q *Queries) UpdateMFAFactorName(ctx context.Context, arg UpdateMFAFactorNameParams) (string, error)
- func (q *Queries) UpdateMFAFactorVerification(ctx context.Context, arg UpdateMFAFactorVerificationParams) error
- func (q *Queries) UpdateOrg(ctx context.Context, arg UpdateOrgParams) ([]byte, error)
- func (q *Queries) UpdateOrgDomain(ctx context.Context, arg UpdateOrgDomainParams) ([]byte, error)
- func (q *Queries) UpdateOrgDomainVerification(ctx context.Context, arg UpdateOrgDomainVerificationParams) error
- func (q *Queries) UpdateRole(ctx context.Context, arg UpdateRoleParams) ([]byte, error)
- func (q *Queries) UpdateSessionMFA(ctx context.Context, arg UpdateSessionMFAParams) error
- func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error
- func (q *Queries) UpdateUserBanInOrg(ctx context.Context, arg UpdateUserBanInOrgParams) error
- func (q *Queries) UpdateUserOrgAdmin(ctx context.Context, arg UpdateUserOrgAdminParams) error
- func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
- func (q *Queries) ValidateInviteEmails(ctx context.Context, arg ValidateInviteEmailsParams) ([]ValidateInviteEmailsRow, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RefreshSessionParams
- type RemoveAllRolesFromUserInOrgParams
- type RemoveDomainFromOrgParams
- type RemoveUserFromOrgParams
- type RevokeAllSessionsForUserInOrgParams
- type RevokeInvitationParams
- type Role
- type Session
- type UpdateBackupCodesByEmailParams
- type UpdateBackupCodesParams
- type UpdateMFAFactorNameParams
- type UpdateMFAFactorVerificationParams
- type UpdateOrgDomainParams
- type UpdateOrgDomainVerificationParams
- type UpdateOrgParams
- type UpdateRoleParams
- type UpdateSessionMFAParams
- type UpdateUserBanInOrgParams
- type UpdateUserOrgAdminParams
- type UpdateUserParams
- type UpdateUserPasswordParams
- type User
- type UserOrg
- type UserRole
- type ValidateInviteEmailsParams
- type ValidateInviteEmailsRow
- type VerificationToken
- type VerificationTokenType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActOnInvitationParams ¶
type AddMFAFactorParams ¶
type AddUserToOrgParams ¶
type AuditLog ¶
type AuditLog struct {
ID uuid.UUID `db:"id" json:"id"`
OrgID *uuid.UUID `db:"org_id" json:"orgId"`
Actor string `db:"actor" json:"actor"`
LogAction string `db:"log_action" json:"logAction"`
Entity string `db:"entity" json:"entity"`
EntityID *uuid.UUID `db:"entity_id" json:"entityId"`
Details []byte `db:"details" json:"details"`
Ip *netip.Addr `db:"ip" json:"ip"`
UserAgent *string `db:"user_agent" json:"userAgent"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
}
type CreateAuditLogParams ¶
type CreateAuditLogParams struct {
ID uuid.UUID `db:"id" json:"id"`
OrgID *uuid.UUID `db:"org_id" json:"orgId"`
Actor string `db:"actor" json:"actor"`
LogAction string `db:"log_action" json:"logAction"`
Entity string `db:"entity" json:"entity"`
EntityID *uuid.UUID `db:"entity_id" json:"entityId"`
Details []byte `db:"details" json:"details"`
Ip *netip.Addr `db:"ip" json:"ip"`
UserAgent *string `db:"user_agent" json:"userAgent"`
}
type CreateInvitationsParams ¶
type CreateInvitationsParams struct {
ID uuid.UUID `db:"id" json:"id"`
OrgID uuid.UUID `db:"org_id" json:"orgId"`
Email string `db:"email" json:"email"`
InvitedBy *uuid.UUID `db:"invited_by" json:"invitedBy"`
TokenHash []byte `db:"token_hash" json:"tokenHash"`
ExpiresAt time.Time `db:"expires_at" json:"expiresAt"`
RoleIds []uuid.UUID `db:"role_ids" json:"roleIds"`
InviteAsAdmin bool `db:"invite_as_admin" json:"inviteAsAdmin"`
}
type CreateOrgDomainParams ¶
type CreateOrgParams ¶
type CreateOrgParams struct {
ID uuid.UUID `db:"id" json:"id"`
Slug string `db:"slug" json:"slug"`
Name string `db:"name" json:"name"`
Description *string `db:"description" json:"description"`
AvatarUrl *string `db:"avatar_url" json:"avatarUrl"`
Settings models.OrgSettings `db:"settings" json:"settings"`
}
type CreateRolesParams ¶
type CreateSessionParams ¶
type CreateSessionParams struct {
ID uuid.UUID `db:"id" json:"id"`
UserID uuid.UUID `db:"user_id" json:"userId"`
OrgID uuid.UUID `db:"org_id" json:"orgId"`
SessionTokenHash []byte `db:"session_token_hash" json:"sessionTokenHash"`
RefreshTokenHash []byte `db:"refresh_token_hash" json:"refreshTokenHash"`
IpAddress netip.Addr `db:"ip_address" json:"ipAddress"`
UserAgent string `db:"user_agent" json:"userAgent"`
ExpiresAt time.Time `db:"expires_at" json:"expiresAt"`
MfaVerifiedAt time.Time `db:"mfa_verified_at" json:"mfaVerifiedAt"`
}
type CreateUserParams ¶
type CreateVerificationTokenParams ¶
type CreateVerificationTokenParams struct {
ID uuid.UUID `db:"id" json:"id"`
UserID uuid.UUID `db:"user_id" json:"userId"`
Email *string `db:"email" json:"email"`
TokenType VerificationTokenType `db:"token_type" json:"tokenType"`
TokenHash []byte `db:"token_hash" json:"tokenHash"`
ExpiresAt time.Time `db:"expires_at" json:"expiresAt"`
}
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
CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}
type DeleteMFAFactorParams ¶
type ExpandedInvitation ¶
type ExpandedInvitation struct {
ID uuid.UUID `db:"id" json:"id"`
OrgID uuid.UUID `db:"org_id" json:"orgId"`
Email string `db:"email" json:"email"`
InviteAsAdmin bool `db:"invite_as_admin" json:"inviteAsAdmin"`
RoleIds []uuid.UUID `db:"role_ids" json:"roleIds"`
InvitedBy *uuid.UUID `db:"invited_by" json:"invitedBy"`
TokenHash []byte `db:"token_hash" json:"tokenHash"`
ExpiresAt time.Time `db:"expires_at" json:"expiresAt"`
ActedAt *time.Time `db:"acted_at" json:"actedAt"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
InviteStatus InvitationStatus `db:"invite_status" json:"inviteStatus"`
InvitedByName *string `db:"invited_by_name" json:"invitedByName"`
InvitedOrgName *string `db:"invited_org_name" json:"invitedOrgName"`
InviteRoles []byte `db:"invite_roles" json:"inviteRoles"`
}
type GetBackupCodeStatsRow ¶
type GetInvitationParams ¶
type GetInvitationParams struct {
ID *uuid.UUID `db:"id" json:"id"`
TokenHash []byte `db:"token_hash" json:"tokenHash"`
Statuses []InvitationStatus `db:"statuses" json:"statuses"`
}
type GetInvitationsForUserParams ¶
type GetInvitationsForUserParams struct {
Email string `db:"email" json:"email"`
IncludeExpired bool `db:"include_expired" json:"includeExpired"`
Statuses []InvitationStatus `db:"statuses" json:"statuses"`
}
type GetInvitationsForUserRow ¶
type GetInvitationsForUserRow struct {
Invitation Invitation `db:"invitation" json:"invitation"`
UserInvitedByName *string `db:"user_invited_by_name" json:"userInvitedByName"`
OrgName string `db:"org_name" json:"orgName"`
InviteRoles []byte `db:"invite_roles" json:"inviteRoles"`
}
type GetMFAFactorsParams ¶
type GetOrgUsageRow ¶
type GetOrgUsageRow struct {
TotalUsers int64 `db:"total_users" json:"totalUsers"`
ActiveUsers int64 `db:"active_users" json:"activeUsers"`
BannedUsers int64 `db:"banned_users" json:"bannedUsers"`
PendingInvites int64 `db:"pending_invites" json:"pendingInvites"`
ExpiredInvites int64 `db:"expired_invites" json:"expiredInvites"`
OrgID uuid.UUID `db:"org_id" json:"orgId"`
OrgName string `db:"org_name" json:"orgName"`
OrgSlug string `db:"org_slug" json:"orgSlug"`
}
type GetRolesMinimalRow ¶
type GetSessionParams ¶
type GetUserByEmailRow ¶
type GetUserByEmailRow struct {
ID uuid.UUID `db:"id" json:"id"`
Email string `db:"email" json:"email"`
EmailVerified bool `db:"email_verified" json:"emailVerified"`
BackupCodesDownloaded bool `db:"backup_codes_downloaded" json:"backupCodesDownloaded"`
Name string `db:"name" json:"name"`
AvatarUrl *string `db:"avatar_url" json:"avatarUrl"`
ExtID *string `db:"ext_id" json:"extId"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type GetUserByIDRow ¶
type GetUserByIDRow struct {
ID uuid.UUID `db:"id" json:"id"`
Email string `db:"email" json:"email"`
EmailVerified bool `db:"email_verified" json:"emailVerified"`
BackupCodesDownloaded bool `db:"backup_codes_downloaded" json:"backupCodesDownloaded"`
Name string `db:"name" json:"name"`
AvatarUrl *string `db:"avatar_url" json:"avatarUrl"`
ExtID *string `db:"ext_id" json:"extId"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type GetUserInfoParams ¶
type GetUserLoginInfoRow ¶
type GetUserLoginInfoRow struct {
ID uuid.UUID `db:"id" json:"id"`
Email string `db:"email" json:"email"`
EmailVerified bool `db:"email_verified" json:"emailVerified"`
BackupCodesDownloaded bool `db:"backup_codes_downloaded" json:"backupCodesDownloaded"`
PasswordHash *string `db:"password_hash" json:"passwordHash"`
Name string `db:"name" json:"name"`
AvatarUrl *string `db:"avatar_url" json:"avatarUrl"`
ExtID *string `db:"ext_id" json:"extId"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type GetUserOrgsParams ¶
type GetUserOrgsRow ¶
type GetUserOrgsRow struct {
Org Org `db:"org" json:"org"`
}
type GetVerificationTokenParams ¶
type GetVerificationTokenParams struct {
TokenHash []byte `db:"token_hash" json:"tokenHash"`
TokenType VerificationTokenType `db:"token_type" json:"tokenType"`
}
type Invitation ¶
type Invitation struct {
ID uuid.UUID `db:"id" json:"id"`
OrgID uuid.UUID `db:"org_id" json:"orgId"`
Email string `db:"email" json:"email"`
InviteAsAdmin bool `db:"invite_as_admin" json:"inviteAsAdmin"`
RoleIds []uuid.UUID `db:"role_ids" json:"roleIds"`
InvitedBy *uuid.UUID `db:"invited_by" json:"invitedBy"`
TokenHash []byte `db:"token_hash" json:"tokenHash"`
ExpiresAt time.Time `db:"expires_at" json:"expiresAt"`
ActedAt *time.Time `db:"acted_at" json:"actedAt"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
InviteStatus InvitationStatus `db:"invite_status" json:"inviteStatus"`
}
type InvitationStatus ¶
type InvitationStatus string
const ( InvitationStatusPending InvitationStatus = "pending" InvitationStatusAccepted InvitationStatus = "accepted" InvitationStatusDeclined InvitationStatus = "declined" )
func AllInvitationStatusValues ¶
func AllInvitationStatusValues() []InvitationStatus
func (*InvitationStatus) Scan ¶
func (e *InvitationStatus) Scan(src interface{}) error
type MfaFactor ¶
type MfaFactor struct {
ID uuid.UUID `db:"id" json:"id"`
UserID uuid.UUID `db:"user_id" json:"userId"`
FactorType MfaType `db:"factor_type" json:"factorType"`
Name string `db:"name" json:"name"`
Secret string `db:"secret" json:"secret"`
Verified bool `db:"verified" json:"verified"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type NullInvitationStatus ¶
type NullInvitationStatus struct {
InvitationStatus InvitationStatus `json:"invitationStatus"`
Valid bool `json:"valid"` // Valid is true if InvitationStatus is not NULL
}
func (*NullInvitationStatus) Scan ¶
func (ns *NullInvitationStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullMfaType ¶
type NullMfaType struct {
MfaType MfaType `json:"mfaType"`
Valid bool `json:"valid"` // Valid is true if MfaType is not NULL
}
func (*NullMfaType) Scan ¶
func (ns *NullMfaType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullVerificationTokenType ¶
type NullVerificationTokenType struct {
VerificationTokenType VerificationTokenType `json:"verificationTokenType"`
Valid bool `json:"valid"` // Valid is true if VerificationTokenType is not NULL
}
func (*NullVerificationTokenType) Scan ¶
func (ns *NullVerificationTokenType) Scan(value interface{}) error
Scan implements the Scanner interface.
type Org ¶
type Org struct {
ID uuid.UUID `db:"id" json:"id"`
Slug string `db:"slug" json:"slug"`
Name string `db:"name" json:"name"`
Description *string `db:"description" json:"description"`
AvatarUrl *string `db:"avatar_url" json:"avatarUrl"`
DomainVerificationSecret []byte `db:"domain_verification_secret" json:"-"`
Settings models.OrgSettings `db:"settings" json:"settings"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type OrgDomain ¶
type OrgDomain struct {
Domain string `db:"domain" json:"domain"`
OrgID uuid.UUID `db:"org_id" json:"orgId"`
Verified bool `db:"verified" json:"verified"`
VerifiedAt *time.Time `db:"verified_at" json:"verifiedAt"`
AutoJoin bool `db:"auto_join" json:"autoJoin"`
AutoJoinRoleIds []uuid.UUID `db:"auto_join_role_ids" json:"autoJoinRoleIds"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type Querier ¶
type Querier interface {
ActOnInvitation(ctx context.Context, arg ActOnInvitationParams) (uuid.UUID, error)
AddMFAFactor(ctx context.Context, arg AddMFAFactorParams) error
AddUserToOrg(ctx context.Context, arg AddUserToOrgParams) error
AssignRolesToUsersInOrg(ctx context.Context, arg AssignRolesToUsersInOrgParams) error
CheckPendingInviteByEmail(ctx context.Context, arg CheckPendingInviteByEmailParams) (bool, error)
CheckUserMembershipEmail(ctx context.Context, arg CheckUserMembershipEmailParams) (bool, error)
CheckUserMembershipID(ctx context.Context, arg CheckUserMembershipIDParams) (bool, error)
CleanupOldAuditLogs(ctx context.Context, days *string) error
CountValidRoles(ctx context.Context, roleIds []uuid.UUID) (int64, error)
CountValidUsersInOrg(ctx context.Context, arg CountValidUsersInOrgParams) (int64, error)
CountVerifiedMFAFactorsForUser(ctx context.Context, userID uuid.UUID) (int64, error)
CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) error
CreateInvitations(ctx context.Context, arg []CreateInvitationsParams) (int64, error)
CreateOrg(ctx context.Context, arg CreateOrgParams) error
CreateOrgDomain(ctx context.Context, arg CreateOrgDomainParams) (OrgDomain, error)
CreateRoles(ctx context.Context, arg []CreateRolesParams) (int64, error)
CreateSession(ctx context.Context, arg CreateSessionParams) error
CreateUser(ctx context.Context, arg CreateUserParams) error
CreateVerificationToken(ctx context.Context, arg CreateVerificationTokenParams) error
DeleteExpiredSessions(ctx context.Context) error
DeleteExpiredVerificationTokens(ctx context.Context) error
DeleteMFAFactor(ctx context.Context, arg DeleteMFAFactorParams) (MfaFactor, error)
DeleteMFAFactorsWhereEmailNot(ctx context.Context, arg DeleteMFAFactorsWhereEmailNotParams) error
DeleteOrg(ctx context.Context, id uuid.UUID) (Org, error)
DeleteRole(ctx context.Context, id uuid.UUID) (Role, error)
DeleteSession(ctx context.Context, id uuid.UUID) (Session, error)
DeleteUserByID(ctx context.Context, id uuid.UUID) (User, error)
DeleteVerificationToken(ctx context.Context, id uuid.UUID) error
DisassignRolesFromUsersInOrg(ctx context.Context, arg DisassignRolesFromUsersInOrgParams) error
GetBackupCodeStats(ctx context.Context, userID uuid.UUID) (GetBackupCodeStatsRow, error)
GetBackupCodes(ctx context.Context, id uuid.UUID) ([]models.BackupCode, error)
GetInfoForSessionRefresh(ctx context.Context, arg GetInfoForSessionRefreshParams) (GetInfoForSessionRefreshRow, error)
GetInvitation(ctx context.Context, arg GetInvitationParams) (Invitation, error)
GetInvitationByEmail(ctx context.Context, arg GetInvitationByEmailParams) (Invitation, error)
GetInvitationsForUser(ctx context.Context, arg GetInvitationsForUserParams) ([]GetInvitationsForUserRow, error)
GetMFAFactorWithEmail(ctx context.Context, secret string) (bool, error)
GetMFAFactors(ctx context.Context, arg GetMFAFactorsParams) ([]MfaFactor, error)
GetMFAFactorsByUserID(ctx context.Context, userID uuid.UUID) ([]MfaFactor, error)
GetOrg(ctx context.Context, id uuid.UUID) (Org, error)
GetOrgDomain(ctx context.Context, domain string) (OrgDomain, error)
GetOrgDomains(ctx context.Context, orgID uuid.UUID) ([]OrgDomain, error)
GetOrgIDByDomain(ctx context.Context, domain string) (OrgDomain, error)
GetOrgUsage(ctx context.Context, orgID uuid.UUID) (GetOrgUsageRow, error)
GetRoleByID(ctx context.Context, id uuid.UUID) (Role, error)
GetRolesMinimal(ctx context.Context) ([]GetRolesMinimalRow, error)
GetSession(ctx context.Context, arg GetSessionParams) (Session, error)
GetSessionsForOrg(ctx context.Context, orgID uuid.UUID) ([]Session, error)
GetSessionsForUser(ctx context.Context, userID uuid.UUID) ([]Session, error)
GetSessionsForUserInOrg(ctx context.Context, arg GetSessionsForUserInOrgParams) ([]Session, error)
GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)
GetUserByID(ctx context.Context, id uuid.UUID) (GetUserByIDRow, error)
GetUserEmail(ctx context.Context, id uuid.UUID) (string, error)
GetUserInfo(ctx context.Context, arg GetUserInfoParams) ([]byte, error)
GetUserLoginInfo(ctx context.Context, email string) (GetUserLoginInfoRow, error)
GetUserOrgs(ctx context.Context, arg GetUserOrgsParams) ([]GetUserOrgsRow, error)
GetUserPermissions(ctx context.Context, arg GetUserPermissionsParams) ([]string, error)
GetVerificationToken(ctx context.Context, arg GetVerificationTokenParams) (VerificationToken, error)
MarkUserEmailVerified(ctx context.Context, id uuid.UUID) error
RefreshSession(ctx context.Context, arg RefreshSessionParams) error
RemoveAllRolesFromUserInOrg(ctx context.Context, arg RemoveAllRolesFromUserInOrgParams) error
RemoveDomainFromOrg(ctx context.Context, arg RemoveDomainFromOrgParams) (OrgDomain, error)
RemoveUserFromOrg(ctx context.Context, arg RemoveUserFromOrgParams) (UserOrg, error)
RevokeAllSessionsForUser(ctx context.Context, userID uuid.UUID) error
RevokeAllSessionsForUserInOrg(ctx context.Context, arg RevokeAllSessionsForUserInOrgParams) error
RevokeInvitation(ctx context.Context, arg RevokeInvitationParams) (uuid.UUID, error)
UpdateBackupCodes(ctx context.Context, arg UpdateBackupCodesParams) error
UpdateBackupCodesByEmail(ctx context.Context, arg UpdateBackupCodesByEmailParams) error
UpdateMFAFactorName(ctx context.Context, arg UpdateMFAFactorNameParams) (string, error)
UpdateMFAFactorVerification(ctx context.Context, arg UpdateMFAFactorVerificationParams) error
UpdateOrg(ctx context.Context, arg UpdateOrgParams) ([]byte, error)
UpdateOrgDomain(ctx context.Context, arg UpdateOrgDomainParams) ([]byte, error)
UpdateOrgDomainVerification(ctx context.Context, arg UpdateOrgDomainVerificationParams) error
UpdateRole(ctx context.Context, arg UpdateRoleParams) ([]byte, error)
UpdateSessionMFA(ctx context.Context, arg UpdateSessionMFAParams) error
UpdateUser(ctx context.Context, arg UpdateUserParams) error
UpdateUserBanInOrg(ctx context.Context, arg UpdateUserBanInOrgParams) error
UpdateUserOrgAdmin(ctx context.Context, arg UpdateUserOrgAdminParams) error
UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
ValidateInviteEmails(ctx context.Context, arg ValidateInviteEmailsParams) ([]ValidateInviteEmailsRow, error)
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) ActOnInvitation ¶
func (*Queries) AddMFAFactor ¶
func (q *Queries) AddMFAFactor(ctx context.Context, arg AddMFAFactorParams) error
func (*Queries) AddUserToOrg ¶
func (q *Queries) AddUserToOrg(ctx context.Context, arg AddUserToOrgParams) error
func (*Queries) AssignRolesToUsersInOrg ¶
func (q *Queries) AssignRolesToUsersInOrg(ctx context.Context, arg AssignRolesToUsersInOrgParams) error
func (*Queries) CheckPendingInviteByEmail ¶
func (*Queries) CheckUserMembershipEmail ¶
func (*Queries) CheckUserMembershipID ¶
func (*Queries) CleanupOldAuditLogs ¶
func (*Queries) CountValidRoles ¶
func (*Queries) CountValidUsersInOrg ¶
func (*Queries) CountVerifiedMFAFactorsForUser ¶
func (*Queries) CreateAuditLog ¶
func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) error
func (*Queries) CreateInvitations ¶
func (*Queries) CreateOrg ¶
func (q *Queries) CreateOrg(ctx context.Context, arg CreateOrgParams) error
func (*Queries) CreateOrgDomain ¶
func (*Queries) CreateRoles ¶
func (*Queries) CreateSession ¶
func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) error
func (*Queries) CreateUser ¶
func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) error
func (*Queries) CreateVerificationToken ¶
func (q *Queries) CreateVerificationToken(ctx context.Context, arg CreateVerificationTokenParams) error
func (*Queries) DeleteExpiredSessions ¶
func (*Queries) DeleteExpiredVerificationTokens ¶
func (*Queries) DeleteMFAFactor ¶
func (*Queries) DeleteMFAFactorsWhereEmailNot ¶
func (q *Queries) DeleteMFAFactorsWhereEmailNot(ctx context.Context, arg DeleteMFAFactorsWhereEmailNotParams) error
func (*Queries) DeleteRole ¶
func (*Queries) DeleteSession ¶
func (*Queries) DeleteUserByID ¶
func (*Queries) DeleteVerificationToken ¶
func (*Queries) DisassignRolesFromUsersInOrg ¶
func (q *Queries) DisassignRolesFromUsersInOrg(ctx context.Context, arg DisassignRolesFromUsersInOrgParams) error
func (*Queries) GetBackupCodeStats ¶
func (*Queries) GetBackupCodes ¶
func (*Queries) GetInfoForSessionRefresh ¶
func (q *Queries) GetInfoForSessionRefresh(ctx context.Context, arg GetInfoForSessionRefreshParams) (GetInfoForSessionRefreshRow, error)
func (*Queries) GetInvitation ¶
func (q *Queries) GetInvitation(ctx context.Context, arg GetInvitationParams) (Invitation, error)
func (*Queries) GetInvitationByEmail ¶
func (q *Queries) GetInvitationByEmail(ctx context.Context, arg GetInvitationByEmailParams) (Invitation, error)
func (*Queries) GetInvitationsForUser ¶
func (q *Queries) GetInvitationsForUser(ctx context.Context, arg GetInvitationsForUserParams) ([]GetInvitationsForUserRow, error)
func (*Queries) GetMFAFactorWithEmail ¶
func (*Queries) GetMFAFactors ¶
func (*Queries) GetMFAFactorsByUserID ¶
func (*Queries) GetOrgDomain ¶
func (*Queries) GetOrgDomains ¶
func (*Queries) GetOrgIDByDomain ¶
func (*Queries) GetOrgUsage ¶
func (*Queries) GetRoleByID ¶
func (*Queries) GetRolesMinimal ¶
func (q *Queries) GetRolesMinimal(ctx context.Context) ([]GetRolesMinimalRow, error)
func (*Queries) GetSession ¶
func (*Queries) GetSessionsForOrg ¶
func (*Queries) GetSessionsForUser ¶
func (*Queries) GetSessionsForUserInOrg ¶
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserByID ¶
func (*Queries) GetUserEmail ¶
func (*Queries) GetUserInfo ¶
func (*Queries) GetUserLoginInfo ¶
func (*Queries) GetUserOrgs ¶
func (q *Queries) GetUserOrgs(ctx context.Context, arg GetUserOrgsParams) ([]GetUserOrgsRow, error)
func (*Queries) GetUserPermissions ¶
func (*Queries) GetVerificationToken ¶
func (q *Queries) GetVerificationToken(ctx context.Context, arg GetVerificationTokenParams) (VerificationToken, error)
func (*Queries) MarkUserEmailVerified ¶
func (*Queries) RefreshSession ¶
func (q *Queries) RefreshSession(ctx context.Context, arg RefreshSessionParams) error
func (*Queries) RemoveAllRolesFromUserInOrg ¶
func (q *Queries) RemoveAllRolesFromUserInOrg(ctx context.Context, arg RemoveAllRolesFromUserInOrgParams) error
func (*Queries) RemoveDomainFromOrg ¶
func (*Queries) RemoveUserFromOrg ¶
func (*Queries) RevokeAllSessionsForUser ¶
func (*Queries) RevokeAllSessionsForUserInOrg ¶
func (q *Queries) RevokeAllSessionsForUserInOrg(ctx context.Context, arg RevokeAllSessionsForUserInOrgParams) error
func (*Queries) RevokeInvitation ¶
func (*Queries) UpdateBackupCodes ¶
func (q *Queries) UpdateBackupCodes(ctx context.Context, arg UpdateBackupCodesParams) error
func (*Queries) UpdateBackupCodesByEmail ¶
func (q *Queries) UpdateBackupCodesByEmail(ctx context.Context, arg UpdateBackupCodesByEmailParams) error
func (*Queries) UpdateMFAFactorName ¶
func (*Queries) UpdateMFAFactorVerification ¶
func (q *Queries) UpdateMFAFactorVerification(ctx context.Context, arg UpdateMFAFactorVerificationParams) error
func (*Queries) UpdateOrgDomain ¶
func (*Queries) UpdateOrgDomainVerification ¶
func (q *Queries) UpdateOrgDomainVerification(ctx context.Context, arg UpdateOrgDomainVerificationParams) error
func (*Queries) UpdateRole ¶
func (*Queries) UpdateSessionMFA ¶
func (q *Queries) UpdateSessionMFA(ctx context.Context, arg UpdateSessionMFAParams) error
func (*Queries) UpdateUser ¶
func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error
func (*Queries) UpdateUserBanInOrg ¶
func (q *Queries) UpdateUserBanInOrg(ctx context.Context, arg UpdateUserBanInOrgParams) error
func (*Queries) UpdateUserOrgAdmin ¶
func (q *Queries) UpdateUserOrgAdmin(ctx context.Context, arg UpdateUserOrgAdminParams) error
func (*Queries) UpdateUserPassword ¶
func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
func (*Queries) ValidateInviteEmails ¶
func (q *Queries) ValidateInviteEmails(ctx context.Context, arg ValidateInviteEmailsParams) ([]ValidateInviteEmailsRow, error)
type RefreshSessionParams ¶
type RefreshSessionParams struct {
ID uuid.UUID `db:"id" json:"id"`
SessionTokenHash []byte `db:"session_token_hash" json:"sessionTokenHash"`
RefreshTokenHash []byte `db:"refresh_token_hash" json:"refreshTokenHash"`
ExpiresAt time.Time `db:"expires_at" json:"expiresAt"`
UserAgent string `db:"user_agent" json:"userAgent"`
IpAddress netip.Addr `db:"ip_address" json:"ipAddress"`
}
type RemoveUserFromOrgParams ¶
type RevokeInvitationParams ¶
type Role ¶
type Role struct {
ID uuid.UUID `db:"id" json:"id"`
RoleName string `db:"role_name" json:"roleName"`
RoleDesc *string `db:"role_desc" json:"roleDesc"`
Permissions []string `db:"permissions" json:"permissions"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type Session ¶
type Session struct {
ID uuid.UUID `db:"id" json:"id"`
UserID uuid.UUID `db:"user_id" json:"userId"`
OrgID uuid.UUID `db:"org_id" json:"orgId"`
SessionTokenHash []byte `db:"session_token_hash" json:"sessionTokenHash"`
RefreshTokenHash []byte `db:"refresh_token_hash" json:"refreshTokenHash"`
IpAddress netip.Addr `db:"ip_address" json:"ipAddress"`
UserAgent string `db:"user_agent" json:"userAgent"`
MfaVerifiedAt time.Time `db:"mfa_verified_at" json:"mfaVerifiedAt"`
ExpiresAt time.Time `db:"expires_at" json:"expiresAt"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
}
type UpdateBackupCodesByEmailParams ¶
type UpdateBackupCodesByEmailParams struct {
Email string `db:"email" json:"email"`
BackupCodes []models.BackupCode `db:"backup_codes" json:"backupCodes"`
BackupCodesDownloaded bool `db:"backup_codes_downloaded" json:"backupCodesDownloaded"`
}
type UpdateBackupCodesParams ¶
type UpdateBackupCodesParams struct {
ID uuid.UUID `db:"id" json:"id"`
BackupCodes []models.BackupCode `db:"backup_codes" json:"backupCodes"`
BackupCodesDownloaded bool `db:"backup_codes_downloaded" json:"backupCodesDownloaded"`
}
type UpdateOrgDomainParams ¶
type UpdateOrgParams ¶
type UpdateRoleParams ¶
type UpdateRoleParams struct {
ID uuid.UUID `db:"id" json:"id"`
RoleName *string `db:"role_name" json:"roleName"`
RoleDesc *string `db:"role_desc" json:"roleDesc"`
PermissionsAdd []string `db:"permissions_add" json:"permissionsAdd"`
PermissionsRemove []string `db:"permissions_remove" json:"permissionsRemove"`
}
type UpdateSessionMFAParams ¶
type UpdateUserParams ¶
type User ¶
type User struct {
ID uuid.UUID `db:"id" json:"id"`
ExtID *string `db:"ext_id" json:"extId"`
Email string `db:"email" json:"email"`
EmailVerified bool `db:"email_verified" json:"emailVerified"`
PasswordHash *string `db:"password_hash" json:"passwordHash"`
BackupCodes []models.BackupCode `db:"backup_codes" json:"backupCodes"`
BackupCodesDownloaded bool `db:"backup_codes_downloaded" json:"backupCodesDownloaded"`
Name string `db:"name" json:"name"`
AvatarUrl *string `db:"avatar_url" json:"avatarUrl"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type UserOrg ¶
type UserOrg struct {
UserID uuid.UUID `db:"user_id" json:"userId"`
OrgID uuid.UUID `db:"org_id" json:"orgId"`
IsOrgAdmin bool `db:"is_org_admin" json:"isOrgAdmin"`
JoinedAt time.Time `db:"joined_at" json:"joinedAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
IsBanned bool `db:"is_banned" json:"isBanned"`
}
type ValidateInviteEmailsRow ¶
type ValidateInviteEmailsRow struct {
Email string `db:"email" json:"email"`
UserExists bool `db:"user_exists" json:"userExists"`
UsedForMfa bool `db:"used_for_mfa" json:"usedForMfa"`
AlreadyInvited bool `db:"already_invited" json:"alreadyInvited"`
AlreadyMember bool `db:"already_member" json:"alreadyMember"`
}
type VerificationToken ¶
type VerificationToken struct {
ID uuid.UUID `db:"id" json:"id"`
UserID uuid.UUID `db:"user_id" json:"userId"`
Email *string `db:"email" json:"email"`
TokenType VerificationTokenType `db:"token_type" json:"tokenType"`
TokenHash []byte `db:"token_hash" json:"tokenHash"`
ExpiresAt time.Time `db:"expires_at" json:"expiresAt"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
}
type VerificationTokenType ¶
type VerificationTokenType string
const ( VerificationTokenTypeEmailVerification VerificationTokenType = "email_verification" VerificationTokenTypePasswordReset VerificationTokenType = "password_reset" )
func AllVerificationTokenTypeValues ¶
func AllVerificationTokenTypeValues() []VerificationTokenType
func (*VerificationTokenType) Scan ¶
func (e *VerificationTokenType) Scan(src interface{}) error
Click to show internal directories.
Click to hide internal directories.