gen

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateSCIMClientParams

type CreateSCIMClientParams struct {
	Name        string
	TokenHash   string
	TokenPrefix 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 DeleteIdentityParams

type DeleteIdentityParams struct {
	UserID  string
	Issuer  string
	Subject string
}

type DeleteProjectRoleBindingsParams

type DeleteProjectRoleBindingsParams struct {
	ProjectKind string
	ProjectID   string
}

type DeleteTeamRoleBindingsParams

type DeleteTeamRoleBindingsParams struct {
	TeamKind    string
	TeamID      string
	ProjectKind string
}

type GetRoleBindingSubjectsRow

type GetRoleBindingSubjectsRow struct {
	BindingID   string
	Kind        string
	SubjectID   pgtype.Text
	SubjectName pgtype.Text
	Position    int32
}

type GetUserByIdentityParams

type GetUserByIdentityParams struct {
	Issuer  string
	Subject string
}

type Group

type Group struct {
	ID              string
	Name            string
	DisplayName     string
	Metadata        []byte
	Spec            []byte
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	ResourceVersion int64
	ExternalSource  pgtype.Text
	ExternalID      pgtype.Text
}

type GroupMember

type GroupMember struct {
	GroupID  string
	UserID   string
	Position int32
}

type Identity

type Identity struct {
	UserID     string
	Issuer     string
	Subject    string
	ExternalID pgtype.Text
	CreatedAt  pgtype.Timestamptz
}

type InsertGroupMemberParams

type InsertGroupMemberParams struct {
	GroupID  string
	UserID   string
	Position int32
}

type InsertRoleBindingSubjectParams

type InsertRoleBindingSubjectParams struct {
	BindingID     string
	Kind          string
	SubjectID     pgtype.Text
	SubjectName   pgtype.Text
	SubjectUserID pgtype.Text
	SubjectSaID   pgtype.Text
	Position      int32
}

type ListRoleBindingSubjectsRow

type ListRoleBindingSubjectsRow struct {
	BindingID   string
	Kind        string
	SubjectID   pgtype.Text
	SubjectName pgtype.Text
	Position    int32
}

type MarkSCIMClientUsedParams

type MarkSCIMClientUsedParams struct {
	UsedAt pgtype.Timestamptz
	Name   string
}

type Project

type Project struct {
	ID              string
	Name            string
	DisplayName     string
	TeamID          string
	Metadata        []byte
	Spec            []byte
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	ResourceVersion int64
}

type PromoteOldestIdentityParams

type PromoteOldestIdentityParams struct {
	ID          string
	OidcSubject pgtype.Text
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) BumpUserTokenVersion

func (q *Queries) BumpUserTokenVersion(ctx context.Context, id string) error

func (*Queries) ClearPrimaryIdentity

func (q *Queries) ClearPrimaryIdentity(ctx context.Context, id string) error

func (*Queries) CreateSCIMClient

func (q *Queries) CreateSCIMClient(ctx context.Context, arg CreateSCIMClientParams) (int64, error)

A name is never issued twice, revoked or not, so a new token never inherits the rows an old one provisioned; the insert touches no row.

func (*Queries) DeleteGroup

func (q *Queries) DeleteGroup(ctx context.Context, id string) error

func (*Queries) DeleteGroupMembers

func (q *Queries) DeleteGroupMembers(ctx context.Context, groupID string) error

func (*Queries) DeleteIdentity

func (q *Queries) DeleteIdentity(ctx context.Context, arg DeleteIdentityParams) error

func (*Queries) DeleteProject

func (q *Queries) DeleteProject(ctx context.Context, id string) error

func (*Queries) DeleteProjectRoleBindings

func (q *Queries) DeleteProjectRoleBindings(ctx context.Context, arg DeleteProjectRoleBindingsParams) error

func (*Queries) DeleteRole

func (q *Queries) DeleteRole(ctx context.Context, id string) error

func (*Queries) DeleteRoleBinding

func (q *Queries) DeleteRoleBinding(ctx context.Context, id string) error

func (*Queries) DeleteRoleBindingSubjects

func (q *Queries) DeleteRoleBindingSubjects(ctx context.Context, bindingID string) error

func (*Queries) DeleteServiceAccount

func (q *Queries) DeleteServiceAccount(ctx context.Context, id string) error

func (*Queries) DeleteTeam

func (q *Queries) DeleteTeam(ctx context.Context, id string) error

func (*Queries) DeleteTeamRoleBindings

func (q *Queries) DeleteTeamRoleBindings(ctx context.Context, arg DeleteTeamRoleBindingsParams) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id string) error

