Documentation ¶
Index ¶
- Variables
- func CalculateProjectHierarchyOffset(hierarchy int) int
- func ErrIsUniqueViolation(err error) bool
- func PropValueFromDbV1(rawValue json.RawMessage) (any, error)
- func PropValueToDbV1(value any) (json.RawMessage, error)
- func WithTransaction[T any](store Store, fn func(querier ExtendQuerier) (T, error)) (result T, err error)
- type ActionType
- type AlertEvent
- type AlertStatusTypes
- type Artifact
- type AuthorizationFlow
- type BulkGetProfilesByIDRow
- type Bundle
- type CountProfilesByEntityTypeRow
- type CreateEntityParams
- type CreateEntityWithIDParams
- type CreateInvitationParams
- type CreateOrEnsureEntityByIDParams
- type CreateOrganizationParams
- type CreateProfileForEntityParams
- type CreateProfileParams
- type CreateProjectParams
- type CreateProjectWithIDParams
- type CreateProviderParams
- type CreateRepositoryParams
- type CreateRuleTypeParams
- type CreateSelectorParams
- type CreateSessionStateParams
- type CreateSubscriptionParams
- type DBTX
- type DeleteEntityParams
- type DeleteNonUpdatedRulesParams
- type DeleteProfileForEntityParams
- type DeleteProfileParams
- type DeleteProjectRow
- type DeletePropertyParams
- type DeleteProviderParams
- type DeleteSessionStateByProjectIDParams
- type EnqueueFlushParams
- type Entities
- type Entitlement
- type EntityExecutionLock
- type EntityInstance
- type EntityProfile
- type EvalStatusTypes
- type EvaluationRuleEntity
- type EvaluationStatus
- type ExtendQuerier
- type Feature
- type FindProvidersParams
- type FlushCache
- type GetAccessTokenByEnrollmentNonceParams
- type GetAccessTokenByProjectIDParams
- type GetAccessTokenSinceDateParams
- type GetArtifactByIDParams
- type GetArtifactByNameParams
- type GetBundleParams
- type GetChildrenProjectsRow
- type GetEntitiesByTypeParams
- type GetEntityByNameParams
- type GetEvaluationHistoryParams
- type GetEvaluationHistoryRow
- type GetFeatureInProjectParams
- type GetInstallationIDByEnrollmentNonceParams
- type GetInvitationByCodeRow
- type GetInvitationsByEmailAndProjectParams
- type GetInvitationsByEmailAndProjectRow
- type GetInvitationsByEmailRow
- type GetLatestEvalStateForRuleEntityParams
- type GetParentProjectsUntilParams
- type GetProfileByIDAndLockParams
- type GetProfileByIDParams
- type GetProfileByNameAndLockParams
- type GetProfileByProjectAndIDParams
- type GetProfileByProjectAndIDRow
- type GetProfileByProjectAndNameParams
- type GetProfileByProjectAndNameRow
- type GetProfileStatusByIdAndProjectParams
- type GetProfileStatusByIdAndProjectRow
- type GetProfileStatusByNameAndProjectParams
- type GetProfileStatusByNameAndProjectRow
- type GetProfileStatusByProjectRow
- type GetProjectIDBySessionStateRow
- type GetPropertyParams
- type GetProviderByIDAndProjectParams
- type GetProviderByNameParams
- type GetRepositoryByIDAndProjectParams
- type GetRepositoryByRepoNameParams
- type GetRuleInstancesEntityInProjectsParams
- type GetRuleTypeByNameParams
- type GetRuleTypeIDByRuleNameEntityProfileParams
- type GetRuleTypesByEntityInHierarchyParams
- type GetSubscriptionByProjectBundleParams
- type GetTypedEntitiesByPropertyParams
- type GetTypedEntitiesOptions
- type InsertAlertEventParams
- type InsertEvaluationRuleEntityParams
- type InsertEvaluationStatusParams
- type InsertRemediationEventParams
- type LatestEvaluationStatus
- type ListEvaluationHistoryParams
- type ListEvaluationHistoryRow
- type ListEvaluationHistoryStaleRecordsParams
- type ListEvaluationHistoryStaleRecordsRow
- type ListInvitationsForProjectRow
- type ListOldestRuleEvaluationsByRepositoryIdRow
- type ListOrganizationsParams
- type ListProfilesByProjectIDAndLabelParams
- type ListProfilesByProjectIDAndLabelRow
- func (r ListProfilesByProjectIDAndLabelRow) GetContextualRules() pqtype.NullRawMessage
- func (r ListProfilesByProjectIDAndLabelRow) GetEntityProfile() NullEntities
- func (r ListProfilesByProjectIDAndLabelRow) GetProfile() Profile
- func (r ListProfilesByProjectIDAndLabelRow) GetSelectors() []ProfileSelector
- type ListProvidersByProjectIDPaginatedParams
- type ListRegisteredRepositoriesByProjectIDAndProviderParams
- type ListRepositoriesAfterIDParams
- type ListRepositoriesByProjectIDParams
- type ListRuleEvaluationsByProfileIdParams
- type ListRuleEvaluationsByProfileIdRow
- type ListTokensToMigrateParams
- type ListUsersParams
- type LockIfThresholdNotExceededParams
- type NullActionType
- type NullAlertStatusTypes
- type NullAuthorizationFlow
- type NullEntities
- type NullEvalStatusTypes
- type NullProviderClass
- type NullProviderType
- type NullReleaseStatus
- type NullRemediationStatusTypes
- type NullSeverity
- type OrphanProjectParams
- type PgTime
- type PgTimeArray
- type Profile
- type ProfileRow
- type ProfileSelector
- type ProfileStatus
- type ProfilesWithEntityProfile
- type Project
- type Property
- type PropertyValueV1
- type PropertyWrapper
- type Provider
- type ProviderAccessToken
- type ProviderClass
- type ProviderGithubAppInstallation
- type ProviderType
- type PullRequest
- type Querier
- type Queries
- func (q *Queries) BulkGetProfilesByID(ctx context.Context, profileIds []uuid.UUID) ([]BulkGetProfilesByIDRow, error)
- func (q *Queries) CountProfilesByEntityType(ctx context.Context) ([]CountProfilesByEntityTypeRow, error)
- func (q *Queries) CountProfilesByName(ctx context.Context, name string) (int64, error)
- func (q *Queries) CountProfilesByProjectID(ctx context.Context, projectID uuid.UUID) (int64, error)
- func (q *Queries) CountRepositories(ctx context.Context) (int64, error)
- func (q *Queries) CountRepositoriesByProjectID(ctx context.Context, projectID uuid.UUID) (int64, error)
- func (q *Queries) CountUsers(ctx context.Context) (int64, error)
- func (q *Queries) CreateEntity(ctx context.Context, arg CreateEntityParams) (EntityInstance, error)
- func (q *Queries) CreateEntityWithID(ctx context.Context, arg CreateEntityWithIDParams) (EntityInstance, error)
- func (q *Queries) CreateInvitation(ctx context.Context, arg CreateInvitationParams) (UserInvite, error)
- func (q *Queries) CreateOrEnsureEntityByID(ctx context.Context, arg CreateOrEnsureEntityByIDParams) (EntityInstance, error)
- func (q *Queries) CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Project, error)
- func (q *Queries) CreateProfile(ctx context.Context, arg CreateProfileParams) (Profile, error)
- func (q *Queries) CreateProfileForEntity(ctx context.Context, arg CreateProfileForEntityParams) (EntityProfile, error)
- func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error)
- func (q *Queries) CreateProjectWithID(ctx context.Context, arg CreateProjectWithIDParams) (Project, error)
- func (q *Queries) CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error)
- func (q *Queries) CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error)
- func (q *Queries) CreateRuleType(ctx context.Context, arg CreateRuleTypeParams) (RuleType, error)
- func (q *Queries) CreateSelector(ctx context.Context, arg CreateSelectorParams) (ProfileSelector, error)
- func (q *Queries) CreateSessionState(ctx context.Context, arg CreateSessionStateParams) (SessionStore, error)
- func (q *Queries) CreateSubscription(ctx context.Context, arg CreateSubscriptionParams) (Subscription, error)
- func (q *Queries) CreateUser(ctx context.Context, identitySubject string) (User, error)
- func (q *Queries) DeleteAllPropertiesForEntity(ctx context.Context, entityID uuid.UUID) error
- func (q *Queries) DeleteArtifact(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteEntity(ctx context.Context, arg DeleteEntityParams) error
- func (q *Queries) DeleteEvaluationHistoryByIDs(ctx context.Context, evaluationids []uuid.UUID) (int64, error)
- func (q *Queries) DeleteExpiredSessionStates(ctx context.Context) (int64, error)
- func (q *Queries) DeleteInstallationIDByAppID(ctx context.Context, appInstallationID int64) error
- func (q *Queries) DeleteInvitation(ctx context.Context, code string) (UserInvite, error)
- func (q *Queries) DeleteNonUpdatedRules(ctx context.Context, arg DeleteNonUpdatedRulesParams) error
- func (q *Queries) DeleteOrganization(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteProfile(ctx context.Context, arg DeleteProfileParams) error
- func (q *Queries) DeleteProfileForEntity(ctx context.Context, arg DeleteProfileForEntityParams) error
- func (q *Queries) DeleteProject(ctx context.Context, id uuid.UUID) ([]DeleteProjectRow, error)
- func (q *Queries) DeleteProperty(ctx context.Context, arg DeletePropertyParams) error
- func (q *Queries) DeleteProvider(ctx context.Context, arg DeleteProviderParams) error
- func (q *Queries) DeleteRepository(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteRuleType(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteSelector(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteSelectorsByProfileID(ctx context.Context, profileID uuid.UUID) error
- func (q *Queries) DeleteSessionStateByProjectID(ctx context.Context, arg DeleteSessionStateByProjectIDParams) error
- func (q *Queries) DeleteUser(ctx context.Context, id int32) error
- func (q *Queries) EnqueueFlush(ctx context.Context, arg EnqueueFlushParams) (FlushCache, error)
- func (q *Queries) FindProviders(ctx context.Context, arg FindProvidersParams) ([]Provider, error)
- func (q *Queries) FlushCache(ctx context.Context, entityInstanceID uuid.UUID) (FlushCache, error)
- func (q *Queries) GetAccessTokenByEnrollmentNonce(ctx context.Context, arg GetAccessTokenByEnrollmentNonceParams) (ProviderAccessToken, error)
- func (q *Queries) GetAccessTokenByProjectID(ctx context.Context, arg GetAccessTokenByProjectIDParams) (ProviderAccessToken, error)
- func (q *Queries) GetAccessTokenByProvider(ctx context.Context, provider string) ([]ProviderAccessToken, error)
- func (q *Queries) GetAccessTokenSinceDate(ctx context.Context, arg GetAccessTokenSinceDateParams) (ProviderAccessToken, error)
- func (q *Queries) GetAllPropertiesForEntity(ctx context.Context, entityID uuid.UUID) ([]Property, error)
- func (q *Queries) GetAllPropertyValuesV1(ctx context.Context, entityID uuid.UUID) ([]PropertyValueV1, error)
- func (q *Queries) GetArtifactByID(ctx context.Context, arg GetArtifactByIDParams) (Artifact, error)
- func (q *Queries) GetArtifactByName(ctx context.Context, arg GetArtifactByNameParams) (Artifact, error)
- func (q *Queries) GetBundle(ctx context.Context, arg GetBundleParams) (Bundle, error)
- func (q *Queries) GetChildrenProjects(ctx context.Context, id uuid.UUID) ([]GetChildrenProjectsRow, error)
- func (q *Queries) GetEntitiesByProjectHierarchy(ctx context.Context, projects []uuid.UUID) ([]EntityInstance, error)
- func (q *Queries) GetEntitiesByProvider(ctx context.Context, providerID uuid.UUID) ([]EntityInstance, error)
- func (q *Queries) GetEntitiesByType(ctx context.Context, arg GetEntitiesByTypeParams) ([]EntityInstance, error)
- func (q *Queries) GetEntitlementFeaturesByProjectID(ctx context.Context, projectID uuid.UUID) ([]string, error)
- func (q *Queries) GetEntityByID(ctx context.Context, id uuid.UUID) (EntityInstance, error)
- func (q *Queries) GetEntityByName(ctx context.Context, arg GetEntityByNameParams) (EntityInstance, error)
- func (q *Queries) GetEvaluationHistory(ctx context.Context, arg GetEvaluationHistoryParams) (GetEvaluationHistoryRow, error)
- func (q *Queries) GetFeatureInProject(ctx context.Context, arg GetFeatureInProjectParams) (json.RawMessage, error)
- func (q *Queries) GetImmediateChildrenProjects(ctx context.Context, parentID uuid.UUID) ([]Project, error)
- func (q *Queries) GetInstallationIDByAppID(ctx context.Context, appInstallationID int64) (ProviderGithubAppInstallation, error)
- func (q *Queries) GetInstallationIDByEnrollmentNonce(ctx context.Context, arg GetInstallationIDByEnrollmentNonceParams) (ProviderGithubAppInstallation, error)
- func (q *Queries) GetInstallationIDByProviderID(ctx context.Context, providerID uuid.NullUUID) (ProviderGithubAppInstallation, error)
- func (q *Queries) GetInvitationByCode(ctx context.Context, code string) (GetInvitationByCodeRow, error)
- func (q *Queries) GetInvitationsByEmail(ctx context.Context, email string) ([]GetInvitationsByEmailRow, error)
- func (q *Queries) GetInvitationsByEmailAndProject(ctx context.Context, arg GetInvitationsByEmailAndProjectParams) ([]GetInvitationsByEmailAndProjectRow, error)
- func (q *Queries) GetLatestEvalStateForRuleEntity(ctx context.Context, arg GetLatestEvalStateForRuleEntityParams) (EvaluationStatus, error)
- func (q *Queries) GetOrganization(ctx context.Context, id uuid.UUID) (Project, error)
- func (q *Queries) GetOrganizationByName(ctx context.Context, name string) (Project, error)
- func (q *Queries) GetOrganizationForUpdate(ctx context.Context, name string) (Project, error)
- func (q *Queries) GetParentProjects(ctx context.Context, id uuid.UUID) ([]uuid.UUID, error)
- func (q *Queries) GetParentProjectsUntil(ctx context.Context, arg GetParentProjectsUntilParams) ([]uuid.UUID, error)
- func (q *Queries) GetProfileByID(ctx context.Context, arg GetProfileByIDParams) (Profile, error)
- func (q *Queries) GetProfileByIDAndLock(ctx context.Context, arg GetProfileByIDAndLockParams) (Profile, error)
- func (q *Queries) GetProfileByNameAndLock(ctx context.Context, arg GetProfileByNameAndLockParams) (Profile, error)
- func (q *Queries) GetProfileByProjectAndID(ctx context.Context, arg GetProfileByProjectAndIDParams) ([]GetProfileByProjectAndIDRow, error)
- func (q *Queries) GetProfileByProjectAndName(ctx context.Context, arg GetProfileByProjectAndNameParams) ([]GetProfileByProjectAndNameRow, error)
- func (q *Queries) GetProfileStatusByIdAndProject(ctx context.Context, arg GetProfileStatusByIdAndProjectParams) (GetProfileStatusByIdAndProjectRow, error)
- func (q *Queries) GetProfileStatusByNameAndProject(ctx context.Context, arg GetProfileStatusByNameAndProjectParams) (GetProfileStatusByNameAndProjectRow, error)
- func (q *Queries) GetProfileStatusByProject(ctx context.Context, projectID uuid.UUID) ([]GetProfileStatusByProjectRow, error)
- func (q *Queries) GetProjectByID(ctx context.Context, id uuid.UUID) (Project, error)
- func (q *Queries) GetProjectByName(ctx context.Context, name string) (Project, error)
- func (q *Queries) GetProjectIDBySessionState(ctx context.Context, sessionState string) (GetProjectIDBySessionStateRow, error)
- func (q *Queries) GetProperty(ctx context.Context, arg GetPropertyParams) (Property, error)
- func (q *Queries) GetPropertyValueV1(ctx context.Context, entityID uuid.UUID, key string) (PropertyValueV1, error)
- func (q *Queries) GetProviderByID(ctx context.Context, id uuid.UUID) (Provider, error)
- func (q *Queries) GetProviderByIDAndProject(ctx context.Context, arg GetProviderByIDAndProjectParams) (Provider, error)
- func (q *Queries) GetProviderByName(ctx context.Context, arg GetProviderByNameParams) (Provider, error)
- func (q *Queries) GetRepositoryByID(ctx context.Context, id uuid.UUID) (Repository, error)
- func (q *Queries) GetRepositoryByIDAndProject(ctx context.Context, arg GetRepositoryByIDAndProjectParams) (Repository, error)
- func (q *Queries) GetRepositoryByRepoID(ctx context.Context, repoID int64) (Repository, error)
- func (q *Queries) GetRepositoryByRepoName(ctx context.Context, arg GetRepositoryByRepoNameParams) (Repository, error)
- func (q *Queries) GetRuleEvaluationByProfileIdAndRuleType(ctx context.Context, profileID uuid.UUID, ruleName sql.NullString, ...) (*ListRuleEvaluationsByProfileIdRow, error)
- func (q *Queries) GetRuleInstancesEntityInProjects(ctx context.Context, arg GetRuleInstancesEntityInProjectsParams) ([]RuleInstance, error)
- func (q *Queries) GetRuleInstancesForProfile(ctx context.Context, profileID uuid.UUID) ([]RuleInstance, error)
- func (q *Queries) GetRuleTypeByID(ctx context.Context, id uuid.UUID) (RuleType, error)
- func (q *Queries) GetRuleTypeByName(ctx context.Context, arg GetRuleTypeByNameParams) (RuleType, error)
- func (q *Queries) GetRuleTypeIDByRuleNameEntityProfile(ctx context.Context, arg GetRuleTypeIDByRuleNameEntityProfileParams) (uuid.UUID, error)
- func (q *Queries) GetRuleTypeNameByID(ctx context.Context, id uuid.UUID) (string, error)
- func (q *Queries) GetRuleTypesByEntityInHierarchy(ctx context.Context, arg GetRuleTypesByEntityInHierarchyParams) ([]RuleType, error)
- func (q *Queries) GetSelectorByID(ctx context.Context, id uuid.UUID) (ProfileSelector, error)
- func (q *Queries) GetSelectorsByProfileID(ctx context.Context, profileID uuid.UUID) ([]ProfileSelector, error)
- func (q *Queries) GetSubscriptionByProjectBundle(ctx context.Context, arg GetSubscriptionByProjectBundleParams) (Subscription, error)
- func (q *Queries) GetTypedEntitiesByProperty(ctx context.Context, arg GetTypedEntitiesByPropertyParams) ([]EntityInstance, error)
- func (q *Queries) GetTypedEntitiesByPropertyV1(ctx context.Context, entType Entities, key string, value any, ...) ([]EntityInstance, error)
- func (q *Queries) GetUnclaimedInstallationsByUser(ctx context.Context, ghID sql.NullString) ([]ProviderGithubAppInstallation, error)
- func (q *Queries) GetUserByID(ctx context.Context, id int32) (User, error)
- func (q *Queries) GetUserBySubject(ctx context.Context, identitySubject string) (User, error)
- func (q *Queries) GlobalListProviders(ctx context.Context) ([]Provider, error)
- func (q *Queries) GlobalListProvidersByClass(ctx context.Context, class ProviderClass) ([]Provider, error)
- func (q *Queries) InsertAlertEvent(ctx context.Context, arg InsertAlertEventParams) error
- func (q *Queries) InsertEvaluationRuleEntity(ctx context.Context, arg InsertEvaluationRuleEntityParams) (uuid.UUID, error)
- func (q *Queries) InsertEvaluationStatus(ctx context.Context, arg InsertEvaluationStatusParams) (uuid.UUID, error)
- func (q *Queries) InsertRemediationEvent(ctx context.Context, arg InsertRemediationEventParams) error
- func (q *Queries) ListArtifactsByRepoID(ctx context.Context, repositoryID uuid.NullUUID) ([]Artifact, error)
- func (q *Queries) ListEvaluationHistory(ctx context.Context, arg ListEvaluationHistoryParams) ([]ListEvaluationHistoryRow, error)
- func (q *Queries) ListEvaluationHistoryStaleRecords(ctx context.Context, arg ListEvaluationHistoryStaleRecordsParams) ([]ListEvaluationHistoryStaleRecordsRow, error)
- func (q *Queries) ListFlushCache(ctx context.Context) ([]FlushCache, error)
- func (q *Queries) ListInvitationsForProject(ctx context.Context, project uuid.UUID) ([]ListInvitationsForProjectRow, error)
- func (q *Queries) ListOldestRuleEvaluationsByRepositoryId(ctx context.Context, repositoryIds []uuid.UUID) ([]ListOldestRuleEvaluationsByRepositoryIdRow, error)
- func (q *Queries) ListOrganizations(ctx context.Context, arg ListOrganizationsParams) ([]Project, error)
- func (q *Queries) ListProfilesByProjectIDAndLabel(ctx context.Context, arg ListProfilesByProjectIDAndLabelParams) ([]ListProfilesByProjectIDAndLabelRow, error)
- func (q *Queries) ListProfilesInstantiatingRuleType(ctx context.Context, ruleTypeID uuid.UUID) ([]string, error)
- func (q *Queries) ListProvidersByProjectID(ctx context.Context, projects []uuid.UUID) ([]Provider, error)
- func (q *Queries) ListProvidersByProjectIDPaginated(ctx context.Context, arg ListProvidersByProjectIDPaginatedParams) ([]Provider, error)
- func (q *Queries) ListRegisteredRepositoriesByProjectIDAndProvider(ctx context.Context, ...) ([]Repository, error)
- func (q *Queries) ListRepositoriesAfterID(ctx context.Context, arg ListRepositoriesAfterIDParams) ([]Repository, error)
- func (q *Queries) ListRepositoriesByProjectID(ctx context.Context, arg ListRepositoriesByProjectIDParams) ([]Repository, error)
- func (q *Queries) ListRuleEvaluationsByProfileId(ctx context.Context, arg ListRuleEvaluationsByProfileIdParams) ([]ListRuleEvaluationsByProfileIdRow, error)
- func (q *Queries) ListRuleTypesByProject(ctx context.Context, projectID uuid.UUID) ([]RuleType, error)
- func (q *Queries) ListTokensToMigrate(ctx context.Context, arg ListTokensToMigrateParams) ([]ProviderAccessToken, error)
- func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
- func (q *Queries) LockIfThresholdNotExceeded(ctx context.Context, arg LockIfThresholdNotExceededParams) (EntityExecutionLock, error)
- func (q *Queries) OrphanProject(ctx context.Context, arg OrphanProjectParams) (Project, error)
- func (q *Queries) ReleaseLock(ctx context.Context, arg ReleaseLockParams) error
- func (q *Queries) RepositoryExistsAfterID(ctx context.Context, id uuid.UUID) (bool, error)
- func (q *Queries) SetCurrentVersion(ctx context.Context, arg SetCurrentVersionParams) error
- func (q *Queries) UpdateEncryptedSecret(ctx context.Context, arg UpdateEncryptedSecretParams) error
- func (q *Queries) UpdateInvitationRole(ctx context.Context, arg UpdateInvitationRoleParams) (UserInvite, error)
- func (q *Queries) UpdateLease(ctx context.Context, arg UpdateLeaseParams) error
- func (q *Queries) UpdateOrganization(ctx context.Context, arg UpdateOrganizationParams) (Project, error)
- func (q *Queries) UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error)
- func (q *Queries) UpdateProjectMeta(ctx context.Context, arg UpdateProjectMetaParams) (Project, error)
- func (q *Queries) UpdateProvider(ctx context.Context, arg UpdateProviderParams) error
- func (q *Queries) UpdateReminderLastSentForRepositories(ctx context.Context, repositoryIds []uuid.UUID) error
- func (q *Queries) UpdateRuleType(ctx context.Context, arg UpdateRuleTypeParams) (RuleType, error)
- func (q *Queries) UpdateSelector(ctx context.Context, arg UpdateSelectorParams) (ProfileSelector, error)
- func (q *Queries) UpsertAccessToken(ctx context.Context, arg UpsertAccessTokenParams) (ProviderAccessToken, error)
- func (q *Queries) UpsertArtifact(ctx context.Context, arg UpsertArtifactParams) (Artifact, error)
- func (q *Queries) UpsertBundle(ctx context.Context, arg UpsertBundleParams) error
- func (q *Queries) UpsertInstallationID(ctx context.Context, arg UpsertInstallationIDParams) (ProviderGithubAppInstallation, error)
- func (q *Queries) UpsertLatestEvaluationStatus(ctx context.Context, arg UpsertLatestEvaluationStatusParams) error
- func (q *Queries) UpsertProfileForEntity(ctx context.Context, arg UpsertProfileForEntityParams) (EntityProfile, error)
- func (q *Queries) UpsertProperty(ctx context.Context, arg UpsertPropertyParams) (Property, error)
- func (q *Queries) UpsertPropertyValueV1(ctx context.Context, params UpsertPropertyValueV1Params) (Property, error)
- func (q *Queries) UpsertRuleInstance(ctx context.Context, arg UpsertRuleInstanceParams) (uuid.UUID, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type ReleaseLockParams
- type ReleaseStatus
- type RemediationEvent
- type RemediationStatusTypes
- type Repository
- type RuleInstance
- type RuleType
- type SQLStore
- func (s *SQLStore) BeginTransaction() (*sql.Tx, error)
- func (s *SQLStore) CheckHealth() error
- func (*SQLStore) Commit(tx *sql.Tx) error
- func (*SQLStore) GetQuerierWithTransaction(tx *sql.Tx) ExtendQuerier
- func (*SQLStore) Rollback(tx *sql.Tx) error
- func (s *SQLStore) WithTransactionErr(fn func(querier ExtendQuerier) error) error
- type SessionStore
- type SetCurrentVersionParams
- type Severity
- type Store
- type Subscription
- type UpdateEncryptedSecretParams
- type UpdateInvitationRoleParams
- type UpdateLeaseParams
- type UpdateOrganizationParams
- type UpdateProfileParams
- type UpdateProjectMetaParams
- type UpdateProviderParams
- type UpdateRuleTypeParams
- type UpdateSelectorParams
- type UpsertAccessTokenParams
- type UpsertArtifactParams
- type UpsertBundleParams
- type UpsertInstallationIDParams
- type UpsertLatestEvaluationStatusParams
- type UpsertProfileForEntityParams
- type UpsertPropertyParams
- type UpsertPropertyValueV1Params
- type UpsertRuleInstanceParams
- type User
- type UserInvite
Constants ¶
This section is empty.
Variables ¶
var ErrBadPropVersion = errors.New("unexpected property version")
ErrBadPropVersion is returned when a property has an unexpected version
var ErrParseData = errors.New("unable to parse SQL data")
ErrParseData signifies that an error occurred while parsing SQL data
Functions ¶
func CalculateProjectHierarchyOffset ¶
CalculateProjectHierarchyOffset will calculate the offset for the hierarchy in the returned array from GetChildrenProjects and GetParentProjects. This is because the calling project is also returned.
func ErrIsUniqueViolation ¶
ErrIsUniqueViolation returns true if the error is a unique violation
func PropValueFromDbV1 ¶
func PropValueFromDbV1(rawValue json.RawMessage) (any, error)
PropValueFromDbV1 deserializes a property value from a JSON byte slice
func PropValueToDbV1 ¶
func PropValueToDbV1(value any) (json.RawMessage, error)
PropValueToDbV1 serializes a property value to a JSON byte slice
func WithTransaction ¶
func WithTransaction[T any](store Store, fn func(querier ExtendQuerier) (T, error)) (result T, err error)
WithTransaction wraps an operation in a new DB transaction. Ideally this would be a method of the Store interface, but Go's generics do not allow for generic methods :(
Types ¶
type ActionType ¶
type ActionType string
const ( ActionTypeOn ActionType = "on" ActionTypeOff ActionType = "off" ActionTypeDryRun ActionType = "dry_run" )
func (*ActionType) Scan ¶
func (e *ActionType) Scan(src interface{}) error
type AlertEvent ¶
type AlertEvent struct { ID uuid.UUID `json:"id"` EvaluationID uuid.UUID `json:"evaluation_id"` Status AlertStatusTypes `json:"status"` Details string `json:"details"` Metadata json.RawMessage `json:"metadata"` CreatedAt time.Time `json:"created_at"` }
type AlertStatusTypes ¶
type AlertStatusTypes string
const ( AlertStatusTypesOn AlertStatusTypes = "on" AlertStatusTypesOff AlertStatusTypes = "off" AlertStatusTypesError AlertStatusTypes = "error" AlertStatusTypesSkipped AlertStatusTypes = "skipped" AlertStatusTypesNotAvailable AlertStatusTypes = "not_available" )
func (*AlertStatusTypes) Scan ¶
func (e *AlertStatusTypes) Scan(src interface{}) error
type Artifact ¶
type Artifact struct { ID uuid.UUID `json:"id"` RepositoryID uuid.NullUUID `json:"repository_id"` ArtifactName string `json:"artifact_name"` ArtifactType string `json:"artifact_type"` ArtifactVisibility string `json:"artifact_visibility"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ProjectID uuid.UUID `json:"project_id"` ProviderID uuid.UUID `json:"provider_id"` ProviderName string `json:"provider_name"` }
type AuthorizationFlow ¶
type AuthorizationFlow string
const ( AuthorizationFlowUserInput AuthorizationFlow = "user_input" AuthorizationFlowOauth2AuthorizationCodeFlow AuthorizationFlow = "oauth2_authorization_code_flow" AuthorizationFlowGithubAppFlow AuthorizationFlow = "github_app_flow" AuthorizationFlowNone AuthorizationFlow = "none" )
func (*AuthorizationFlow) Scan ¶
func (e *AuthorizationFlow) Scan(src interface{}) error
type BulkGetProfilesByIDRow ¶
type BulkGetProfilesByIDRow struct { Profile Profile `json:"profile"` ProfilesWithSelectors []ProfileSelector `json:"profiles_with_selectors"` }
type CreateEntityParams ¶
type CreateInvitationParams ¶
type CreateOrganizationParams ¶
type CreateOrganizationParams struct { Name string `json:"name"` Metadata json.RawMessage `json:"metadata"` }
type CreateProfileForEntityParams ¶
type CreateProfileForEntityParams struct { Entity Entities `json:"entity"` ProfileID uuid.UUID `json:"profile_id"` ContextualRules json.RawMessage `json:"contextual_rules"` }
type CreateProfileParams ¶
type CreateProfileParams struct { ProjectID uuid.UUID `json:"project_id"` Remediate NullActionType `json:"remediate"` Alert NullActionType `json:"alert"` Name string `json:"name"` SubscriptionID uuid.NullUUID `json:"subscription_id"` DisplayName string `json:"display_name"` Labels []string `json:"labels"` }
type CreateProjectParams ¶
type CreateProjectParams struct { Name string `json:"name"` ParentID uuid.NullUUID `json:"parent_id"` Metadata json.RawMessage `json:"metadata"` }
type CreateProjectWithIDParams ¶
type CreateProjectWithIDParams struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Metadata json.RawMessage `json:"metadata"` }
type CreateProviderParams ¶
type CreateProviderParams struct { Name string `json:"name"` ProjectID uuid.UUID `json:"project_id"` Class ProviderClass `json:"class"` Implements []ProviderType `json:"implements"` Definition json.RawMessage `json:"definition"` AuthFlows []AuthorizationFlow `json:"auth_flows"` }
type CreateRepositoryParams ¶
type CreateRepositoryParams struct { Provider string `json:"provider"` ProjectID uuid.UUID `json:"project_id"` RepoOwner string `json:"repo_owner"` RepoName string `json:"repo_name"` RepoID int64 `json:"repo_id"` IsPrivate bool `json:"is_private"` IsFork bool `json:"is_fork"` WebhookID sql.NullInt64 `json:"webhook_id"` WebhookUrl string `json:"webhook_url"` DeployUrl string `json:"deploy_url"` CloneUrl string `json:"clone_url"` DefaultBranch sql.NullString `json:"default_branch"` License sql.NullString `json:"license"` ProviderID uuid.UUID `json:"provider_id"` }
type CreateRuleTypeParams ¶
type CreateRuleTypeParams struct { Name string `json:"name"` ProjectID uuid.UUID `json:"project_id"` Description string `json:"description"` Guidance string `json:"guidance"` Definition json.RawMessage `json:"definition"` SeverityValue Severity `json:"severity_value"` SubscriptionID uuid.NullUUID `json:"subscription_id"` DisplayName string `json:"display_name"` ReleasePhase ReleaseStatus `json:"release_phase"` ShortFailureMessage string `json:"short_failure_message"` }
type CreateSelectorParams ¶
type CreateSelectorParams struct { ProfileID uuid.UUID `json:"profile_id"` Entity NullEntities `json:"entity"` Selector string `json:"selector"` Comment string `json:"comment"` }
type CreateSessionStateParams ¶
type CreateSessionStateParams struct { Provider string `json:"provider"` ProjectID uuid.UUID `json:"project_id"` RemoteUser sql.NullString `json:"remote_user"` SessionState string `json:"session_state"` OwnerFilter sql.NullString `json:"owner_filter"` ProviderConfig []byte `json:"provider_config"` EncryptedRedirect pqtype.NullRawMessage `json:"encrypted_redirect"` }
type DeleteEntityParams ¶
type DeleteProfileParams ¶
type DeleteProjectRow ¶
type DeletePropertyParams ¶
type DeleteProviderParams ¶
type EnqueueFlushParams ¶
type Entities ¶
type Entities string
const ( EntitiesRepository Entities = "repository" EntitiesBuildEnvironment Entities = "build_environment" EntitiesArtifact Entities = "artifact" EntitiesPullRequest Entities = "pull_request" EntitiesRelease Entities = "release" EntitiesPipelineRun Entities = "pipeline_run" EntitiesTaskRun Entities = "task_run" EntitiesBuild Entities = "build" )
type Entitlement ¶
type EntityExecutionLock ¶
type EntityInstance ¶
type EntityProfile ¶
type EvalStatusTypes ¶
type EvalStatusTypes string
const ( EvalStatusTypesSuccess EvalStatusTypes = "success" EvalStatusTypesFailure EvalStatusTypes = "failure" EvalStatusTypesError EvalStatusTypes = "error" EvalStatusTypesSkipped EvalStatusTypes = "skipped" EvalStatusTypesPending EvalStatusTypes = "pending" )
func (*EvalStatusTypes) Scan ¶
func (e *EvalStatusTypes) Scan(src interface{}) error
type EvaluationRuleEntity ¶
type EvaluationRuleEntity struct { ID uuid.UUID `json:"id"` RuleID uuid.UUID `json:"rule_id"` RepositoryID uuid.NullUUID `json:"repository_id"` PullRequestID uuid.NullUUID `json:"pull_request_id"` ArtifactID uuid.NullUUID `json:"artifact_id"` EntityType Entities `json:"entity_type"` EntityInstanceID uuid.UUID `json:"entity_instance_id"` }
type EvaluationStatus ¶
type EvaluationStatus struct { ID uuid.UUID `json:"id"` RuleEntityID uuid.UUID `json:"rule_entity_id"` Status EvalStatusTypes `json:"status"` Details string `json:"details"` EvaluationTime time.Time `json:"evaluation_time"` Checkpoint json.RawMessage `json:"checkpoint"` }
type ExtendQuerier ¶
type ExtendQuerier interface { Querier GetRuleEvaluationByProfileIdAndRuleType(ctx context.Context, profileID uuid.UUID, ruleName sql.NullString, entityID uuid.UUID, ruleTypeName sql.NullString) (*ListRuleEvaluationsByProfileIdRow, error) UpsertPropertyValueV1(ctx context.Context, params UpsertPropertyValueV1Params) (Property, error) GetPropertyValueV1(ctx context.Context, entityID uuid.UUID, key string) (PropertyValueV1, error) GetAllPropertyValuesV1(ctx context.Context, entityID uuid.UUID) ([]PropertyValueV1, error) GetTypedEntitiesByPropertyV1( ctx context.Context, entType Entities, key string, value any, opts GetTypedEntitiesOptions, ) ([]EntityInstance, error) }
ExtendQuerier extends the Querier interface with custom queries
type FindProvidersParams ¶
type FindProvidersParams struct { Projects []uuid.UUID `json:"projects"` Trait NullProviderType `json:"trait"` Name sql.NullString `json:"name"` }
type FlushCache ¶
type GetAccessTokenByEnrollmentNonceParams ¶
type GetAccessTokenByEnrollmentNonceParams struct { ProjectID uuid.UUID `json:"project_id"` EnrollmentNonce sql.NullString `json:"enrollment_nonce"` }
type GetArtifactByIDParams ¶
type GetArtifactByNameParams ¶
type GetBundleParams ¶
type GetChildrenProjectsRow ¶
type GetEntitiesByTypeParams ¶
type GetEntityByNameParams ¶
type GetEvaluationHistoryRow ¶
type GetEvaluationHistoryRow struct { EvaluationID uuid.UUID `json:"evaluation_id"` EvaluatedAt time.Time `json:"evaluated_at"` EntityType Entities `json:"entity_type"` EntityID uuid.UUID `json:"entity_id"` EntityName string `json:"entity_name"` ProjectID uuid.UUID `json:"project_id"` RuleType string `json:"rule_type"` RuleName string `json:"rule_name"` RuleSeverity Severity `json:"rule_severity"` ProfileName string `json:"profile_name"` EvaluationStatus EvalStatusTypes `json:"evaluation_status"` EvaluationDetails string `json:"evaluation_details"` RemediationStatus NullRemediationStatusTypes `json:"remediation_status"` RemediationDetails sql.NullString `json:"remediation_details"` AlertStatus NullAlertStatusTypes `json:"alert_status"` AlertDetails sql.NullString `json:"alert_details"` }
type GetInstallationIDByEnrollmentNonceParams ¶
type GetInstallationIDByEnrollmentNonceParams struct { ProjectID uuid.NullUUID `json:"project_id"` EnrollmentNonce sql.NullString `json:"enrollment_nonce"` }
type GetInvitationByCodeRow ¶
type GetInvitationByCodeRow struct { Code string `json:"code"` Email string `json:"email"` Role string `json:"role"` Project uuid.UUID `json:"project"` Sponsor int32 `json:"sponsor"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` IdentitySubject string `json:"identity_subject"` }
type GetInvitationsByEmailAndProjectRow ¶
type GetInvitationsByEmailAndProjectRow struct { Code string `json:"code"` Email string `json:"email"` Role string `json:"role"` Project uuid.UUID `json:"project"` Sponsor int32 `json:"sponsor"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` IdentitySubject string `json:"identity_subject"` }
type GetInvitationsByEmailRow ¶
type GetInvitationsByEmailRow struct { Code string `json:"code"` Email string `json:"email"` Role string `json:"role"` Project uuid.UUID `json:"project"` Sponsor int32 `json:"sponsor"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` IdentitySubject string `json:"identity_subject"` }
type GetProfileByIDParams ¶
type GetProfileByProjectAndIDRow ¶
type GetProfileByProjectAndIDRow struct { Profile Profile `json:"profile"` ProfilesWithEntityProfile ProfilesWithEntityProfile `json:"profiles_with_entity_profile"` ProfilesWithSelectors []ProfileSelector `json:"profiles_with_selectors"` }
type GetProfileByProjectAndNameRow ¶
type GetProfileByProjectAndNameRow struct { Profile Profile `json:"profile"` ProfilesWithEntityProfile ProfilesWithEntityProfile `json:"profiles_with_entity_profile"` ProfilesWithSelectors []ProfileSelector `json:"profiles_with_selectors"` }
type GetProjectIDBySessionStateRow ¶
type GetProjectIDBySessionStateRow struct { Provider string `json:"provider"` ProjectID uuid.UUID `json:"project_id"` RemoteUser sql.NullString `json:"remote_user"` OwnerFilter sql.NullString `json:"owner_filter"` ProviderConfig []byte `json:"provider_config"` RedirectUrl sql.NullString `json:"redirect_url"` EncryptedRedirect pqtype.NullRawMessage `json:"encrypted_redirect"` }
type GetPropertyParams ¶
type GetProviderByNameParams ¶
type GetRuleTypeByNameParams ¶
type GetTypedEntitiesOptions ¶
GetTypedEntitiesOptions provides options for GetTypedEntitiesByPropertyV1
type InsertAlertEventParams ¶
type InsertAlertEventParams struct { EvaluationID uuid.UUID `json:"evaluation_id"` Status AlertStatusTypes `json:"status"` Details string `json:"details"` Metadata json.RawMessage `json:"metadata"` }
type InsertEvaluationStatusParams ¶
type InsertEvaluationStatusParams struct { RuleEntityID uuid.UUID `json:"rule_entity_id"` Status EvalStatusTypes `json:"status"` Details string `json:"details"` Checkpoint json.RawMessage `json:"checkpoint"` }
type InsertRemediationEventParams ¶
type InsertRemediationEventParams struct { EvaluationID uuid.UUID `json:"evaluation_id"` Status RemediationStatusTypes `json:"status"` Details string `json:"details"` Metadata json.RawMessage `json:"metadata"` }
type LatestEvaluationStatus ¶
type ListEvaluationHistoryParams ¶
type ListEvaluationHistoryParams struct { Next sql.NullTime `json:"next"` Prev sql.NullTime `json:"prev"` Entitytypes []Entities `json:"entitytypes"` Entitynames []string `json:"entitynames"` Profilenames []string `json:"profilenames"` Remediations []RemediationStatusTypes `json:"remediations"` Alerts []AlertStatusTypes `json:"alerts"` Statuses []EvalStatusTypes `json:"statuses"` Notentitytypes []Entities `json:"notentitytypes"` Notentitynames []string `json:"notentitynames"` Notprofilenames []string `json:"notprofilenames"` Notremediations []RemediationStatusTypes `json:"notremediations"` Notalerts []AlertStatusTypes `json:"notalerts"` Notstatuses []EvalStatusTypes `json:"notstatuses"` Fromts sql.NullTime `json:"fromts"` Tots sql.NullTime `json:"tots"` Projectid uuid.UUID `json:"projectid"` Size int64 `json:"size"` }
type ListEvaluationHistoryRow ¶
type ListEvaluationHistoryRow struct { EvaluationID uuid.UUID `json:"evaluation_id"` EvaluatedAt time.Time `json:"evaluated_at"` EntityType Entities `json:"entity_type"` EntityID uuid.UUID `json:"entity_id"` ProjectID uuid.UUID `json:"project_id"` RuleType string `json:"rule_type"` RuleName string `json:"rule_name"` RuleSeverity Severity `json:"rule_severity"` ProfileName string `json:"profile_name"` EvaluationStatus EvalStatusTypes `json:"evaluation_status"` EvaluationDetails string `json:"evaluation_details"` RemediationStatus NullRemediationStatusTypes `json:"remediation_status"` RemediationDetails sql.NullString `json:"remediation_details"` AlertStatus NullAlertStatusTypes `json:"alert_status"` AlertDetails sql.NullString `json:"alert_details"` }
type ListOrganizationsParams ¶
type ListProfilesByProjectIDAndLabelParams ¶
type ListProfilesByProjectIDAndLabelParams struct { ProjectID uuid.UUID `json:"project_id"` IncludeLabels []string `json:"include_labels"` ExcludeLabels []string `json:"exclude_labels"` }
func (*ListProfilesByProjectIDAndLabelParams) LabelsFromFilter ¶
func (lp *ListProfilesByProjectIDAndLabelParams) LabelsFromFilter(filter string)
LabelsFromFilter parses the filter string and populates the IncludeLabels and ExcludeLabels fields
type ListProfilesByProjectIDAndLabelRow ¶
type ListProfilesByProjectIDAndLabelRow struct { Profile Profile `json:"profile"` ProfilesWithEntityProfile ProfilesWithEntityProfile `json:"profiles_with_entity_profile"` ProfilesWithSelectors []ProfileSelector `json:"profiles_with_selectors"` }
func (ListProfilesByProjectIDAndLabelRow) GetContextualRules ¶
func (r ListProfilesByProjectIDAndLabelRow) GetContextualRules() pqtype.NullRawMessage
GetContextualRules returns the contextual rules
func (ListProfilesByProjectIDAndLabelRow) GetEntityProfile ¶
func (r ListProfilesByProjectIDAndLabelRow) GetEntityProfile() NullEntities
GetEntityProfile returns the entity profile
func (ListProfilesByProjectIDAndLabelRow) GetProfile ¶
func (r ListProfilesByProjectIDAndLabelRow) GetProfile() Profile
GetProfile returns the profile
func (ListProfilesByProjectIDAndLabelRow) GetSelectors ¶
func (r ListProfilesByProjectIDAndLabelRow) GetSelectors() []ProfileSelector
GetSelectors returns the selectors
type ListRegisteredRepositoriesByProjectIDAndProviderParams ¶
type ListRegisteredRepositoriesByProjectIDAndProviderParams struct { ProjectID uuid.UUID `json:"project_id"` Provider sql.NullString `json:"provider"` }
type ListRuleEvaluationsByProfileIdParams ¶
type ListRuleEvaluationsByProfileIdParams struct { ProfileID uuid.UUID `json:"profile_id"` EntityID uuid.NullUUID `json:"entity_id"` RuleTypeName sql.NullString `json:"rule_type_name"` RuleName sql.NullString `json:"rule_name"` }
type ListRuleEvaluationsByProfileIdRow ¶
type ListRuleEvaluationsByProfileIdRow struct { EvalStatus EvalStatusTypes `json:"eval_status"` EvalLastUpdated time.Time `json:"eval_last_updated"` EvalDetails string `json:"eval_details"` RemStatus RemediationStatusTypes `json:"rem_status"` RemDetails string `json:"rem_details"` RemMetadata json.RawMessage `json:"rem_metadata"` RemLastUpdated time.Time `json:"rem_last_updated"` AlertStatus AlertStatusTypes `json:"alert_status"` AlertDetails string `json:"alert_details"` AlertMetadata json.RawMessage `json:"alert_metadata"` AlertLastUpdated time.Time `json:"alert_last_updated"` RuleEvaluationID uuid.UUID `json:"rule_evaluation_id"` EntityType Entities `json:"entity_type"` RuleName string `json:"rule_name"` Provider string `json:"provider"` RuleTypeName string `json:"rule_type_name"` RuleTypeSeverityValue Severity `json:"rule_type_severity_value"` RuleTypeID uuid.UUID `json:"rule_type_id"` RuleTypeGuidance string `json:"rule_type_guidance"` RuleTypeDisplayName string `json:"rule_type_display_name"` EntityID uuid.UUID `json:"entity_id"` ProjectID uuid.UUID `json:"project_id"` RuleTypeReleasePhase ReleaseStatus `json:"rule_type_release_phase"` }
type ListUsersParams ¶
type NullActionType ¶
type NullActionType struct { ActionType ActionType `json:"action_type"` Valid bool `json:"valid"` // Valid is true if ActionType is not NULL }
func ValidateAlertType ¶
func ValidateAlertType(r string) NullActionType
ValidateAlertType validates the alert type, defaulting to "on" if invalid
func ValidateRemediateType ¶
func ValidateRemediateType(r string) NullActionType
ValidateRemediateType validates the remediate type, defaulting to "off" if invalid
func (*NullActionType) Scan ¶
func (ns *NullActionType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullAlertStatusTypes ¶
type NullAlertStatusTypes struct { AlertStatusTypes AlertStatusTypes `json:"alert_status_types"` Valid bool `json:"valid"` // Valid is true if AlertStatusTypes is not NULL }
func (*NullAlertStatusTypes) Scan ¶
func (ns *NullAlertStatusTypes) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullAuthorizationFlow ¶
type NullAuthorizationFlow struct { AuthorizationFlow AuthorizationFlow `json:"authorization_flow"` Valid bool `json:"valid"` // Valid is true if AuthorizationFlow is not NULL }
func (*NullAuthorizationFlow) Scan ¶
func (ns *NullAuthorizationFlow) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullEntities ¶
type NullEntities struct { Entities Entities `json:"entities"` Valid bool `json:"valid"` // Valid is true if Entities is not NULL }
func (*NullEntities) Scan ¶
func (ns *NullEntities) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullEvalStatusTypes ¶
type NullEvalStatusTypes struct { EvalStatusTypes EvalStatusTypes `json:"eval_status_types"` Valid bool `json:"valid"` // Valid is true if EvalStatusTypes is not NULL }
func (*NullEvalStatusTypes) Scan ¶
func (ns *NullEvalStatusTypes) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullProviderClass ¶
type NullProviderClass struct { ProviderClass ProviderClass `json:"provider_class"` Valid bool `json:"valid"` // Valid is true if ProviderClass is not NULL }
func (*NullProviderClass) Scan ¶
func (ns *NullProviderClass) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullProviderType ¶
type NullProviderType struct { ProviderType ProviderType `json:"provider_type"` Valid bool `json:"valid"` // Valid is true if ProviderType is not NULL }
func (*NullProviderType) Scan ¶
func (ns *NullProviderType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullReleaseStatus ¶
type NullReleaseStatus struct { ReleaseStatus ReleaseStatus `json:"release_status"` Valid bool `json:"valid"` // Valid is true if ReleaseStatus is not NULL }
func (*NullReleaseStatus) Scan ¶
func (ns *NullReleaseStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullRemediationStatusTypes ¶
type NullRemediationStatusTypes struct { RemediationStatusTypes RemediationStatusTypes `json:"remediation_status_types"` Valid bool `json:"valid"` // Valid is true if RemediationStatusTypes is not NULL }
func (*NullRemediationStatusTypes) Scan ¶
func (ns *NullRemediationStatusTypes) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullSeverity ¶
type NullSeverity struct { Severity Severity `json:"severity"` Valid bool `json:"valid"` // Valid is true if Severity is not NULL }
func (*NullSeverity) Scan ¶
func (ns *NullSeverity) Scan(value interface{}) error
Scan implements the Scanner interface.
type OrphanProjectParams ¶
type OrphanProjectParams struct { ID uuid.UUID `json:"id"` Metadata json.RawMessage `json:"metadata"` }
type PgTime ¶
PgTime wraps a time.Time
type PgTimeArray ¶
type PgTimeArray []PgTime
PgTimeArray wraps a time.Time slice to be used as a Postgres array type PgTimeArray []time.Time
func (*PgTimeArray) Scan ¶
func (a *PgTimeArray) Scan(src interface{}) error
Scan implements the sql.Scanner interface
type Profile ¶
type Profile struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Provider sql.NullString `json:"provider"` ProjectID uuid.UUID `json:"project_id"` Remediate NullActionType `json:"remediate"` Alert NullActionType `json:"alert"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ProviderID uuid.NullUUID `json:"provider_id"` SubscriptionID uuid.NullUUID `json:"subscription_id"` DisplayName string `json:"display_name"` Labels []string `json:"labels"` }
type ProfileRow ¶
type ProfileRow interface { GetProfile() Profile GetEntityProfile() NullEntities GetSelectors() []ProfileSelector GetContextualRules() pqtype.NullRawMessage }
ProfileRow is an interface row in the profiles table
type ProfileSelector ¶
type ProfileSelector struct { ID uuid.UUID `json:"id"` ProfileID uuid.UUID `json:"profile_id"` Entity NullEntities `json:"entity"` Selector string `json:"selector"` Comment string `json:"comment"` }
func (*ProfileSelector) Scan ¶
func (s *ProfileSelector) Scan(value interface{}) error
Scan implements the sql.Scanner interface for the SelectorInfo struct
type ProfileStatus ¶
type ProfilesWithEntityProfile ¶
type ProfilesWithEntityProfile struct { ID uuid.NullUUID `json:"id"` Entity NullEntities `json:"entity"` ProfileID uuid.NullUUID `json:"profile_id"` ContextualRules pqtype.NullRawMessage `json:"contextual_rules"` CreatedAt sql.NullTime `json:"created_at"` UpdatedAt sql.NullTime `json:"updated_at"` Profid uuid.UUID `json:"profid"` }
type PropertyValueV1 ¶
type PropertyValueV1 struct { ID uuid.UUID `json:"id"` EntityID uuid.UUID `json:"entity_id"` Key string `json:"key"` Value any `json:"value"` UpdatedAt time.Time `json:"updated_at"` }
PropertyValueV1 is a property value for an entity
type PropertyWrapper ¶
PropertyWrapper is a wrapper around a property value that includes a version to serialize as JSON
type Provider ¶
type Provider struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Version string `json:"version"` ProjectID uuid.UUID `json:"project_id"` Implements []ProviderType `json:"implements"` Definition json.RawMessage `json:"definition"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` AuthFlows []AuthorizationFlow `json:"auth_flows"` Class ProviderClass `json:"class"` }
func (*Provider) CanImplement ¶
func (p *Provider) CanImplement(impl ProviderType) bool
CanImplement returns true if the provider implements the given type.
type ProviderAccessToken ¶
type ProviderAccessToken struct { ID int32 `json:"id"` Provider string `json:"provider"` ProjectID uuid.UUID `json:"project_id"` OwnerFilter sql.NullString `json:"owner_filter"` EncryptedToken sql.NullString `json:"encrypted_token"` ExpirationTime time.Time `json:"expiration_time"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` EnrollmentNonce sql.NullString `json:"enrollment_nonce"` EncryptedAccessToken pqtype.NullRawMessage `json:"encrypted_access_token"` }
type ProviderClass ¶
type ProviderClass string
const ( ProviderClassGithub ProviderClass = "github" ProviderClassGithubApp ProviderClass = "github-app" ProviderClassGhcr ProviderClass = "ghcr" ProviderClassDockerhub ProviderClass = "dockerhub" ProviderClassGitlab ProviderClass = "gitlab" )
func (*ProviderClass) Scan ¶
func (e *ProviderClass) Scan(src interface{}) error
type ProviderGithubAppInstallation ¶
type ProviderGithubAppInstallation struct { AppInstallationID int64 `json:"app_installation_id"` ProviderID uuid.NullUUID `json:"provider_id"` OrganizationID int64 `json:"organization_id"` EnrollingUserID sql.NullString `json:"enrolling_user_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` EnrollmentNonce sql.NullString `json:"enrollment_nonce"` ProjectID uuid.NullUUID `json:"project_id"` IsOrg bool `json:"is_org"` }
type ProviderType ¶
type ProviderType string
const ( ProviderTypeGithub ProviderType = "github" ProviderTypeRest ProviderType = "rest" ProviderTypeGit ProviderType = "git" ProviderTypeOci ProviderType = "oci" ProviderTypeRepoLister ProviderType = "repo-lister" ProviderTypeImageLister ProviderType = "image-lister" )
func (*ProviderType) Scan ¶
func (e *ProviderType) Scan(src interface{}) error
type PullRequest ¶
type Querier ¶
type Querier interface { BulkGetProfilesByID(ctx context.Context, profileIds []uuid.UUID) ([]BulkGetProfilesByIDRow, error) CountProfilesByEntityType(ctx context.Context) ([]CountProfilesByEntityTypeRow, error) CountProfilesByName(ctx context.Context, name string) (int64, error) CountProfilesByProjectID(ctx context.Context, projectID uuid.UUID) (int64, error) CountRepositories(ctx context.Context) (int64, error) CountRepositoriesByProjectID(ctx context.Context, projectID uuid.UUID) (int64, error) CountUsers(ctx context.Context) (int64, error) // CreateEntity adds an entry to the entity_instances table so it can be tracked by Minder. CreateEntity(ctx context.Context, arg CreateEntityParams) (EntityInstance, error) // CreateEntityWithID adds an entry to the entities table with a specific ID so it can be tracked by Minder. CreateEntityWithID(ctx context.Context, arg CreateEntityWithIDParams) (EntityInstance, error) // CreateInvitation creates a new invitation. The code is a secret that is sent // to the invitee, and the email is the address to which the invitation will be // sent. The role is the role that the invitee will have when they accept the // invitation. The project is the project to which the invitee will be invited. // The sponsor is the user who is inviting the invitee. CreateInvitation(ctx context.Context, arg CreateInvitationParams) (UserInvite, error) // CreateOrEnsureEntityByID adds an entry to the entity_instances table if it does not exist, or returns the existing entry. CreateOrEnsureEntityByID(ctx context.Context, arg CreateOrEnsureEntityByIDParams) (EntityInstance, error) CreateProfile(ctx context.Context, arg CreateProfileParams) (Profile, error) CreateProfileForEntity(ctx context.Context, arg CreateProfileForEntityParams) (EntityProfile, error) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error) CreateProjectWithID(ctx context.Context, arg CreateProjectWithIDParams) (Project, error) CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error) CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error) CreateRuleType(ctx context.Context, arg CreateRuleTypeParams) (RuleType, error) CreateSelector(ctx context.Context, arg CreateSelectorParams) (ProfileSelector, error) CreateSessionState(ctx context.Context, arg CreateSessionStateParams) (SessionStore, error) // Subscriptions -- CreateSubscription(ctx context.Context, arg CreateSubscriptionParams) (Subscription, error) CreateUser(ctx context.Context, identitySubject string) (User, error) DeleteAllPropertiesForEntity(ctx context.Context, entityID uuid.UUID) error DeleteArtifact(ctx context.Context, id uuid.UUID) error // DeleteEntity removes an entity from the entity_instances table for a project. DeleteEntity(ctx context.Context, arg DeleteEntityParams) error DeleteEvaluationHistoryByIDs(ctx context.Context, evaluationids []uuid.UUID) (int64, error) DeleteExpiredSessionStates(ctx context.Context) (int64, error) DeleteInstallationIDByAppID(ctx context.Context, appInstallationID int64) error // DeleteInvitation deletes an invitation by its code. This is intended to be // called by a user who has issued an invitation and then accepted it, declined // it or the sponsor has decided to revoke it. DeleteInvitation(ctx context.Context, code string) (UserInvite, error) DeleteNonUpdatedRules(ctx context.Context, arg DeleteNonUpdatedRulesParams) error DeleteProfile(ctx context.Context, arg DeleteProfileParams) error DeleteProfileForEntity(ctx context.Context, arg DeleteProfileForEntityParams) error DeleteProject(ctx context.Context, id uuid.UUID) ([]DeleteProjectRow, error) DeleteProperty(ctx context.Context, arg DeletePropertyParams) error DeleteProvider(ctx context.Context, arg DeleteProviderParams) error DeleteRepository(ctx context.Context, id uuid.UUID) error DeleteRuleType(ctx context.Context, id uuid.UUID) error DeleteSelector(ctx context.Context, id uuid.UUID) error DeleteSelectorsByProfileID(ctx context.Context, profileID uuid.UUID) error DeleteSessionStateByProjectID(ctx context.Context, arg DeleteSessionStateByProjectIDParams) error DeleteUser(ctx context.Context, id int32) error EnqueueFlush(ctx context.Context, arg EnqueueFlushParams) (FlushCache, error) // FindProviders allows us to take a trait and filter // providers by it. It also optionally takes a name, in case we want to // filter by name as well. FindProviders(ctx context.Context, arg FindProvidersParams) ([]Provider, error) FlushCache(ctx context.Context, entityInstanceID uuid.UUID) (FlushCache, error) GetAccessTokenByEnrollmentNonce(ctx context.Context, arg GetAccessTokenByEnrollmentNonceParams) (ProviderAccessToken, error) GetAccessTokenByProjectID(ctx context.Context, arg GetAccessTokenByProjectIDParams) (ProviderAccessToken, error) GetAccessTokenByProvider(ctx context.Context, provider string) ([]ProviderAccessToken, error) GetAccessTokenSinceDate(ctx context.Context, arg GetAccessTokenSinceDateParams) (ProviderAccessToken, error) GetAllPropertiesForEntity(ctx context.Context, entityID uuid.UUID) ([]Property, error) GetArtifactByID(ctx context.Context, arg GetArtifactByIDParams) (Artifact, error) GetArtifactByName(ctx context.Context, arg GetArtifactByNameParams) (Artifact, error) GetBundle(ctx context.Context, arg GetBundleParams) (Bundle, error) GetChildrenProjects(ctx context.Context, id uuid.UUID) ([]GetChildrenProjectsRow, error) // GetEntitiesByProjectHierarchy retrieves all entities for a project or hierarchy of projects. GetEntitiesByProjectHierarchy(ctx context.Context, projects []uuid.UUID) ([]EntityInstance, error) // GetEntitiesByProvider retrieves all entities of a given provider. // this is how one would get all repositories, artifacts, etc. for a given provider. GetEntitiesByProvider(ctx context.Context, providerID uuid.UUID) ([]EntityInstance, error) // GetEntitiesByType retrieves all entities of a given type for a project or hierarchy of projects. // this is how one would get all repositories, artifacts, etc. GetEntitiesByType(ctx context.Context, arg GetEntitiesByTypeParams) ([]EntityInstance, error) GetEntitlementFeaturesByProjectID(ctx context.Context, projectID uuid.UUID) ([]string, error) // GetEntityByID retrieves an entity by its ID for a project or hierarchy of projects. GetEntityByID(ctx context.Context, id uuid.UUID) (EntityInstance, error) // GetEntityByName retrieves an entity by its name for a project or hierarchy of projects. GetEntityByName(ctx context.Context, arg GetEntityByNameParams) (EntityInstance, error) GetEvaluationHistory(ctx context.Context, arg GetEvaluationHistoryParams) (GetEvaluationHistoryRow, error) // GetFeatureInProject verifies if a feature is available for a specific project. // It returns the settings for the feature if it is available. GetFeatureInProject(ctx context.Context, arg GetFeatureInProjectParams) (json.RawMessage, error) // GetImmediateChildrenProjects is a query that returns all the immediate children of a project. GetImmediateChildrenProjects(ctx context.Context, parentID uuid.UUID) ([]Project, error) GetInstallationIDByAppID(ctx context.Context, appInstallationID int64) (ProviderGithubAppInstallation, error) GetInstallationIDByEnrollmentNonce(ctx context.Context, arg GetInstallationIDByEnrollmentNonceParams) (ProviderGithubAppInstallation, error) GetInstallationIDByProviderID(ctx context.Context, providerID uuid.NullUUID) (ProviderGithubAppInstallation, error) // GetInvitationByCode retrieves an invitation by its code. This is intended to // be called by a user who has received an invitation email and is following the // link to accept the invitation or when querying for additional info about the // invitation. GetInvitationByCode(ctx context.Context, code string) (GetInvitationByCodeRow, error) // GetInvitationsByEmail retrieves all invitations for a given email address. // This is intended to be called by a logged in user with their own email address, // to allow them to accept invitations even if email delivery was not working. // Note that this requires that the destination email address matches the email // address of the logged in user in the external identity service / auth token. // This clarification is related solely for user's ListInvitations calls and does // not affect to resolving invitations intended for other mail addresses. GetInvitationsByEmail(ctx context.Context, email string) ([]GetInvitationsByEmailRow, error) // GetInvitationsByEmailAndProject retrieves all invitations by email and project. GetInvitationsByEmailAndProject(ctx context.Context, arg GetInvitationsByEmailAndProjectParams) ([]GetInvitationsByEmailAndProjectRow, error) // Copyright 2024 Stacklok, Inc // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. GetLatestEvalStateForRuleEntity(ctx context.Context, arg GetLatestEvalStateForRuleEntityParams) (EvaluationStatus, error) GetParentProjects(ctx context.Context, id uuid.UUID) ([]uuid.UUID, error) GetParentProjectsUntil(ctx context.Context, arg GetParentProjectsUntilParams) ([]uuid.UUID, error) GetProfileByID(ctx context.Context, arg GetProfileByIDParams) (Profile, error) GetProfileByIDAndLock(ctx context.Context, arg GetProfileByIDAndLockParams) (Profile, error) GetProfileByNameAndLock(ctx context.Context, arg GetProfileByNameAndLockParams) (Profile, error) GetProfileByProjectAndID(ctx context.Context, arg GetProfileByProjectAndIDParams) ([]GetProfileByProjectAndIDRow, error) GetProfileByProjectAndName(ctx context.Context, arg GetProfileByProjectAndNameParams) ([]GetProfileByProjectAndNameRow, error) GetProfileStatusByIdAndProject(ctx context.Context, arg GetProfileStatusByIdAndProjectParams) (GetProfileStatusByIdAndProjectRow, error) GetProfileStatusByNameAndProject(ctx context.Context, arg GetProfileStatusByNameAndProjectParams) (GetProfileStatusByNameAndProjectRow, error) GetProfileStatusByProject(ctx context.Context, projectID uuid.UUID) ([]GetProfileStatusByProjectRow, error) GetProjectByID(ctx context.Context, id uuid.UUID) (Project, error) GetProjectByName(ctx context.Context, name string) (Project, error) GetProjectIDBySessionState(ctx context.Context, sessionState string) (GetProjectIDBySessionStateRow, error) GetProperty(ctx context.Context, arg GetPropertyParams) (Property, error) GetProviderByID(ctx context.Context, id uuid.UUID) (Provider, error) GetProviderByIDAndProject(ctx context.Context, arg GetProviderByIDAndProjectParams) (Provider, error) // GetProviderByName allows us to get a provider by its name. This takes // into account the project hierarchy, so it will only return the provider // if it exists in the project or any of its ancestors. It'll return the first // provider that matches the name. GetProviderByName(ctx context.Context, arg GetProviderByNameParams) (Provider, error) // avoid using this, where possible use GetRepositoryByIDAndProject instead GetRepositoryByID(ctx context.Context, id uuid.UUID) (Repository, error) GetRepositoryByIDAndProject(ctx context.Context, arg GetRepositoryByIDAndProjectParams) (Repository, error) GetRepositoryByRepoID(ctx context.Context, repoID int64) (Repository, error) GetRepositoryByRepoName(ctx context.Context, arg GetRepositoryByRepoNameParams) (Repository, error) GetRuleInstancesEntityInProjects(ctx context.Context, arg GetRuleInstancesEntityInProjectsParams) ([]RuleInstance, error) GetRuleInstancesForProfile(ctx context.Context, profileID uuid.UUID) ([]RuleInstance, error) GetRuleTypeByID(ctx context.Context, id uuid.UUID) (RuleType, error) GetRuleTypeByName(ctx context.Context, arg GetRuleTypeByNameParams) (RuleType, error) // intended as a temporary transition query // this will be removed once rule_instances is used consistently in the engine GetRuleTypeIDByRuleNameEntityProfile(ctx context.Context, arg GetRuleTypeIDByRuleNameEntityProfileParams) (uuid.UUID, error) // intended as a temporary transition query // this will be removed once the evaluation history tables replace the old state tables GetRuleTypeNameByID(ctx context.Context, id uuid.UUID) (string, error) GetRuleTypesByEntityInHierarchy(ctx context.Context, arg GetRuleTypesByEntityInHierarchyParams) ([]RuleType, error) GetSelectorByID(ctx context.Context, id uuid.UUID) (ProfileSelector, error) GetSelectorsByProfileID(ctx context.Context, profileID uuid.UUID) ([]ProfileSelector, error) GetSubscriptionByProjectBundle(ctx context.Context, arg GetSubscriptionByProjectBundleParams) (Subscription, error) GetTypedEntitiesByProperty(ctx context.Context, arg GetTypedEntitiesByPropertyParams) ([]EntityInstance, error) GetUnclaimedInstallationsByUser(ctx context.Context, ghID sql.NullString) ([]ProviderGithubAppInstallation, error) GetUserByID(ctx context.Context, id int32) (User, error) GetUserBySubject(ctx context.Context, identitySubject string) (User, error) GlobalListProviders(ctx context.Context) ([]Provider, error) GlobalListProvidersByClass(ctx context.Context, class ProviderClass) ([]Provider, error) InsertAlertEvent(ctx context.Context, arg InsertAlertEventParams) error InsertEvaluationRuleEntity(ctx context.Context, arg InsertEvaluationRuleEntityParams) (uuid.UUID, error) InsertEvaluationStatus(ctx context.Context, arg InsertEvaluationStatusParams) (uuid.UUID, error) InsertRemediationEvent(ctx context.Context, arg InsertRemediationEventParams) error ListArtifactsByRepoID(ctx context.Context, repositoryID uuid.NullUUID) ([]Artifact, error) ListEvaluationHistory(ctx context.Context, arg ListEvaluationHistoryParams) ([]ListEvaluationHistoryRow, error) ListEvaluationHistoryStaleRecords(ctx context.Context, arg ListEvaluationHistoryStaleRecordsParams) ([]ListEvaluationHistoryStaleRecordsRow, error) ListFlushCache(ctx context.Context) ([]FlushCache, error) // ListInvitationsForProject collects the information visible to project // administrators after an invitation has been issued. In particular, it // *does not* report the invitation code, which is a secret intended for // the invitee. ListInvitationsForProject(ctx context.Context, project uuid.UUID) ([]ListInvitationsForProjectRow, error) // ListOldestRuleEvaluationsByRepositoryId has casts in select statement as sqlc generates incorrect types. // cast after MIN is required due to a known bug in sqlc: https://github.com/sqlc-dev/sqlc/issues/1965 ListOldestRuleEvaluationsByRepositoryId(ctx context.Context, repositoryIds []uuid.UUID) ([]ListOldestRuleEvaluationsByRepositoryIdRow, error) ListProfilesByProjectIDAndLabel(ctx context.Context, arg ListProfilesByProjectIDAndLabelParams) ([]ListProfilesByProjectIDAndLabelRow, error) ListProfilesInstantiatingRuleType(ctx context.Context, ruleTypeID uuid.UUID) ([]string, error) // ListProvidersByProjectID allows us to list all providers // for a given array of projects. ListProvidersByProjectID(ctx context.Context, projects []uuid.UUID) ([]Provider, error) // ListProvidersByProjectIDPaginated allows us to lits all providers for a given project // with pagination taken into account. In this case, the cursor is the creation date. ListProvidersByProjectIDPaginated(ctx context.Context, arg ListProvidersByProjectIDPaginatedParams) ([]Provider, error) ListRegisteredRepositoriesByProjectIDAndProvider(ctx context.Context, arg ListRegisteredRepositoriesByProjectIDAndProviderParams) ([]Repository, error) ListRepositoriesAfterID(ctx context.Context, arg ListRepositoriesAfterIDParams) ([]Repository, error) ListRepositoriesByProjectID(ctx context.Context, arg ListRepositoriesByProjectIDParams) ([]Repository, error) ListRuleEvaluationsByProfileId(ctx context.Context, arg ListRuleEvaluationsByProfileIdParams) ([]ListRuleEvaluationsByProfileIdRow, error) ListRuleTypesByProject(ctx context.Context, projectID uuid.UUID) ([]RuleType, error) // When doing a key/algorithm rotation, identify the secrets which need to be // rotated. The criteria for rotation are: // 1) The encrypted_access_token is NULL (this should be removed when we make // this column non-nullable). // 2) The access token does not use the configured default algorithm. // 3) The access token does not use the default key version. // This query accepts the default key version/algorithm as arguments since // that information is not known to the database. ListTokensToMigrate(ctx context.Context, arg ListTokensToMigrateParams) ([]ProviderAccessToken, error) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error) // LockIfThresholdNotExceeded is used to lock an entity for execution. It will // attempt to insert or update the entity_execution_lock table only if the // last_lock_time is older than the threshold. If the lock is successful, it // will return the lock record. If the lock is unsuccessful, it will return // NULL. LockIfThresholdNotExceeded(ctx context.Context, arg LockIfThresholdNotExceededParams) (EntityExecutionLock, error) // OrphanProject is a query that sets the parent_id of a project to NULL. OrphanProject(ctx context.Context, arg OrphanProjectParams) (Project, error) // ReleaseLock is used to release a lock on an entity. It will delete the // entity_execution_lock record if the lock is held by the given locked_by // value. ReleaseLock(ctx context.Context, arg ReleaseLockParams) error RepositoryExistsAfterID(ctx context.Context, id uuid.UUID) (bool, error) SetCurrentVersion(ctx context.Context, arg SetCurrentVersionParams) error UpdateEncryptedSecret(ctx context.Context, arg UpdateEncryptedSecretParams) error // UpdateInvitationRole updates an invitation by its code. This is intended to be // called by a user who has issued an invitation and then decided to change the // role of the invitee. UpdateInvitationRole(ctx context.Context, arg UpdateInvitationRoleParams) (UserInvite, error) UpdateLease(ctx context.Context, arg UpdateLeaseParams) error UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error) UpdateProjectMeta(ctx context.Context, arg UpdateProjectMetaParams) (Project, error) UpdateProvider(ctx context.Context, arg UpdateProviderParams) error UpdateReminderLastSentForRepositories(ctx context.Context, repositoryIds []uuid.UUID) error UpdateRuleType(ctx context.Context, arg UpdateRuleTypeParams) (RuleType, error) UpdateSelector(ctx context.Context, arg UpdateSelectorParams) (ProfileSelector, error) UpsertAccessToken(ctx context.Context, arg UpsertAccessTokenParams) (ProviderAccessToken, error) UpsertArtifact(ctx context.Context, arg UpsertArtifactParams) (Artifact, error) // Copyright 2024 Stacklok, Inc // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Bundles -- UpsertBundle(ctx context.Context, arg UpsertBundleParams) error UpsertInstallationID(ctx context.Context, arg UpsertInstallationIDParams) (ProviderGithubAppInstallation, error) UpsertLatestEvaluationStatus(ctx context.Context, arg UpsertLatestEvaluationStatusParams) error UpsertProfileForEntity(ctx context.Context, arg UpsertProfileForEntityParams) (EntityProfile, error) UpsertProperty(ctx context.Context, arg UpsertPropertyParams) (Property, error) // Copyright 2024 Stacklok, Inc // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. UpsertRuleInstance(ctx context.Context, arg UpsertRuleInstanceParams) (uuid.UUID, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) BulkGetProfilesByID ¶
func (*Queries) CountProfilesByEntityType ¶
func (q *Queries) CountProfilesByEntityType(ctx context.Context) ([]CountProfilesByEntityTypeRow, error)
func (*Queries) CountProfilesByName ¶
func (*Queries) CountProfilesByProjectID ¶
func (*Queries) CountRepositories ¶
func (*Queries) CountRepositoriesByProjectID ¶
func (*Queries) CreateEntity ¶
func (q *Queries) CreateEntity(ctx context.Context, arg CreateEntityParams) (EntityInstance, error)
CreateEntity adds an entry to the entity_instances table so it can be tracked by Minder.
func (*Queries) CreateEntityWithID ¶
func (q *Queries) CreateEntityWithID(ctx context.Context, arg CreateEntityWithIDParams) (EntityInstance, error)
CreateEntityWithID adds an entry to the entities table with a specific ID so it can be tracked by Minder.
func (*Queries) CreateInvitation ¶
func (q *Queries) CreateInvitation(ctx context.Context, arg CreateInvitationParams) (UserInvite, error)
CreateInvitation creates a new invitation. The code is a secret that is sent to the invitee, and the email is the address to which the invitation will be sent. The role is the role that the invitee will have when they accept the invitation. The project is the project to which the invitee will be invited. The sponsor is the user who is inviting the invitee.
func (*Queries) CreateOrEnsureEntityByID ¶
func (q *Queries) CreateOrEnsureEntityByID(ctx context.Context, arg CreateOrEnsureEntityByIDParams) (EntityInstance, error)
CreateOrEnsureEntityByID adds an entry to the entity_instances table if it does not exist, or returns the existing entry.
func (*Queries) CreateOrganization ¶
func (*Queries) CreateProfile ¶
func (*Queries) CreateProfileForEntity ¶
func (q *Queries) CreateProfileForEntity(ctx context.Context, arg CreateProfileForEntityParams) (EntityProfile, error)
func (*Queries) CreateProject ¶
func (*Queries) CreateProjectWithID ¶
func (*Queries) CreateProvider ¶
func (*Queries) CreateRepository ¶
func (q *Queries) CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error)
func (*Queries) CreateRuleType ¶
func (*Queries) CreateSelector ¶
func (q *Queries) CreateSelector(ctx context.Context, arg CreateSelectorParams) (ProfileSelector, error)
func (*Queries) CreateSessionState ¶
func (q *Queries) CreateSessionState(ctx context.Context, arg CreateSessionStateParams) (SessionStore, error)
func (*Queries) CreateSubscription ¶
func (q *Queries) CreateSubscription(ctx context.Context, arg CreateSubscriptionParams) (Subscription, error)
Subscriptions --
func (*Queries) CreateUser ¶
func (*Queries) DeleteAllPropertiesForEntity ¶
func (*Queries) DeleteArtifact ¶
func (*Queries) DeleteEntity ¶
func (q *Queries) DeleteEntity(ctx context.Context, arg DeleteEntityParams) error
DeleteEntity removes an entity from the entity_instances table for a project.
func (*Queries) DeleteEvaluationHistoryByIDs ¶
func (*Queries) DeleteExpiredSessionStates ¶
func (*Queries) DeleteInstallationIDByAppID ¶
func (*Queries) DeleteInvitation ¶
DeleteInvitation deletes an invitation by its code. This is intended to be called by a user who has issued an invitation and then accepted it, declined it or the sponsor has decided to revoke it.
func (*Queries) DeleteNonUpdatedRules ¶
func (q *Queries) DeleteNonUpdatedRules(ctx context.Context, arg DeleteNonUpdatedRulesParams) error
func (*Queries) DeleteOrganization ¶
func (*Queries) DeleteProfile ¶
func (q *Queries) DeleteProfile(ctx context.Context, arg DeleteProfileParams) error
func (*Queries) DeleteProfileForEntity ¶
func (q *Queries) DeleteProfileForEntity(ctx context.Context, arg DeleteProfileForEntityParams) error
func (*Queries) DeleteProject ¶
func (*Queries) DeleteProperty ¶
func (q *Queries) DeleteProperty(ctx context.Context, arg DeletePropertyParams) error
func (*Queries) DeleteProvider ¶
func (q *Queries) DeleteProvider(ctx context.Context, arg DeleteProviderParams) error
func (*Queries) DeleteRepository ¶
func (*Queries) DeleteRuleType ¶
func (*Queries) DeleteSelector ¶
func (*Queries) DeleteSelectorsByProfileID ¶
func (*Queries) DeleteSessionStateByProjectID ¶
func (q *Queries) DeleteSessionStateByProjectID(ctx context.Context, arg DeleteSessionStateByProjectIDParams) error
func (*Queries) EnqueueFlush ¶
func (q *Queries) EnqueueFlush(ctx context.Context, arg EnqueueFlushParams) (FlushCache, error)
func (*Queries) FindProviders ¶
FindProviders allows us to take a trait and filter providers by it. It also optionally takes a name, in case we want to filter by name as well.
func (*Queries) FlushCache ¶
func (*Queries) GetAccessTokenByEnrollmentNonce ¶
func (q *Queries) GetAccessTokenByEnrollmentNonce(ctx context.Context, arg GetAccessTokenByEnrollmentNonceParams) (ProviderAccessToken, error)
func (*Queries) GetAccessTokenByProjectID ¶
func (q *Queries) GetAccessTokenByProjectID(ctx context.Context, arg GetAccessTokenByProjectIDParams) (ProviderAccessToken, error)
func (*Queries) GetAccessTokenByProvider ¶
func (*Queries) GetAccessTokenSinceDate ¶
func (q *Queries) GetAccessTokenSinceDate(ctx context.Context, arg GetAccessTokenSinceDateParams) (ProviderAccessToken, error)
func (*Queries) GetAllPropertiesForEntity ¶
func (*Queries) GetAllPropertyValuesV1 ¶
func (q *Queries) GetAllPropertyValuesV1(ctx context.Context, entityID uuid.UUID) ([]PropertyValueV1, error)
GetAllPropertyValuesV1 retrieves all property values for an entity
func (*Queries) GetArtifactByID ¶
func (*Queries) GetArtifactByName ¶
func (*Queries) GetChildrenProjects ¶
func (*Queries) GetEntitiesByProjectHierarchy ¶
func (q *Queries) GetEntitiesByProjectHierarchy(ctx context.Context, projects []uuid.UUID) ([]EntityInstance, error)
GetEntitiesByProjectHierarchy retrieves all entities for a project or hierarchy of projects.
func (*Queries) GetEntitiesByProvider ¶
func (q *Queries) GetEntitiesByProvider(ctx context.Context, providerID uuid.UUID) ([]EntityInstance, error)
GetEntitiesByProvider retrieves all entities of a given provider. this is how one would get all repositories, artifacts, etc. for a given provider.
func (*Queries) GetEntitiesByType ¶
func (q *Queries) GetEntitiesByType(ctx context.Context, arg GetEntitiesByTypeParams) ([]EntityInstance, error)
GetEntitiesByType retrieves all entities of a given type for a project or hierarchy of projects. this is how one would get all repositories, artifacts, etc.
func (*Queries) GetEntitlementFeaturesByProjectID ¶
func (*Queries) GetEntityByID ¶
GetEntityByID retrieves an entity by its ID for a project or hierarchy of projects.
func (*Queries) GetEntityByName ¶
func (q *Queries) GetEntityByName(ctx context.Context, arg GetEntityByNameParams) (EntityInstance, error)
GetEntityByName retrieves an entity by its name for a project or hierarchy of projects.
func (*Queries) GetEvaluationHistory ¶
func (q *Queries) GetEvaluationHistory(ctx context.Context, arg GetEvaluationHistoryParams) (GetEvaluationHistoryRow, error)
func (*Queries) GetFeatureInProject ¶
func (q *Queries) GetFeatureInProject(ctx context.Context, arg GetFeatureInProjectParams) (json.RawMessage, error)
GetFeatureInProject verifies if a feature is available for a specific project. It returns the settings for the feature if it is available.
func (*Queries) GetImmediateChildrenProjects ¶
func (q *Queries) GetImmediateChildrenProjects(ctx context.Context, parentID uuid.UUID) ([]Project, error)
GetImmediateChildrenProjects is a query that returns all the immediate children of a project.
func (*Queries) GetInstallationIDByAppID ¶
func (*Queries) GetInstallationIDByEnrollmentNonce ¶
func (q *Queries) GetInstallationIDByEnrollmentNonce(ctx context.Context, arg GetInstallationIDByEnrollmentNonceParams) (ProviderGithubAppInstallation, error)
func (*Queries) GetInstallationIDByProviderID ¶
func (*Queries) GetInvitationByCode ¶
func (q *Queries) GetInvitationByCode(ctx context.Context, code string) (GetInvitationByCodeRow, error)
GetInvitationByCode retrieves an invitation by its code. This is intended to be called by a user who has received an invitation email and is following the link to accept the invitation or when querying for additional info about the invitation.
func (*Queries) GetInvitationsByEmail ¶
func (q *Queries) GetInvitationsByEmail(ctx context.Context, email string) ([]GetInvitationsByEmailRow, error)
GetInvitationsByEmail retrieves all invitations for a given email address. This is intended to be called by a logged in user with their own email address, to allow them to accept invitations even if email delivery was not working. Note that this requires that the destination email address matches the email address of the logged in user in the external identity service / auth token. This clarification is related solely for user's ListInvitations calls and does not affect to resolving invitations intended for other mail addresses.
func (*Queries) GetInvitationsByEmailAndProject ¶
func (q *Queries) GetInvitationsByEmailAndProject(ctx context.Context, arg GetInvitationsByEmailAndProjectParams) ([]GetInvitationsByEmailAndProjectRow, error)
GetInvitationsByEmailAndProject retrieves all invitations by email and project.
func (*Queries) GetLatestEvalStateForRuleEntity ¶
func (q *Queries) GetLatestEvalStateForRuleEntity(ctx context.Context, arg GetLatestEvalStateForRuleEntityParams) (EvaluationStatus, error)
Copyright 2024 Stacklok, Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
func (*Queries) GetOrganization ¶
func (*Queries) GetOrganizationByName ¶
func (*Queries) GetOrganizationForUpdate ¶
func (*Queries) GetParentProjects ¶
func (*Queries) GetParentProjectsUntil ¶
func (*Queries) GetProfileByID ¶
func (*Queries) GetProfileByIDAndLock ¶
func (*Queries) GetProfileByNameAndLock ¶
func (*Queries) GetProfileByProjectAndID ¶
func (q *Queries) GetProfileByProjectAndID(ctx context.Context, arg GetProfileByProjectAndIDParams) ([]GetProfileByProjectAndIDRow, error)
func (*Queries) GetProfileByProjectAndName ¶
func (q *Queries) GetProfileByProjectAndName(ctx context.Context, arg GetProfileByProjectAndNameParams) ([]GetProfileByProjectAndNameRow, error)
func (*Queries) GetProfileStatusByIdAndProject ¶
func (q *Queries) GetProfileStatusByIdAndProject(ctx context.Context, arg GetProfileStatusByIdAndProjectParams) (GetProfileStatusByIdAndProjectRow, error)
func (*Queries) GetProfileStatusByNameAndProject ¶
func (q *Queries) GetProfileStatusByNameAndProject(ctx context.Context, arg GetProfileStatusByNameAndProjectParams) (GetProfileStatusByNameAndProjectRow, error)
func (*Queries) GetProfileStatusByProject ¶
func (*Queries) GetProjectByID ¶
func (*Queries) GetProjectByName ¶
func (*Queries) GetProjectIDBySessionState ¶
func (*Queries) GetProperty ¶
func (*Queries) GetPropertyValueV1 ¶
func (q *Queries) GetPropertyValueV1(ctx context.Context, entityID uuid.UUID, key string) (PropertyValueV1, error)
GetPropertyValueV1 retrieves a property value for an entity
func (*Queries) GetProviderByID ¶
func (*Queries) GetProviderByIDAndProject ¶
func (*Queries) GetProviderByName ¶
func (q *Queries) GetProviderByName(ctx context.Context, arg GetProviderByNameParams) (Provider, error)
GetProviderByName allows us to get a provider by its name. This takes into account the project hierarchy, so it will only return the provider if it exists in the project or any of its ancestors. It'll return the first provider that matches the name.
func (*Queries) GetRepositoryByID ¶
avoid using this, where possible use GetRepositoryByIDAndProject instead
func (*Queries) GetRepositoryByIDAndProject ¶
func (q *Queries) GetRepositoryByIDAndProject(ctx context.Context, arg GetRepositoryByIDAndProjectParams) (Repository, error)
func (*Queries) GetRepositoryByRepoID ¶
func (*Queries) GetRepositoryByRepoName ¶
func (q *Queries) GetRepositoryByRepoName(ctx context.Context, arg GetRepositoryByRepoNameParams) (Repository, error)
func (*Queries) GetRuleEvaluationByProfileIdAndRuleType ¶
func (q *Queries) GetRuleEvaluationByProfileIdAndRuleType( ctx context.Context, profileID uuid.UUID, ruleName sql.NullString, entityID uuid.UUID, ruleTypeName sql.NullString, ) (*ListRuleEvaluationsByProfileIdRow, error)
GetRuleEvaluationByProfileIdAndRuleType returns the rule evaluation for a given profile and its rule name
func (*Queries) GetRuleInstancesEntityInProjects ¶
func (q *Queries) GetRuleInstancesEntityInProjects(ctx context.Context, arg GetRuleInstancesEntityInProjectsParams) ([]RuleInstance, error)
func (*Queries) GetRuleInstancesForProfile ¶
func (*Queries) GetRuleTypeByID ¶
func (*Queries) GetRuleTypeByName ¶
func (*Queries) GetRuleTypeIDByRuleNameEntityProfile ¶
func (q *Queries) GetRuleTypeIDByRuleNameEntityProfile(ctx context.Context, arg GetRuleTypeIDByRuleNameEntityProfileParams) (uuid.UUID, error)
intended as a temporary transition query this will be removed once rule_instances is used consistently in the engine
func (*Queries) GetRuleTypeNameByID ¶
intended as a temporary transition query this will be removed once the evaluation history tables replace the old state tables
func (*Queries) GetRuleTypesByEntityInHierarchy ¶
func (*Queries) GetSelectorByID ¶
func (*Queries) GetSelectorsByProfileID ¶
func (*Queries) GetSubscriptionByProjectBundle ¶
func (q *Queries) GetSubscriptionByProjectBundle(ctx context.Context, arg GetSubscriptionByProjectBundleParams) (Subscription, error)
func (*Queries) GetTypedEntitiesByProperty ¶
func (q *Queries) GetTypedEntitiesByProperty(ctx context.Context, arg GetTypedEntitiesByPropertyParams) ([]EntityInstance, error)
func (*Queries) GetTypedEntitiesByPropertyV1 ¶
func (q *Queries) GetTypedEntitiesByPropertyV1( ctx context.Context, entType Entities, key string, value any, opts GetTypedEntitiesOptions, ) ([]EntityInstance, error)
GetTypedEntitiesByPropertyV1 retrieves all entities with a property value
func (*Queries) GetUnclaimedInstallationsByUser ¶
func (q *Queries) GetUnclaimedInstallationsByUser(ctx context.Context, ghID sql.NullString) ([]ProviderGithubAppInstallation, error)
func (*Queries) GetUserByID ¶
func (*Queries) GetUserBySubject ¶
func (*Queries) GlobalListProviders ¶
func (*Queries) GlobalListProvidersByClass ¶
func (*Queries) InsertAlertEvent ¶
func (q *Queries) InsertAlertEvent(ctx context.Context, arg InsertAlertEventParams) error
func (*Queries) InsertEvaluationRuleEntity ¶
func (*Queries) InsertEvaluationStatus ¶
func (*Queries) InsertRemediationEvent ¶
func (q *Queries) InsertRemediationEvent(ctx context.Context, arg InsertRemediationEventParams) error
func (*Queries) ListArtifactsByRepoID ¶
func (*Queries) ListEvaluationHistory ¶
func (q *Queries) ListEvaluationHistory(ctx context.Context, arg ListEvaluationHistoryParams) ([]ListEvaluationHistoryRow, error)
func (*Queries) ListEvaluationHistoryStaleRecords ¶
func (q *Queries) ListEvaluationHistoryStaleRecords(ctx context.Context, arg ListEvaluationHistoryStaleRecordsParams) ([]ListEvaluationHistoryStaleRecordsRow, error)
func (*Queries) ListFlushCache ¶
func (q *Queries) ListFlushCache(ctx context.Context) ([]FlushCache, error)
func (*Queries) ListInvitationsForProject ¶
func (q *Queries) ListInvitationsForProject(ctx context.Context, project uuid.UUID) ([]ListInvitationsForProjectRow, error)
ListInvitationsForProject collects the information visible to project administrators after an invitation has been issued. In particular, it *does not* report the invitation code, which is a secret intended for the invitee.
func (*Queries) ListOldestRuleEvaluationsByRepositoryId ¶
func (q *Queries) ListOldestRuleEvaluationsByRepositoryId(ctx context.Context, repositoryIds []uuid.UUID) ([]ListOldestRuleEvaluationsByRepositoryIdRow, error)
ListOldestRuleEvaluationsByRepositoryId has casts in select statement as sqlc generates incorrect types. cast after MIN is required due to a known bug in sqlc: https://github.com/sqlc-dev/sqlc/issues/1965
func (*Queries) ListOrganizations ¶
func (*Queries) ListProfilesByProjectIDAndLabel ¶
func (q *Queries) ListProfilesByProjectIDAndLabel(ctx context.Context, arg ListProfilesByProjectIDAndLabelParams) ([]ListProfilesByProjectIDAndLabelRow, error)
func (*Queries) ListProfilesInstantiatingRuleType ¶
func (*Queries) ListProvidersByProjectID ¶
func (q *Queries) ListProvidersByProjectID(ctx context.Context, projects []uuid.UUID) ([]Provider, error)
ListProvidersByProjectID allows us to list all providers for a given array of projects.
func (*Queries) ListProvidersByProjectIDPaginated ¶
func (q *Queries) ListProvidersByProjectIDPaginated(ctx context.Context, arg ListProvidersByProjectIDPaginatedParams) ([]Provider, error)
ListProvidersByProjectIDPaginated allows us to lits all providers for a given project with pagination taken into account. In this case, the cursor is the creation date.
func (*Queries) ListRegisteredRepositoriesByProjectIDAndProvider ¶
func (q *Queries) ListRegisteredRepositoriesByProjectIDAndProvider(ctx context.Context, arg ListRegisteredRepositoriesByProjectIDAndProviderParams) ([]Repository, error)
func (*Queries) ListRepositoriesAfterID ¶
func (q *Queries) ListRepositoriesAfterID(ctx context.Context, arg ListRepositoriesAfterIDParams) ([]Repository, error)
func (*Queries) ListRepositoriesByProjectID ¶
func (q *Queries) ListRepositoriesByProjectID(ctx context.Context, arg ListRepositoriesByProjectIDParams) ([]Repository, error)
func (*Queries) ListRuleEvaluationsByProfileId ¶
func (q *Queries) ListRuleEvaluationsByProfileId(ctx context.Context, arg ListRuleEvaluationsByProfileIdParams) ([]ListRuleEvaluationsByProfileIdRow, error)
func (*Queries) ListRuleTypesByProject ¶
func (*Queries) ListTokensToMigrate ¶
func (q *Queries) ListTokensToMigrate(ctx context.Context, arg ListTokensToMigrateParams) ([]ProviderAccessToken, error)
When doing a key/algorithm rotation, identify the secrets which need to be rotated. The criteria for rotation are:
- The encrypted_access_token is NULL (this should be removed when we make this column non-nullable).
- The access token does not use the configured default algorithm.
- The access token does not use the default key version.
This query accepts the default key version/algorithm as arguments since that information is not known to the database.
func (*Queries) LockIfThresholdNotExceeded ¶
func (q *Queries) LockIfThresholdNotExceeded(ctx context.Context, arg LockIfThresholdNotExceededParams) (EntityExecutionLock, error)
LockIfThresholdNotExceeded is used to lock an entity for execution. It will attempt to insert or update the entity_execution_lock table only if the last_lock_time is older than the threshold. If the lock is successful, it will return the lock record. If the lock is unsuccessful, it will return NULL.
func (*Queries) OrphanProject ¶
OrphanProject is a query that sets the parent_id of a project to NULL.
func (*Queries) ReleaseLock ¶
func (q *Queries) ReleaseLock(ctx context.Context, arg ReleaseLockParams) error
ReleaseLock is used to release a lock on an entity. It will delete the entity_execution_lock record if the lock is held by the given locked_by value.
func (*Queries) RepositoryExistsAfterID ¶
func (*Queries) SetCurrentVersion ¶
func (q *Queries) SetCurrentVersion(ctx context.Context, arg SetCurrentVersionParams) error
func (*Queries) UpdateEncryptedSecret ¶
func (q *Queries) UpdateEncryptedSecret(ctx context.Context, arg UpdateEncryptedSecretParams) error
func (*Queries) UpdateInvitationRole ¶
func (q *Queries) UpdateInvitationRole(ctx context.Context, arg UpdateInvitationRoleParams) (UserInvite, error)
UpdateInvitationRole updates an invitation by its code. This is intended to be called by a user who has issued an invitation and then decided to change the role of the invitee.
func (*Queries) UpdateLease ¶
func (q *Queries) UpdateLease(ctx context.Context, arg UpdateLeaseParams) error
func (*Queries) UpdateOrganization ¶
func (*Queries) UpdateProfile ¶
func (*Queries) UpdateProjectMeta ¶
func (*Queries) UpdateProvider ¶
func (q *Queries) UpdateProvider(ctx context.Context, arg UpdateProviderParams) error
func (*Queries) UpdateReminderLastSentForRepositories ¶
func (*Queries) UpdateRuleType ¶
func (*Queries) UpdateSelector ¶
func (q *Queries) UpdateSelector(ctx context.Context, arg UpdateSelectorParams) (ProfileSelector, error)
func (*Queries) UpsertAccessToken ¶
func (q *Queries) UpsertAccessToken(ctx context.Context, arg UpsertAccessTokenParams) (ProviderAccessToken, error)
func (*Queries) UpsertArtifact ¶
func (*Queries) UpsertBundle ¶
func (q *Queries) UpsertBundle(ctx context.Context, arg UpsertBundleParams) error
Copyright 2024 Stacklok, Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Bundles --
func (*Queries) UpsertInstallationID ¶
func (q *Queries) UpsertInstallationID(ctx context.Context, arg UpsertInstallationIDParams) (ProviderGithubAppInstallation, error)
func (*Queries) UpsertLatestEvaluationStatus ¶
func (q *Queries) UpsertLatestEvaluationStatus(ctx context.Context, arg UpsertLatestEvaluationStatusParams) error
func (*Queries) UpsertProfileForEntity ¶
func (q *Queries) UpsertProfileForEntity(ctx context.Context, arg UpsertProfileForEntityParams) (EntityProfile, error)
func (*Queries) UpsertProperty ¶
func (*Queries) UpsertPropertyValueV1 ¶
func (q *Queries) UpsertPropertyValueV1(ctx context.Context, params UpsertPropertyValueV1Params) (Property, error)
UpsertPropertyValueV1 upserts a property value for an entity
func (*Queries) UpsertRuleInstance ¶
func (q *Queries) UpsertRuleInstance(ctx context.Context, arg UpsertRuleInstanceParams) (uuid.UUID, error)
Copyright 2024 Stacklok, Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
type ReleaseLockParams ¶
type ReleaseStatus ¶
type ReleaseStatus string
const ( ReleaseStatusAlpha ReleaseStatus = "alpha" ReleaseStatusBeta ReleaseStatus = "beta" ReleaseStatusGa ReleaseStatus = "ga" ReleaseStatusDeprecated ReleaseStatus = "deprecated" )
func (*ReleaseStatus) Scan ¶
func (e *ReleaseStatus) Scan(src interface{}) error
type RemediationEvent ¶
type RemediationEvent struct { ID uuid.UUID `json:"id"` EvaluationID uuid.UUID `json:"evaluation_id"` Status RemediationStatusTypes `json:"status"` Details string `json:"details"` Metadata json.RawMessage `json:"metadata"` CreatedAt time.Time `json:"created_at"` }
type RemediationStatusTypes ¶
type RemediationStatusTypes string
const ( RemediationStatusTypesSuccess RemediationStatusTypes = "success" RemediationStatusTypesFailure RemediationStatusTypes = "failure" RemediationStatusTypesError RemediationStatusTypes = "error" RemediationStatusTypesSkipped RemediationStatusTypes = "skipped" RemediationStatusTypesNotAvailable RemediationStatusTypes = "not_available" RemediationStatusTypesPending RemediationStatusTypes = "pending" )
func (*RemediationStatusTypes) Scan ¶
func (e *RemediationStatusTypes) Scan(src interface{}) error
type Repository ¶
type Repository struct { ID uuid.UUID `json:"id"` Provider string `json:"provider"` ProjectID uuid.UUID `json:"project_id"` RepoOwner string `json:"repo_owner"` RepoName string `json:"repo_name"` RepoID int64 `json:"repo_id"` IsPrivate bool `json:"is_private"` IsFork bool `json:"is_fork"` WebhookID sql.NullInt64 `json:"webhook_id"` WebhookUrl string `json:"webhook_url"` DeployUrl string `json:"deploy_url"` CloneUrl string `json:"clone_url"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DefaultBranch sql.NullString `json:"default_branch"` License sql.NullString `json:"license"` ProviderID uuid.UUID `json:"provider_id"` ReminderLastSent sql.NullTime `json:"reminder_last_sent"` }
type RuleInstance ¶
type RuleInstance struct { ID uuid.UUID `json:"id"` ProfileID uuid.UUID `json:"profile_id"` RuleTypeID uuid.UUID `json:"rule_type_id"` Name string `json:"name"` EntityType Entities `json:"entity_type"` Def json.RawMessage `json:"def"` Params json.RawMessage `json:"params"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ProjectID uuid.UUID `json:"project_id"` }
type RuleType ¶
type RuleType struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Provider sql.NullString `json:"provider"` ProjectID uuid.UUID `json:"project_id"` Description string `json:"description"` Guidance string `json:"guidance"` Definition json.RawMessage `json:"definition"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` SeverityValue Severity `json:"severity_value"` ProviderID uuid.NullUUID `json:"provider_id"` SubscriptionID uuid.NullUUID `json:"subscription_id"` DisplayName string `json:"display_name"` ReleasePhase ReleaseStatus `json:"release_phase"` ShortFailureMessage string `json:"short_failure_message"` }
type SQLStore ¶
type SQLStore struct { *Queries // contains filtered or unexported fields }
SQLStore provides all functions to execute SQL queries and transactions
func (*SQLStore) BeginTransaction ¶
BeginTransaction begins a new transaction
func (*SQLStore) CheckHealth ¶
CheckHealth checks the health of the database
func (*SQLStore) GetQuerierWithTransaction ¶
func (*SQLStore) GetQuerierWithTransaction(tx *sql.Tx) ExtendQuerier
GetQuerierWithTransaction returns a new Querier with the provided transaction
func (*SQLStore) WithTransactionErr ¶
func (s *SQLStore) WithTransactionErr(fn func(querier ExtendQuerier) error) error
WithTransactionErr wraps an operation in a DB transaction. Compared with the `WithTransaction` function, this only returns errors and not values. Since this does not rely on generics, it can be modelled as a method and stubbed out more easily.
type SessionStore ¶
type SessionStore struct { ID int32 `json:"id"` Provider string `json:"provider"` ProjectID uuid.UUID `json:"project_id"` Port sql.NullInt32 `json:"port"` OwnerFilter sql.NullString `json:"owner_filter"` SessionState string `json:"session_state"` CreatedAt time.Time `json:"created_at"` RedirectUrl sql.NullString `json:"redirect_url"` RemoteUser sql.NullString `json:"remote_user"` EncryptedRedirect pqtype.NullRawMessage `json:"encrypted_redirect"` ProviderConfig []byte `json:"provider_config"` }
type SetCurrentVersionParams ¶
type Store ¶
type Store interface { ExtendQuerier CheckHealth() error BeginTransaction() (*sql.Tx, error) GetQuerierWithTransaction(tx *sql.Tx) ExtendQuerier Commit(tx *sql.Tx) error Rollback(tx *sql.Tx) error WithTransactionErr(fn func(querier ExtendQuerier) error) error }
Store provides all functions to execute db queries and transactions
type Subscription ¶
type UpdateEncryptedSecretParams ¶
type UpdateEncryptedSecretParams struct { ID int32 `json:"id"` Secret json.RawMessage `json:"secret"` }
type UpdateLeaseParams ¶
type UpdateOrganizationParams ¶
type UpdateOrganizationParams struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Metadata json.RawMessage `json:"metadata"` }
type UpdateProfileParams ¶
type UpdateProfileParams struct { ID uuid.UUID `json:"id"` ProjectID uuid.UUID `json:"project_id"` Remediate NullActionType `json:"remediate"` Alert NullActionType `json:"alert"` DisplayName string `json:"display_name"` Labels []string `json:"labels"` }
type UpdateProjectMetaParams ¶
type UpdateProjectMetaParams struct { ID uuid.UUID `json:"id"` Metadata json.RawMessage `json:"metadata"` }
type UpdateProviderParams ¶
type UpdateProviderParams struct { Implements []ProviderType `json:"implements"` Definition json.RawMessage `json:"definition"` AuthFlows []AuthorizationFlow `json:"auth_flows"` ID uuid.UUID `json:"id"` ProjectID uuid.UUID `json:"project_id"` }
type UpdateRuleTypeParams ¶
type UpdateRuleTypeParams struct { ID uuid.UUID `json:"id"` Description string `json:"description"` Definition json.RawMessage `json:"definition"` SeverityValue Severity `json:"severity_value"` DisplayName string `json:"display_name"` ReleasePhase ReleaseStatus `json:"release_phase"` ShortFailureMessage string `json:"short_failure_message"` }
type UpdateSelectorParams ¶
type UpdateSelectorParams struct { ID uuid.UUID `json:"id"` Entity NullEntities `json:"entity"` Selector string `json:"selector"` Comment string `json:"comment"` }
type UpsertAccessTokenParams ¶
type UpsertAccessTokenParams struct { ProjectID uuid.UUID `json:"project_id"` Provider string `json:"provider"` ExpirationTime time.Time `json:"expiration_time"` OwnerFilter sql.NullString `json:"owner_filter"` EnrollmentNonce sql.NullString `json:"enrollment_nonce"` EncryptedAccessToken pqtype.NullRawMessage `json:"encrypted_access_token"` }
type UpsertArtifactParams ¶
type UpsertArtifactParams struct { RepositoryID uuid.NullUUID `json:"repository_id"` ArtifactName string `json:"artifact_name"` ArtifactType string `json:"artifact_type"` ArtifactVisibility string `json:"artifact_visibility"` ProjectID uuid.UUID `json:"project_id"` ProviderID uuid.UUID `json:"provider_id"` ProviderName string `json:"provider_name"` }
type UpsertBundleParams ¶
type UpsertInstallationIDParams ¶
type UpsertInstallationIDParams struct { OrganizationID int64 `json:"organization_id"` AppInstallationID int64 `json:"app_installation_id"` ProviderID uuid.NullUUID `json:"provider_id"` EnrollingUserID sql.NullString `json:"enrolling_user_id"` EnrollmentNonce sql.NullString `json:"enrollment_nonce"` ProjectID uuid.NullUUID `json:"project_id"` IsOrg bool `json:"is_org"` }
type UpsertProfileForEntityParams ¶
type UpsertProfileForEntityParams struct { Entity Entities `json:"entity"` ProfileID uuid.UUID `json:"profile_id"` ContextualRules json.RawMessage `json:"contextual_rules"` }
type UpsertPropertyParams ¶
type UpsertPropertyParams struct { EntityID uuid.UUID `json:"entity_id"` Key string `json:"key"` Value json.RawMessage `json:"value"` }
type UpsertPropertyValueV1Params ¶
type UpsertPropertyValueV1Params struct { EntityID uuid.UUID `json:"entity_id"` Key string `json:"key"` Value any `json:"value"` }
UpsertPropertyValueV1Params is the input parameter for the UpsertProperty query
type UpsertRuleInstanceParams ¶
type UpsertRuleInstanceParams struct { ProfileID uuid.UUID `json:"profile_id"` RuleTypeID uuid.UUID `json:"rule_type_id"` Name string `json:"name"` EntityType Entities `json:"entity_type"` Def json.RawMessage `json:"def"` Params json.RawMessage `json:"params"` ProjectID uuid.UUID `json:"project_id"` }
Source Files ¶
- artifacts.sql.go
- db.go
- domain.go
- entities.sql.go
- entitlements.sql.go
- entity_execution_lock.sql.go
- entity_helpers.go
- errors.go
- eval_history.sql.go
- invitations.sql.go
- models.go
- organizations.sql.go
- profile_selector_scan.go
- profile_status.sql.go
- profiles.sql.go
- projects.sql.go
- projects_helpers.go
- provider_access_tokens.sql.go
- provider_github_app_installations.sql.go
- providers.sql.go
- querier.go
- repositories.sql.go
- rule_instances.sql.go
- rule_types.sql.go
- selectors.sql.go
- session_store.sql.go
- store.go
- subscriptions.sql.go
- types.go
- users.sql.go
- validators.go
Directories ¶
Path | Synopsis |
---|---|
Package embedded provides a test-only embedded Postgres database for testing queries.
|
Package embedded provides a test-only embedded Postgres database for testing queries. |
Package fixtures contains code for creating DB fixtures and is used in various parts of the code.
|
Package fixtures contains code for creating DB fixtures and is used in various parts of the code. |