authqueries

package
v0.0.0-...-3cbcd64 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyProjectMemberProjectionParams

type ApplyProjectMemberProjectionParams struct {
	ProjectID uuid.UUID
	UserID    uuid.UUID
	Revision  int64
	Present   bool
}

type CreateTeamAPIKeyParams

type CreateTeamAPIKeyParams struct {
	TeamID           uuid.UUID
	CreatedBy        *uuid.UUID
	ApiKeyHash       string
	ApiKeyPrefix     string
	ApiKeyLength     int32
	ApiKeyMaskPrefix string
	ApiKeyMaskSuffix string
	Name             string
}

type CreateTeamMembershipIfMissingParams

type CreateTeamMembershipIfMissingParams struct {
	UserID    uuid.UUID
	TeamID    uuid.UUID
	IsDefault bool
	AddedBy   *uuid.UUID
}

type CreateTeamMembershipParams

type CreateTeamMembershipParams struct {
	UserID    uuid.UUID
	TeamID    uuid.UUID
	IsDefault bool
	AddedBy   *uuid.UUID
}

type CreateTeamParams

type CreateTeamParams struct {
	Name          string
	Tier          string
	Email         string
	IsBlocked     bool
	BlockedReason *string
}

type CreateTeamRow

type CreateTeamRow struct {
	ID                      uuid.UUID
	CreatedAt               time.Time
	IsBlocked               bool
	Name                    string
	Tier                    string
	Email                   string
	IsBanned                bool
	BlockedReason           *string
	ClusterID               *uuid.UUID
	SandboxSchedulingLabels []string
	Slug                    string
}

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 DeleteTeamAPIKeyParams

type DeleteTeamAPIKeyParams struct {
	ID     uuid.UUID
	TeamID uuid.UUID
}

type DeleteTeamMemberParams

type DeleteTeamMemberParams struct {
	TeamID uuid.UUID
	UserID uuid.UUID
}

type GetAutoJoinTeamsBySSOOrganizationIDRow

type GetAutoJoinTeamsBySSOOrganizationIDRow struct {
	Team Team
}

type GetDefaultTeamByUserIDRow

type GetDefaultTeamByUserIDRow struct {
	ID                      uuid.UUID
	CreatedAt               time.Time
	IsBlocked               bool
	Name                    string
	Tier                    string
	Email                   string
	IsBanned                bool
	BlockedReason           *string
	ClusterID               *uuid.UUID
	SandboxSchedulingLabels []string
	Slug                    string
}

type GetTeamAPIKeysWithCreatorRow

type GetTeamAPIKeysWithCreatorRow struct {
	ID               uuid.UUID
	Name             string
	ApiKeyPrefix     string
	ApiKeyLength     int32
	ApiKeyMaskPrefix string
	ApiKeyMaskSuffix string
	CreatedByID      *uuid.UUID
	CreatedAt        time.Time
	LastUsed         *time.Time
}

type GetTeamWithTierByAPIKeyRow

type GetTeamWithTierByAPIKeyRow struct {
	Team      Team
	TeamLimit TeamLimit
}

type GetTeamWithTierByTeamAndUserParams

type GetTeamWithTierByTeamAndUserParams struct {
	UserID uuid.UUID
	ID     uuid.UUID
}

type GetTeamWithTierByTeamAndUserRow

type GetTeamWithTierByTeamAndUserRow struct {
	Team      Team
	TeamLimit TeamLimit
}

type GetTeamWithTierByTeamIDRow

type GetTeamWithTierByTeamIDRow struct {
	Team      Team
	TeamLimit TeamLimit
}

type GetTeamsWithUsersTeamsRow

type GetTeamsWithUsersTeamsRow struct {
	Team      Team
	IsDefault bool
}

type GetTeamsWithUsersTeamsWithTierForUpdateRow

type GetTeamsWithUsersTeamsWithTierForUpdateRow struct {
	ID                       uuid.UUID
	CreatedAt                time.Time
	IsBlocked                bool
	Name                     string
	Tier                     string
	Email                    string
	IsBanned                 bool
	BlockedReason            *string
	ClusterID                *uuid.UUID
	SandboxSchedulingLabels  []string
	Slug                     string
	IsDefault                bool
	ID_2                     uuid.UUID
	MaxLengthHours           int64
	ConcurrentSandboxes      int64
	ConcurrentTemplateBuilds int64
	MaxVcpu                  int64
	MaxRamMb                 int64
	DiskMb                   int64
	EventsTtlDays            int64
}

type GetTeamsWithUsersTeamsWithTierRow

type GetTeamsWithUsersTeamsWithTierRow struct {
	Team      Team
	IsDefault bool
	TeamLimit TeamLimit
}

type GetUserIdentitiesBySubjectsParams