func (*Queries) DeleteUserIdentities

func (q *Queries) DeleteUserIdentities(ctx context.Context, userID string) error

func (*Queries) GetGroup

func (q *Queries) GetGroup(ctx context.Context, id string) (Group, error)

func (*Queries) GetGroupMembers

func (q *Queries) GetGroupMembers(ctx context.Context, groupID string) ([]GroupMember, error)

func (*Queries) GetProject

func (q *Queries) GetProject(ctx context.Context, id string) (Project, error)

func (*Queries) GetRole

func (q *Queries) GetRole(ctx context.Context, id string) (Role, error)

func (*Queries) GetRoleBinding

func (q *Queries) GetRoleBinding(ctx context.Context, id string) (RoleBinding, error)

func (*Queries) GetRoleBindingSubjects

func (q *Queries) GetRoleBindingSubjects(ctx context.Context, bindingID string) ([]GetRoleBindingSubjectsRow, error)

func (*Queries) GetSCIMClient

func (q *Queries) GetSCIMClient(ctx context.Context, name string) (ScimClient, error)

func (*Queries) GetSCIMClientByTokenHash

func (q *Queries) GetSCIMClientByTokenHash(ctx context.Context, tokenHash string) (ScimClient, error)

func (*Queries) GetServiceAccount

func (q *Queries) GetServiceAccount(ctx context.Context, id string) (ServiceAccount, error)

func (*Queries) GetTeam

func (q *Queries) GetTeam(ctx context.Context, id string) (Team, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id string) (User, error)

Columns are listed, never *, so a column a product adds to a shared table does not break these reads.

func (*Queries) GetUserByIdentity

func (q *Queries) GetUserByIdentity(ctx context.Context, arg GetUserByIdentityParams) (User, error)

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)

func (*Queries) InsertGroupMember

func (q *Queries) InsertGroupMember(ctx context.Context, arg InsertGroupMemberParams) error

func (*Queries) InsertRoleBindingSubject

func (q *Queries) InsertRoleBindingSubject(ctx context.Context, arg InsertRoleBindingSubjectParams) error

func (*Queries) ListGroupMembers

func (q *Queries) ListGroupMembers(ctx context.Context) ([]GroupMember, error)

func (*Queries) ListGroups

func (q *Queries) ListGroups(ctx context.Context) ([]Group, error)

func (*Queries) ListIdentities

func (q *Queries) ListIdentities(ctx context.Context) ([]Identity, error)

func (*Queries) ListProjects

func (q *Queries) ListProjects(ctx context.Context) ([]Project, error)

func (*Queries) ListRoleBindingSubjects

func (q *Queries) ListRoleBindingSubjects(ctx context.Context) ([]ListRoleBindingSubjectsRow, error)

func (*Queries) ListRoleBindings

func (q *Queries) ListRoleBindings(ctx context.Context) ([]RoleBinding, error)

func (*Queries) ListRoles

func (q *Queries) ListRoles(ctx context.Context) ([]Role, error)

func (*Queries) ListSCIMClients

func (q *Queries) ListSCIMClients(ctx context.Context) ([]ScimClient, error)

func (*Queries) ListServiceAccounts

func (q *Queries) ListServiceAccounts(ctx context.Context) ([]ServiceAccount, error)

func (*Queries) ListTeams

func (q *Queries) ListTeams(ctx context.Context) ([]Team, error)

func (*Queries) ListUserIdentities

func (q *Queries) ListUserIdentities(ctx context.Context, userID string) ([]Identity, error)

Identities read oldest first; that order also picks the next primary when the primary is removed.

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context) ([]User, error)

func (*Queries) ListUsersByExternalID

func (q *Queries) ListUsersByExternalID(ctx context.Context, externalID pgtype.Text) ([]User, error)

func (*Queries) MarkSCIMClientUsed

func (q *Queries) MarkSCIMClientUsed(ctx context.Context, arg MarkSCIMClientUsedParams) error

Writes at most once a minute per client, so a burst of provisioning calls is not a burst of updates.

func (*Queries) PromoteOldestIdentity

func (q *Queries) PromoteOldestIdentity(ctx context.Context, arg PromoteOldestIdentityParams) error

Promotes only while the primary is still the one named, NULL for none; with no identity left the primary stays NULL.

func (*Queries) RevokeSCIMClient

func (q *Queries) RevokeSCIMClient(ctx context.Context, name string) (int64, error)

func (*Queries) RotateSCIMClient

func (q *Queries) RotateSCIMClient(ctx context.Context, arg RotateSCIMClientParams) (int64, error)

func (*Queries) SetFirstPrimaryIdentity

func (q *Queries) SetFirstPrimaryIdentity(ctx context.Context, arg SetFirstPrimaryIdentityParams) (int64, error)

The trigger writes the identity row. A concurrent first link waits on the row lock, then finds oidc_subject set and matches nothing.

func (*Queries) SetPrimaryIdentityIfNone

func (q *Queries) SetPrimaryIdentityIfNone(ctx context.Context, arg SetPrimaryIdentityIfNoneParams) error

func (*Queries) SetUserDisabled

func (q *Queries) SetUserDisabled(ctx context.Context, arg SetUserDisabledParams) (int64, error)

The same statement bumps the token version, so a re-enabled account never revives a token minted before.

func (*Queries) UpdateProvisionedUser

func (q *Queries) UpdateProvisionedUser(ctx context.Context, arg UpdateProvisionedUserParams) (int64, error)

Touches only the columns a provisioning source owns, and only on its own rows.

func (*Queries) UpsertGroup

func (q *Queries) UpsertGroup(ctx context.Context, arg UpsertGroupParams) (int64, error)

func (*Queries) UpsertIdentity

func (q *Queries) UpsertIdentity(ctx context.Context, arg UpsertIdentityParams) (int64, error)

An identity another account holds matches no row, which the store reads as a conflict.

func (*Queries) UpsertProject

func (q *Queries) UpsertProject(ctx context.Context, arg UpsertProjectParams) (int64, error)

func (*Queries) UpsertRole

func (q *Queries) UpsertRole(ctx context.Context, arg UpsertRoleParams) (int64, error)

func (*Queries) UpsertRoleBinding

func (q *Queries) UpsertRoleBinding(ctx context.Context, arg UpsertRoleBindingParams) (int64, error)

func (*Queries) UpsertServiceAccount

func (q *Queries) UpsertServiceAccount(ctx context.Context, arg UpsertServiceAccountParams) (int64, error)

func (*Queries) UpsertTeam

func (q *Queries) UpsertTeam(ctx context.Context, arg UpsertTeamParams) (int64, error)

func (*Queries) UpsertUser

func (q *Queries) UpsertUser(ctx context.Context, arg UpsertUserParams) (int64, error)

A new password, primary identity or disabled flag bumps the token version in the same statement, so no token outlives the change.

func (*Queries) WithTx

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

type Role

type Role struct {
	ID              string
	Name            string
	DisplayName     string
	Metadata        []byte
	Spec            []byte
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	ResourceVersion int64
}

type RoleBinding

type RoleBinding struct {
	ID              string
	Name            string
	DisplayName     string
	RoleID          string
	ScopeKind       string
	ScopeID         pgtype.Text
	Metadata        []byte
	Spec            []byte
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	ResourceVersion int64
}

type RoleBindingSubject