type GetUserIdentitiesBySubjectsParams struct {
	OidcIss  string
	OidcSubs []string
}

type GetUserIdentitiesBySubjectsRow

type GetUserIdentitiesBySubjectsRow struct {
	OidcIss string
	OidcSub string
	UserID  uuid.UUID
}

type GetUserIdentitiesByUserIDsAndIssuersParams

type GetUserIdentitiesByUserIDsAndIssuersParams struct {
	OidcIssuers []string
	UserIds     []uuid.UUID
}

type GetUserIdentitiesByUserIDsAndIssuersRow

type GetUserIdentitiesByUserIDsAndIssuersRow struct {
	OidcIss string
	OidcSub string
	UserID  uuid.UUID
}

type GetUserIdentityParams

type GetUserIdentityParams struct {
	OidcIss string
	OidcSub string
}

type GetUserIdentityRow

type GetUserIdentityRow struct {
	OidcIss   string
	OidcSub   string
	UserID    uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
}

type InsertManagedTeamParams

type InsertManagedTeamParams struct {
	ID    uuid.UUID
	Name  string
	Slug  string
	Tier  string
	Email string
}

type InsertManagedTeamRow

type InsertManagedTeamRow struct {
	ID    uuid.UUID
	Name  string
	Slug  string
	Email string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ApplyProjectMemberProjection

func (q *Queries) ApplyProjectMemberProjection(ctx context.Context, arg ApplyProjectMemberProjectionParams) (bool, error)

func (*Queries) CreateTeam

func (q *Queries) CreateTeam(ctx context.Context, arg CreateTeamParams) (CreateTeamRow, error)

func (*Queries) CreateTeamAPIKey

func (q *Queries) CreateTeamAPIKey(ctx context.Context, arg CreateTeamAPIKeyParams) (TeamApiKey, error)

func (*Queries) CreateTeamMembership

func (q *Queries) CreateTeamMembership(ctx context.Context, arg CreateTeamMembershipParams) error

func (*Queries) CreateTeamMembershipIfMissing

func (q *Queries) CreateTeamMembershipIfMissing(ctx context.Context, arg CreateTeamMembershipIfMissingParams) error

func (*Queries) DeletePublicUser

func (q *Queries) DeletePublicUser(ctx context.Context, id uuid.UUID) error

func (*Queries) DeleteTeamAPIKey

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

func (*Queries) DeleteTeamByID

func (q *Queries) DeleteTeamByID(ctx context.Context, id uuid.UUID) error

func (*Queries) DeleteTeamMember

func (q *Queries) DeleteTeamMember(ctx context.Context, arg DeleteTeamMemberParams) error

func (*Queries) GetAutoJoinTeamsBySSOOrganizationID

func (q *Queries) GetAutoJoinTeamsBySSOOrganizationID(ctx context.Context, ssoOrganizationID uuid.UUID) ([]GetAutoJoinTeamsBySSOOrganizationIDRow, error)

func (*Queries) GetDefaultTeamByUserID

func (q *Queries) GetDefaultTeamByUserID(ctx context.Context, userID uuid.UUID) (GetDefaultTeamByUserIDRow, error)

func (*Queries) GetTeamAPIKeyHashes

func (q *Queries) GetTeamAPIKeyHashes(ctx context.Context, teamID uuid.UUID) ([]string, error)

func (*Queries) GetTeamAPIKeysWithCreator

func (q *Queries) GetTeamAPIKeysWithCreator(ctx context.Context, teamID uuid.UUID) ([]GetTeamAPIKeysWithCreatorRow, error)

func (*Queries) GetTeamMemberIDs

func (q *Queries) GetTeamMemberIDs(ctx context.Context, teamID uuid.UUID) ([]uuid.UUID, error)

GetTeamMemberIDs lists the users whose cached auth entry carries this team's data, so invalidating the team can reach all of them.

func (*Queries) GetTeamWithTierByAPIKey

func (q *Queries) GetTeamWithTierByAPIKey(ctx context.Context, apiKeyHash string) (GetTeamWithTierByAPIKeyRow, error)

func (*Queries) GetTeamWithTierByTeamID

func (q *Queries) GetTeamWithTierByTeamID(ctx context.Context, id uuid.UUID) (GetTeamWithTierByTeamIDRow, error)

func (*Queries) GetTeamsWithUsersTeams

func (q *Queries) GetTeamsWithUsersTeams(ctx context.Context, userID uuid.UUID) ([]GetTeamsWithUsersTeamsRow, error)

func (*Queries) GetTeamsWithUsersTeamsWithTier

func (q *Queries) GetTeamsWithUsersTeamsWithTier(ctx context.Context, userID uuid.UUID) ([]GetTeamsWithUsersTeamsWithTierRow, error)

func (*Queries) GetTeamsWithUsersTeamsWithTierForUpdate

func (q *Queries) GetTeamsWithUsersTeamsWithTierForUpdate(ctx context.Context, userID uuid.UUID) ([]GetTeamsWithUsersTeamsWithTierForUpdateRow, error)

func (*Queries) GetUserIdentity

func (q *Queries) GetUserIdentity(ctx context.Context, arg GetUserIdentityParams) (GetUserIdentityRow, error)

func (*Queries) InsertManagedTeam

func (q *Queries) InsertManagedTeam(ctx context.Context, arg InsertManagedTeamParams) (InsertManagedTeamRow, error)

Tier is assigned here and only here. DO NOTHING covers the case where the lock above found nothing and another request inserted the same id before this ran: no row means that happened. A slug collision is a different constraint and still raises.

func (*Queries) LockManagedTeam

func (q *Queries) LockManagedTeam(ctx context.Context, id uuid.UUID) (uuid.UUID, error)

Project reconciliation for the control-plane management interface. The caller supplies the id, so create and reconcile are one request and these are its branches. Taken first, so the branch is decided by whether the project exists rather than by an insert failing.

func (*Queries) LockPublicUserForUpdate

func (q *Queries) LockPublicUserForUpdate(ctx context.Context, id uuid.UUID) (uuid.UUID, error)

func (*Queries) UpdateLastTimeUsed

func (q *Queries) UpdateLastTimeUsed(ctx context.Context, apiKeyHash string) error

func (*Queries) UpdateManagedTeam

func (q *Queries) UpdateManagedTeam(ctx context.Context, arg UpdateManagedTeamParams) (UpdateManagedTeamRow, error)

Touches only the properties the caller synchronizes. Tier stays because it is this side's to assign; is_blocked stays because an operator's decision must outlive a routine push.

func (*Queries) UpdateTeamApiKey

func (q *Queries) UpdateTeamApiKey(ctx context.Context, arg UpdateTeamApiKeyParams) (uuid.UUID, error)

func (*Queries) UpsertPublicIdentity

func (q *Queries) UpsertPublicIdentity(ctx context.Context, arg UpsertPublicIdentityParams) (uuid.UUID, error)

func (*Queries) UpsertPublicUser

func (q *Queries) UpsertPublicUser(ctx context.Context, id uuid.UUID) error

func (*Queries) UpsertTeamMember

func (q *Queries) UpsertTeamMember(ctx context.Context, arg UpsertTeamMemberParams) error

func (*Queries) WithTx

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

type Team

type Team struct {
	ID                      uuid.UUID
	CreatedAt               time.Time
	IsBlocked               bool
	Name                    string
	Tier                    string
	Email                   string
	IsBanned                bool
	BlockedReason           *string
	ClusterID               *uuid.UUID
	SandboxSchedulingLabels []string
	SsoOrganizationID       *uuid.UUID
	SsoAutoJoin             bool
	Slug                    string
}

type TeamApiKey

type TeamApiKey struct {
	CreatedAt time.Time
	TeamID    uuid.UUID
	UpdatedAt *time.Time
	Name      string
	LastUsed  *time.Time
	CreatedBy *uuid.UUID
	ID        uuid.UUID
	// sensitive
	ApiKeyHash       string
	ApiKeyPrefix     string
	ApiKeyLength     int32
	ApiKeyMaskPrefix string
	ApiKeyMaskSuffix string
}

type TeamLimit

type TeamLimit struct {
	ID                       uuid.UUID
	MaxLengthHours           int64
	ConcurrentSandboxes      int64
	ConcurrentTemplateBuilds int64
	MaxVcpu                  int64
	MaxRamMb                 int64
	DiskMb                   int64
	EventsTtlDays            int64
	DefaultFreeDiskSizeMb    int64
	MaxDiskSizeMb            int64
	MaxFreeDiskSizeMb        int64
}

type UpdateManagedTeamParams

type UpdateManagedTeamParams struct {
	Name  string
	Slug  string
	Email string
	ID    uuid.UUID
}

type UpdateManagedTeamRow

type UpdateManagedTeamRow struct {
	ID    uuid.UUID
	Name  string
	Slug  string
	Email string
}

type UpdateTeamApiKeyParams

type UpdateTeamApiKeyParams struct {
	Name      string
	UpdatedAt *time.Time
	ID        uuid.UUID
	TeamID    uuid.UUID
}

type UpsertPublicIdentityParams

type UpsertPublicIdentityParams struct {
	OidcIss string
	OidcSub string
	UserID  uuid.UUID
}

type UpsertTeamMemberParams

type UpsertTeamMemberParams struct {
	UserID    uuid.UUID
	TeamID    uuid.UUID
	IsDefault bool
	AddedBy   *uuid.UUID
}

Jump to

Keyboard shortcuts

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