type RoleBindingSubject struct {
	BindingID     string
	Kind          string
	SubjectID     pgtype.Text
	SubjectName   pgtype.Text
	SubjectUserID pgtype.Text
	SubjectSaID   pgtype.Text
	Position      int32
}

type RotateSCIMClientParams

type RotateSCIMClientParams struct {
	Name        string
	TokenHash   string
	TokenPrefix string
}

type ScimClient

type ScimClient struct {
	Name        string
	TokenHash   string
	TokenPrefix string
	CreatedAt   pgtype.Timestamptz
	LastUsedAt  pgtype.Timestamptz
	RevokedAt   pgtype.Timestamptz
}

type ServiceAccount

type ServiceAccount struct {
	ID              string
	Name            string
	DisplayName     string
	ProjectID       string
	Metadata        []byte
	Spec            []byte
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	ResourceVersion int64
}

type SetFirstPrimaryIdentityParams

type SetFirstPrimaryIdentityParams struct {
	ID          string
	OidcSubject pgtype.Text
}

type SetPrimaryIdentityIfNoneParams

type SetPrimaryIdentityIfNoneParams struct {
	ID          string
	OidcSubject pgtype.Text
}

type SetUserDisabledParams

type SetUserDisabledParams struct {
	ID       string
	Disabled bool
}

type Team

type Team struct {
	ID              string
	Name            string
	DisplayName     string
	Metadata        []byte
	Spec            []byte
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	ResourceVersion int64
}

type UpdateProvisionedUserParams

type UpdateProvisionedUserParams struct {
	ID             string
	ExternalSource pgtype.Text
	Username       string
	Email          pgtype.Text
	ExternalID     pgtype.Text
}

type UpsertGroupParams

type UpsertGroupParams struct {
	ID              string
	Name            string
	DisplayName     string
	Metadata        []byte
	Spec            []byte
	ExternalSource  pgtype.Text
	ExternalID      pgtype.Text
	ExpectedVersion pgtype.Int8
}

type UpsertIdentityParams

type UpsertIdentityParams struct {
	UserID     string
	Issuer     string
	Subject    string
	ExternalID pgtype.Text
}

type UpsertProjectParams

type UpsertProjectParams struct {
	ID              string
	Name            string
	DisplayName     string
	TeamID          string
	Metadata        []byte
	Spec            []byte
	ExpectedVersion pgtype.Int8
}

type UpsertRoleBindingParams

type UpsertRoleBindingParams struct {
	ID              string
	Name            string
	DisplayName     string
	RoleID          string
	ScopeKind       string
	ScopeID         pgtype.Text
	Metadata        []byte
	Spec            []byte
	ExpectedVersion pgtype.Int8
}

type UpsertRoleParams

type UpsertRoleParams struct {
	ID              string
	Name            string
	DisplayName     string
	Metadata        []byte
	Spec            []byte
	ExpectedVersion pgtype.Int8
}

type UpsertServiceAccountParams

type UpsertServiceAccountParams struct {
	ID              string
	Name            string
	DisplayName     string
	ProjectID       string
	Metadata        []byte
	Spec            []byte
	ExpectedVersion pgtype.Int8
}

type UpsertTeamParams

type UpsertTeamParams struct {
	ID              string
	Name            string
	DisplayName     string
	Metadata        []byte
	Spec            []byte
	ExpectedVersion pgtype.Int8
}

type UpsertUserParams

type UpsertUserParams struct {
	ID              string
	Username        string
	Email           pgtype.Text
	PasswordHash    pgtype.Text
	OidcSubject     pgtype.Text
	Roles           []string
	Disabled        bool
	ExternalSource  pgtype.Text
	ExternalID      pgtype.Text
	ExpectedVersion pgtype.Int8
}

type User

type User struct {
	ID              string
	Username        string
	Email           pgtype.Text
	PasswordHash    pgtype.Text
	OidcSubject     pgtype.Text
	Roles           []string
	Disabled        bool
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	TokenVersion    int32
	ExternalSource  pgtype.Text
	ExternalID      pgtype.Text
	ResourceVersion int64
}

Jump to

Keyboard shortcuts

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