Documentation
¶
Index ¶
- func CalculateProjectHierarchyOffset(hierarchy int) int
- func ErrIsUniqueViolation(err error) bool
- type ActionType
- type AddUserProjectParams
- type AddUserRoleParams
- type AlertStatusTypes
- type Artifact
- type ArtifactVersion
- type CountProfilesByEntityTypeRow
- type CreateAccessTokenParams
- type CreateArtifactParams
- type CreateArtifactVersionParams
- type CreateOrganizationParams
- type CreateProfileForEntityParams
- type CreateProfileParams
- type CreateProjectParams
- type CreateProviderParams
- type CreatePullRequestParams
- type CreateRepositoryParams
- type CreateRoleParams
- type CreateRuleTypeParams
- type CreateSessionStateParams
- type CreateSigningKeyParams
- type CreateUserParams
- type DBTX
- type DeleteAccessTokenParams
- type DeleteOldArtifactVersionsParams
- type DeleteProfileForEntityParams
- type DeleteProjectRow
- type DeleteProviderParams
- type DeletePullRequestParams
- type DeleteRuleInstantiationParams
- type DeleteRuleStatusesForProfileAndRuleTypeParams
- type DeleteSessionStateByProjectIDParams
- type DeleteSigningKeyParams
- type EnqueueFlushParams
- type Entities
- type Entitlement
- type EntityExecutionLock
- type EntityProfile
- type EntityProfileRule
- type EvalStatusTypes
- type ExtendQuerier
- type Feature
- type FlushCache
- type FlushCacheParams
- type GetAccessTokenByProjectIDParams
- type GetAccessTokenSinceDateParams
- type GetArtifactByIDRow
- type GetArtifactByNameParams
- type GetArtifactByNameRow
- type GetChildrenProjectsRow
- type GetEntityProfileByProjectAndNameParams
- type GetEntityProfileByProjectAndNameRow
- type GetFeatureInProjectParams
- type GetParentProjectsUntilParams
- type GetProfileByNameAndLockParams
- type GetProfileByProjectAndIDParams
- type GetProfileByProjectAndIDRow
- type GetProfileForEntityParams
- type GetProfileStatusByIdAndProjectParams
- type GetProfileStatusByIdAndProjectRow
- type GetProfileStatusByNameAndProjectParams
- type GetProfileStatusByNameAndProjectRow
- type GetProfileStatusByProjectRow
- type GetProjectIDPortBySessionStateRow
- type GetProviderByIDParams
- type GetProviderByNameParams
- type GetPullRequestParams
- type GetRepositoryByIDAndProjectParams
- type GetRepositoryByRepoNameParams
- type GetRoleByNameParams
- type GetRuleTypeByNameParams
- type GetUserProjectsRow
- type GetUserRolesRow
- type ListArtifactVersionsByArtifactIDAndTagParams
- type ListArtifactVersionsByArtifactIDParams
- type ListOrganizationsParams
- type ListProfilesByProjectIDRow
- type ListProfilesInstantiatingRuleTypeRow
- type ListRegisteredRepositoriesByProjectIDAndProviderParams
- type ListRepositoriesByOwnerParams
- type ListRepositoriesByProjectIDParams
- type ListRolesByProjectIDParams
- type ListRolesParams
- type ListRuleEvaluationsByProfileIdParams
- type ListRuleEvaluationsByProfileIdRow
- type ListRuleTypesByProviderAndProjectParams
- type ListUsersByOrganizationParams
- type ListUsersByProjectParams
- type ListUsersParams
- type LockIfThresholdNotExceededParams
- type NullActionType
- type NullAlertStatusTypes
- type NullEntities
- type NullEvalStatusTypes
- type NullProviderType
- type NullRemediationStatusTypes
- type Profile
- type ProfileStatus
- type Project
- type Provider
- type ProviderAccessToken
- type ProviderType
- type PullRequest
- type Querier
- type Queries
- func (q *Queries) AddUserProject(ctx context.Context, arg AddUserProjectParams) (UserProject, error)
- func (q *Queries) AddUserRole(ctx context.Context, arg AddUserRoleParams) (UserRole, error)
- func (q *Queries) CountProfilesByEntityType(ctx context.Context) ([]CountProfilesByEntityTypeRow, error)
- func (q *Queries) CountProfilesByName(ctx context.Context, name string) (int64, error)
- func (q *Queries) CountRepositories(ctx context.Context) (int64, error)
- func (q *Queries) CountUsers(ctx context.Context) (int64, error)
- func (q *Queries) CreateAccessToken(ctx context.Context, arg CreateAccessTokenParams) (ProviderAccessToken, error)
- func (q *Queries) CreateArtifact(ctx context.Context, arg CreateArtifactParams) (Artifact, error)
- func (q *Queries) CreateArtifactVersion(ctx context.Context, arg CreateArtifactVersionParams) (ArtifactVersion, 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) CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error)
- func (q *Queries) CreatePullRequest(ctx context.Context, arg CreatePullRequestParams) (PullRequest, error)
- func (q *Queries) CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error)
- func (q *Queries) CreateRole(ctx context.Context, arg CreateRoleParams) (Role, error)
- func (q *Queries) CreateRuleType(ctx context.Context, arg CreateRuleTypeParams) (RuleType, error)
- func (q *Queries) CreateSessionState(ctx context.Context, arg CreateSessionStateParams) (SessionStore, error)
- func (q *Queries) CreateSigningKey(ctx context.Context, arg CreateSigningKeyParams) (SigningKey, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeleteAccessToken(ctx context.Context, arg DeleteAccessTokenParams) error
- func (q *Queries) DeleteArtifact(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteArtifactVersion(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteExpiredSessionStates(ctx context.Context) error
- func (q *Queries) DeleteOldArtifactVersions(ctx context.Context, arg DeleteOldArtifactVersionsParams) error
- func (q *Queries) DeleteOrganization(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteProfile(ctx context.Context, id uuid.UUID) 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) DeleteProvider(ctx context.Context, arg DeleteProviderParams) error
- func (q *Queries) DeletePullRequest(ctx context.Context, arg DeletePullRequestParams) error
- func (q *Queries) DeleteRepository(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteRole(ctx context.Context, id int32) error
- func (q *Queries) DeleteRuleInstantiation(ctx context.Context, arg DeleteRuleInstantiationParams) error
- func (q *Queries) DeleteRuleStatusesForProfileAndRuleType(ctx context.Context, arg DeleteRuleStatusesForProfileAndRuleTypeParams) error
- func (q *Queries) DeleteRuleType(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteSessionState(ctx context.Context, id int32) error
- func (q *Queries) DeleteSessionStateByProjectID(ctx context.Context, arg DeleteSessionStateByProjectIDParams) error
- func (q *Queries) DeleteSigningKey(ctx context.Context, arg DeleteSigningKeyParams) 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) FlushCache(ctx context.Context, arg FlushCacheParams) (FlushCache, 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) GetArtifactByID(ctx context.Context, id uuid.UUID) (GetArtifactByIDRow, error)
- func (q *Queries) GetArtifactByName(ctx context.Context, arg GetArtifactByNameParams) (GetArtifactByNameRow, error)
- func (q *Queries) GetArtifactVersionByID(ctx context.Context, id uuid.UUID) (ArtifactVersion, error)
- func (q *Queries) GetArtifactVersionBySha(ctx context.Context, sha string) (ArtifactVersion, error)
- func (q *Queries) GetChildrenProjects(ctx context.Context, id uuid.UUID) ([]GetChildrenProjectsRow, error)
- func (q *Queries) GetEntityProfileByProjectAndName(ctx context.Context, arg GetEntityProfileByProjectAndNameParams) ([]GetEntityProfileByProjectAndNameRow, error)
- func (q *Queries) GetFeatureInProject(ctx context.Context, arg GetFeatureInProjectParams) (json.RawMessage, 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, id uuid.UUID) (Profile, error)
- func (q *Queries) GetProfileByIDAndLock(ctx context.Context, id uuid.UUID) (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) GetProfileForEntity(ctx context.Context, arg GetProfileForEntityParams) (EntityProfile, 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) GetProjectIDPortBySessionState(ctx context.Context, sessionState string) (GetProjectIDPortBySessionStateRow, error)
- func (q *Queries) GetProviderByID(ctx context.Context, arg GetProviderByIDParams) (Provider, error)
- func (q *Queries) GetProviderByName(ctx context.Context, arg GetProviderByNameParams) (Provider, error)
- func (q *Queries) GetPullRequest(ctx context.Context, arg GetPullRequestParams) (PullRequest, error)
- func (q *Queries) GetPullRequestByID(ctx context.Context, id uuid.UUID) (PullRequest, 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 int32) (Repository, error)
- func (q *Queries) GetRepositoryByRepoName(ctx context.Context, arg GetRepositoryByRepoNameParams) (Repository, error)
- func (q *Queries) GetRoleByID(ctx context.Context, id int32) (Role, error)
- func (q *Queries) GetRoleByName(ctx context.Context, arg GetRoleByNameParams) (Role, error)
- func (q *Queries) GetRootProjects(ctx context.Context) ([]Project, error)
- func (q *Queries) GetRuleEvaluationByProfileIdAndRuleType(ctx context.Context, profileID uuid.UUID, entityType NullEntities, ...) (ListRuleEvaluationsByProfileIdRow, 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) GetSessionState(ctx context.Context, id int32) (SessionStore, error)
- func (q *Queries) GetSessionStateByProjectID(ctx context.Context, projectID uuid.UUID) (SessionStore, error)
- func (q *Queries) GetSigningKeyByIdentifier(ctx context.Context, keyIdentifier string) (SigningKey, error)
- func (q *Queries) GetSigningKeyByProjectID(ctx context.Context, projectID uuid.UUID) (SigningKey, 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) GetUserProjects(ctx context.Context, userID int32) ([]GetUserProjectsRow, error)
- func (q *Queries) GetUserRoles(ctx context.Context, userID int32) ([]GetUserRolesRow, error)
- func (q *Queries) GlobalListProviders(ctx context.Context) ([]Provider, error)
- func (q *Queries) ListAllRepositories(ctx context.Context, provider string) ([]Repository, error)
- func (q *Queries) ListArtifactVersionsByArtifactID(ctx context.Context, arg ListArtifactVersionsByArtifactIDParams) ([]ArtifactVersion, error)
- func (q *Queries) ListArtifactVersionsByArtifactIDAndTag(ctx context.Context, arg ListArtifactVersionsByArtifactIDAndTagParams) ([]ArtifactVersion, error)
- func (q *Queries) ListArtifactsByRepoID(ctx context.Context, repositoryID uuid.UUID) ([]Artifact, error)
- func (q *Queries) ListFlushCache(ctx context.Context) ([]FlushCache, error)
- func (q *Queries) ListOrganizations(ctx context.Context, arg ListOrganizationsParams) ([]Project, error)
- func (q *Queries) ListProfilesByProjectID(ctx context.Context, projectID uuid.UUID) ([]ListProfilesByProjectIDRow, error)
- func (q *Queries) ListProfilesInstantiatingRuleType(ctx context.Context, ruleTypeID uuid.UUID) ([]ListProfilesInstantiatingRuleTypeRow, error)
- func (q *Queries) ListProvidersByProjectID(ctx context.Context, projectID uuid.UUID) ([]Provider, error)
- func (q *Queries) ListRegisteredRepositoriesByProjectIDAndProvider(ctx context.Context, ...) ([]Repository, error)
- func (q *Queries) ListRepositoriesByOwner(ctx context.Context, arg ListRepositoriesByOwnerParams) ([]Repository, error)
- func (q *Queries) ListRepositoriesByProjectID(ctx context.Context, arg ListRepositoriesByProjectIDParams) ([]Repository, error)
- func (q *Queries) ListRoles(ctx context.Context, arg ListRolesParams) ([]Role, error)
- func (q *Queries) ListRolesByProjectID(ctx context.Context, arg ListRolesByProjectIDParams) ([]Role, error)
- func (q *Queries) ListRuleEvaluationsByProfileId(ctx context.Context, arg ListRuleEvaluationsByProfileIdParams) ([]ListRuleEvaluationsByProfileIdRow, error)
- func (q *Queries) ListRuleTypesByProviderAndProject(ctx context.Context, arg ListRuleTypesByProviderAndProjectParams) ([]RuleType, error)
- func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
- func (q *Queries) ListUsersByOrganization(ctx context.Context, arg ListUsersByOrganizationParams) ([]User, error)
- func (q *Queries) ListUsersByProject(ctx context.Context, arg ListUsersByProjectParams) ([]User, error)
- func (q *Queries) ListUsersByRoleId(ctx context.Context, roleID int32) ([]int32, error)
- func (q *Queries) LockIfThresholdNotExceeded(ctx context.Context, arg LockIfThresholdNotExceededParams) (EntityExecutionLock, error)
- func (q *Queries) ReleaseLock(ctx context.Context, arg ReleaseLockParams) error
- func (q *Queries) UpdateAccessToken(ctx context.Context, arg UpdateAccessTokenParams) (ProviderAccessToken, 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) UpdateRepository(ctx context.Context, arg UpdateRepositoryParams) (Repository, error)
- func (q *Queries) UpdateRepositoryByID(ctx context.Context, arg UpdateRepositoryByIDParams) (Repository, error)
- func (q *Queries) UpdateRole(ctx context.Context, arg UpdateRoleParams) (Role, error)
- func (q *Queries) UpdateRuleType(ctx context.Context, arg UpdateRuleTypeParams) error
- func (q *Queries) UpsertArtifact(ctx context.Context, arg UpsertArtifactParams) (Artifact, error)
- func (q *Queries) UpsertArtifactVersion(ctx context.Context, arg UpsertArtifactVersionParams) (ArtifactVersion, error)
- func (q *Queries) UpsertProfileForEntity(ctx context.Context, arg UpsertProfileForEntityParams) (EntityProfile, error)
- func (q *Queries) UpsertPullRequest(ctx context.Context, arg UpsertPullRequestParams) (PullRequest, error)
- func (q *Queries) UpsertRuleDetailsAlert(ctx context.Context, arg UpsertRuleDetailsAlertParams) (uuid.UUID, error)
- func (q *Queries) UpsertRuleDetailsEval(ctx context.Context, arg UpsertRuleDetailsEvalParams) (uuid.UUID, error)
- func (q *Queries) UpsertRuleDetailsRemediate(ctx context.Context, arg UpsertRuleDetailsRemediateParams) (uuid.UUID, error)
- func (q *Queries) UpsertRuleEvaluations(ctx context.Context, arg UpsertRuleEvaluationsParams) (uuid.UUID, error)
- func (q *Queries) UpsertRuleInstantiation(ctx context.Context, arg UpsertRuleInstantiationParams) (EntityProfileRule, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type ReleaseLockParams
- type RemediationStatusTypes
- type Repository
- type Role
- type RuleDetailsAlert
- type RuleDetailsEval
- type RuleDetailsRemediate
- type RuleEvaluation
- type RuleType
- type SQLStore
- type SessionStore
- type SigningKey
- type Store
- type UpdateAccessTokenParams
- type UpdateLeaseParams
- type UpdateOrganizationParams
- type UpdateProfileParams
- type UpdateRepositoryByIDParams
- type UpdateRepositoryParams
- type UpdateRoleParams
- type UpdateRuleTypeParams
- type UpsertArtifactParams
- type UpsertArtifactVersionParams
- type UpsertProfileForEntityParams
- type UpsertPullRequestParams
- type UpsertRuleDetailsAlertParams
- type UpsertRuleDetailsEvalParams
- type UpsertRuleDetailsRemediateParams
- type UpsertRuleEvaluationsParams
- type UpsertRuleInstantiationParams
- type User
- type UserProject
- type UserRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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
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 AddUserProjectParams ¶
type AddUserRoleParams ¶
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.UUID `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"` }
type ArtifactVersion ¶
type ArtifactVersion struct { ID uuid.UUID `json:"id"` ArtifactID uuid.UUID `json:"artifact_id"` Version int64 `json:"version"` Tags sql.NullString `json:"tags"` Sha string `json:"sha"` SignatureVerification pqtype.NullRawMessage `json:"signature_verification"` GithubWorkflow pqtype.NullRawMessage `json:"github_workflow"` CreatedAt time.Time `json:"created_at"` }
type CreateAccessTokenParams ¶
type CreateArtifactParams ¶
type CreateArtifactVersionParams ¶
type CreateArtifactVersionParams struct { ArtifactID uuid.UUID `json:"artifact_id"` Version int64 `json:"version"` Tags sql.NullString `json:"tags"` Sha string `json:"sha"` CreatedAt time.Time `json:"created_at"` SignatureVerification json.RawMessage `json:"signature_verification"` GithubWorkflow json.RawMessage `json:"github_workflow"` }
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 { Provider string `json:"provider"` ProjectID uuid.UUID `json:"project_id"` Remediate NullActionType `json:"remediate"` Alert NullActionType `json:"alert"` Name string `json:"name"` }
type CreateProjectParams ¶
type CreateProjectParams struct { Name string `json:"name"` ParentID uuid.NullUUID `json:"parent_id"` Metadata json.RawMessage `json:"metadata"` }
type CreateProviderParams ¶
type CreateProviderParams struct { Name string `json:"name"` ProjectID uuid.UUID `json:"project_id"` Implements []ProviderType `json:"implements"` Definition json.RawMessage `json:"definition"` }
type CreatePullRequestParams ¶
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 int32 `json:"repo_id"` IsPrivate bool `json:"is_private"` IsFork bool `json:"is_fork"` WebhookID sql.NullInt32 `json:"webhook_id"` WebhookUrl string `json:"webhook_url"` DeployUrl string `json:"deploy_url"` CloneUrl string `json:"clone_url"` DefaultBranch sql.NullString `json:"default_branch"` }
type CreateRoleParams ¶
type CreateRuleTypeParams ¶
type CreateSigningKeyParams ¶
type CreateUserParams ¶
type DeleteAccessTokenParams ¶
type DeleteProfileForEntityParams ¶ added in v0.0.16
type DeleteProjectRow ¶
type DeleteProviderParams ¶
type DeletePullRequestParams ¶
type DeleteRuleInstantiationParams ¶ added in v0.0.16
type DeleteRuleStatusesForProfileAndRuleTypeParams ¶ added in v0.0.16
type DeleteSigningKeyParams ¶
type EnqueueFlushParams ¶ added in v0.0.17
type Entitlement ¶
type EntityExecutionLock ¶ added in v0.0.17
type EntityExecutionLock struct { ID uuid.UUID `json:"id"` Entity Entities `json:"entity"` LockedBy uuid.UUID `json:"locked_by"` LastLockTime time.Time `json:"last_lock_time"` RepositoryID uuid.UUID `json:"repository_id"` ArtifactID uuid.NullUUID `json:"artifact_id"` PullRequestID uuid.NullUUID `json:"pull_request_id"` }
type EntityProfile ¶
type EntityProfileRule ¶
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 ExtendQuerier ¶
type ExtendQuerier interface { Querier GetRuleEvaluationByProfileIdAndRuleType(ctx context.Context, profileID uuid.UUID, entityType NullEntities, entityID uuid.NullUUID, ruleName sql.NullString) (ListRuleEvaluationsByProfileIdRow, error) }
ExtendQuerier extends the Querier interface with custom queries
type FlushCache ¶ added in v0.0.17
type FlushCacheParams ¶ added in v0.0.17
type GetArtifactByIDRow ¶
type GetArtifactByIDRow struct { ID uuid.UUID `json:"id"` RepositoryID uuid.UUID `json:"repository_id"` ArtifactName string `json:"artifact_name"` ArtifactType string `json:"artifact_type"` ArtifactVisibility string `json:"artifact_visibility"` CreatedAt time.Time `json:"created_at"` Provider string `json:"provider"` ProjectID uuid.UUID `json:"project_id"` RepoOwner string `json:"repo_owner"` RepoName string `json:"repo_name"` }
type GetArtifactByNameParams ¶ added in v0.0.22
type GetArtifactByNameRow ¶ added in v0.0.22
type GetArtifactByNameRow struct { ID uuid.UUID `json:"id"` RepositoryID uuid.UUID `json:"repository_id"` ArtifactName string `json:"artifact_name"` ArtifactType string `json:"artifact_type"` ArtifactVisibility string `json:"artifact_visibility"` CreatedAt time.Time `json:"created_at"` Provider string `json:"provider"` ProjectID uuid.UUID `json:"project_id"` RepoOwner string `json:"repo_owner"` RepoName string `json:"repo_name"` }
type GetChildrenProjectsRow ¶
type GetEntityProfileByProjectAndNameParams ¶ added in v0.0.16
type GetEntityProfileByProjectAndNameRow ¶ added in v0.0.16
type GetEntityProfileByProjectAndNameRow struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Provider string `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"` ID_2 uuid.UUID `json:"id_2"` Entity Entities `json:"entity"` ProfileID uuid.UUID `json:"profile_id"` ContextualRules json.RawMessage `json:"contextual_rules"` CreatedAt_2 time.Time `json:"created_at_2"` UpdatedAt_2 time.Time `json:"updated_at_2"` }
type GetProfileByNameAndLockParams ¶ added in v0.0.16
type GetProfileByProjectAndIDRow ¶
type GetProfileByProjectAndIDRow struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Provider string `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"` ID_2 uuid.UUID `json:"id_2"` Entity Entities `json:"entity"` ProfileID uuid.UUID `json:"profile_id"` ContextualRules json.RawMessage `json:"contextual_rules"` CreatedAt_2 time.Time `json:"created_at_2"` UpdatedAt_2 time.Time `json:"updated_at_2"` }
type GetProfileForEntityParams ¶ added in v0.0.16
type GetProviderByIDParams ¶
type GetProviderByNameParams ¶
type GetPullRequestParams ¶
type GetRoleByNameParams ¶
type GetRuleTypeByNameParams ¶
type GetUserProjectsRow ¶
type GetUserProjectsRow struct { ID uuid.UUID `json:"id"` Name string `json:"name"` IsOrganization bool `json:"is_organization"` Metadata json.RawMessage `json:"metadata"` ParentID uuid.NullUUID `json:"parent_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ID_2 int32 `json:"id_2"` UserID int32 `json:"user_id"` ProjectID uuid.UUID `json:"project_id"` }
type GetUserRolesRow ¶
type GetUserRolesRow struct { ID int32 `json:"id"` OrganizationID uuid.UUID `json:"organization_id"` ProjectID uuid.NullUUID `json:"project_id"` Name string `json:"name"` IsAdmin bool `json:"is_admin"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ID_2 int32 `json:"id_2"` UserID int32 `json:"user_id"` RoleID int32 `json:"role_id"` }
type ListOrganizationsParams ¶
type ListProfilesByProjectIDRow ¶
type ListProfilesByProjectIDRow struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Provider string `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"` ID_2 uuid.UUID `json:"id_2"` Entity Entities `json:"entity"` ProfileID uuid.UUID `json:"profile_id"` ContextualRules json.RawMessage `json:"contextual_rules"` CreatedAt_2 time.Time `json:"created_at_2"` UpdatedAt_2 time.Time `json:"updated_at_2"` }
type ListRolesParams ¶
type ListRuleEvaluationsByProfileIdParams ¶
type ListRuleEvaluationsByProfileIdParams struct { ProfileID uuid.UUID `json:"profile_id"` EntityType NullEntities `json:"entity_type"` EntityID uuid.NullUUID `json:"entity_id"` RuleName sql.NullString `json:"rule_name"` }
type ListRuleEvaluationsByProfileIdRow ¶
type ListRuleEvaluationsByProfileIdRow struct { EvalStatus NullEvalStatusTypes `json:"eval_status"` EvalLastUpdated sql.NullTime `json:"eval_last_updated"` EvalDetails sql.NullString `json:"eval_details"` RemStatus NullRemediationStatusTypes `json:"rem_status"` RemDetails sql.NullString `json:"rem_details"` RemLastUpdated sql.NullTime `json:"rem_last_updated"` AlertStatus NullAlertStatusTypes `json:"alert_status"` AlertDetails sql.NullString `json:"alert_details"` AlertMetadata pqtype.NullRawMessage `json:"alert_metadata"` AlertLastUpdated sql.NullTime `json:"alert_last_updated"` RepositoryID uuid.NullUUID `json:"repository_id"` Entity Entities `json:"entity"` RepoName string `json:"repo_name"` RepoOwner string `json:"repo_owner"` Provider string `json:"provider"` RuleTypeName string `json:"rule_type_name"` RuleTypeID uuid.UUID `json:"rule_type_id"` }
type ListUsersParams ¶
type LockIfThresholdNotExceededParams ¶ added in v0.0.17
type NullActionType ¶
type NullActionType struct { ActionType ActionType `json:"action_type"` Valid bool `json:"valid"` // Valid is true if ActionType is not NULL }
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 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 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 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 Profile ¶
type Profile struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Provider string `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"` }
type ProfileStatus ¶
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"` }
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 string `json:"encrypted_token"` ExpirationTime time.Time `json:"expiration_time"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type ProviderType ¶
type ProviderType string
const ( ProviderTypeGithub ProviderType = "github" ProviderTypeRest ProviderType = "rest" ProviderTypeGit ProviderType = "git" ProviderTypeOci ProviderType = "oci" ProviderTypeRepoLister ProviderType = "repo-lister" )
func (*ProviderType) Scan ¶
func (e *ProviderType) Scan(src interface{}) error
type PullRequest ¶
type Querier ¶
type Querier interface { AddUserProject(ctx context.Context, arg AddUserProjectParams) (UserProject, error) AddUserRole(ctx context.Context, arg AddUserRoleParams) (UserRole, error) CountProfilesByEntityType(ctx context.Context) ([]CountProfilesByEntityTypeRow, error) CountProfilesByName(ctx context.Context, name string) (int64, error) CountRepositories(ctx context.Context) (int64, error) CountUsers(ctx context.Context) (int64, error) CreateAccessToken(ctx context.Context, arg CreateAccessTokenParams) (ProviderAccessToken, error) CreateArtifact(ctx context.Context, arg CreateArtifactParams) (Artifact, error) CreateArtifactVersion(ctx context.Context, arg CreateArtifactVersionParams) (ArtifactVersion, error) CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Project, 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) CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error) CreatePullRequest(ctx context.Context, arg CreatePullRequestParams) (PullRequest, error) CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error) CreateRole(ctx context.Context, arg CreateRoleParams) (Role, error) CreateRuleType(ctx context.Context, arg CreateRuleTypeParams) (RuleType, error) CreateSessionState(ctx context.Context, arg CreateSessionStateParams) (SessionStore, error) CreateSigningKey(ctx context.Context, arg CreateSigningKeyParams) (SigningKey, error) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) DeleteAccessToken(ctx context.Context, arg DeleteAccessTokenParams) error DeleteArtifact(ctx context.Context, id uuid.UUID) error DeleteArtifactVersion(ctx context.Context, id uuid.UUID) error DeleteExpiredSessionStates(ctx context.Context) error DeleteOldArtifactVersions(ctx context.Context, arg DeleteOldArtifactVersionsParams) error DeleteOrganization(ctx context.Context, id uuid.UUID) error DeleteProfile(ctx context.Context, id uuid.UUID) error DeleteProfileForEntity(ctx context.Context, arg DeleteProfileForEntityParams) error DeleteProject(ctx context.Context, id uuid.UUID) ([]DeleteProjectRow, error) DeleteProvider(ctx context.Context, arg DeleteProviderParams) error DeletePullRequest(ctx context.Context, arg DeletePullRequestParams) error DeleteRepository(ctx context.Context, id uuid.UUID) error DeleteRole(ctx context.Context, id int32) error DeleteRuleInstantiation(ctx context.Context, arg DeleteRuleInstantiationParams) error // DeleteRuleStatusesForProfileAndRuleType deletes a rule evaluation // but locks the table before doing so. DeleteRuleStatusesForProfileAndRuleType(ctx context.Context, arg DeleteRuleStatusesForProfileAndRuleTypeParams) error DeleteRuleType(ctx context.Context, id uuid.UUID) error DeleteSessionState(ctx context.Context, id int32) error DeleteSessionStateByProjectID(ctx context.Context, arg DeleteSessionStateByProjectIDParams) error DeleteSigningKey(ctx context.Context, arg DeleteSigningKeyParams) error DeleteUser(ctx context.Context, id int32) error EnqueueFlush(ctx context.Context, arg EnqueueFlushParams) (FlushCache, error) FlushCache(ctx context.Context, arg FlushCacheParams) (FlushCache, 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) GetArtifactByID(ctx context.Context, id uuid.UUID) (GetArtifactByIDRow, error) GetArtifactByName(ctx context.Context, arg GetArtifactByNameParams) (GetArtifactByNameRow, error) GetArtifactVersionByID(ctx context.Context, id uuid.UUID) (ArtifactVersion, error) GetArtifactVersionBySha(ctx context.Context, sha string) (ArtifactVersion, error) GetChildrenProjects(ctx context.Context, id uuid.UUID) ([]GetChildrenProjectsRow, error) GetEntityProfileByProjectAndName(ctx context.Context, arg GetEntityProfileByProjectAndNameParams) ([]GetEntityProfileByProjectAndNameRow, 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) GetOrganization(ctx context.Context, id uuid.UUID) (Project, error) GetOrganizationByName(ctx context.Context, name string) (Project, error) GetOrganizationForUpdate(ctx context.Context, name string) (Project, error) GetParentProjects(ctx context.Context, id uuid.UUID) ([]uuid.UUID, error) GetParentProjectsUntil(ctx context.Context, arg GetParentProjectsUntilParams) ([]uuid.UUID, error) GetProfileByID(ctx context.Context, id uuid.UUID) (Profile, error) GetProfileByIDAndLock(ctx context.Context, id uuid.UUID) (Profile, error) GetProfileByNameAndLock(ctx context.Context, arg GetProfileByNameAndLockParams) (Profile, error) GetProfileByProjectAndID(ctx context.Context, arg GetProfileByProjectAndIDParams) ([]GetProfileByProjectAndIDRow, error) GetProfileForEntity(ctx context.Context, arg GetProfileForEntityParams) (EntityProfile, 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) GetProjectIDPortBySessionState(ctx context.Context, sessionState string) (GetProjectIDPortBySessionStateRow, error) GetProviderByID(ctx context.Context, arg GetProviderByIDParams) (Provider, error) GetProviderByName(ctx context.Context, arg GetProviderByNameParams) (Provider, error) GetPullRequest(ctx context.Context, arg GetPullRequestParams) (PullRequest, error) GetPullRequestByID(ctx context.Context, id uuid.UUID) (PullRequest, error) GetRepositoryByID(ctx context.Context, id uuid.UUID) (Repository, error) GetRepositoryByIDAndProject(ctx context.Context, arg GetRepositoryByIDAndProjectParams) (Repository, error) GetRepositoryByRepoID(ctx context.Context, repoID int32) (Repository, error) GetRepositoryByRepoName(ctx context.Context, arg GetRepositoryByRepoNameParams) (Repository, error) GetRoleByID(ctx context.Context, id int32) (Role, error) GetRoleByName(ctx context.Context, arg GetRoleByNameParams) (Role, error) GetRootProjects(ctx context.Context) ([]Project, error) GetRuleTypeByID(ctx context.Context, id uuid.UUID) (RuleType, error) GetRuleTypeByName(ctx context.Context, arg GetRuleTypeByNameParams) (RuleType, error) GetSessionState(ctx context.Context, id int32) (SessionStore, error) GetSessionStateByProjectID(ctx context.Context, projectID uuid.UUID) (SessionStore, error) GetSigningKeyByIdentifier(ctx context.Context, keyIdentifier string) (SigningKey, error) GetSigningKeyByProjectID(ctx context.Context, projectID uuid.UUID) (SigningKey, error) GetUserByID(ctx context.Context, id int32) (User, error) GetUserBySubject(ctx context.Context, identitySubject string) (User, error) GetUserProjects(ctx context.Context, userID int32) ([]GetUserProjectsRow, error) GetUserRoles(ctx context.Context, userID int32) ([]GetUserRolesRow, error) GlobalListProviders(ctx context.Context) ([]Provider, error) ListAllRepositories(ctx context.Context, provider string) ([]Repository, error) ListArtifactVersionsByArtifactID(ctx context.Context, arg ListArtifactVersionsByArtifactIDParams) ([]ArtifactVersion, error) ListArtifactVersionsByArtifactIDAndTag(ctx context.Context, arg ListArtifactVersionsByArtifactIDAndTagParams) ([]ArtifactVersion, error) ListArtifactsByRepoID(ctx context.Context, repositoryID uuid.UUID) ([]Artifact, error) ListFlushCache(ctx context.Context) ([]FlushCache, error) ListOrganizations(ctx context.Context, arg ListOrganizationsParams) ([]Project, error) ListProfilesByProjectID(ctx context.Context, projectID uuid.UUID) ([]ListProfilesByProjectIDRow, error) // get profile information that instantiate a rule. This is done by joining the profiles with entity_profiles, then correlating those // with entity_profile_rules. The rule_type_id is used to filter the results. Note that we only really care about the overal profile, // so we only return the profile information. We also should group the profiles so that we don't get duplicates. ListProfilesInstantiatingRuleType(ctx context.Context, ruleTypeID uuid.UUID) ([]ListProfilesInstantiatingRuleTypeRow, error) ListProvidersByProjectID(ctx context.Context, projectID uuid.UUID) ([]Provider, error) ListRegisteredRepositoriesByProjectIDAndProvider(ctx context.Context, arg ListRegisteredRepositoriesByProjectIDAndProviderParams) ([]Repository, error) ListRepositoriesByOwner(ctx context.Context, arg ListRepositoriesByOwnerParams) ([]Repository, error) ListRepositoriesByProjectID(ctx context.Context, arg ListRepositoriesByProjectIDParams) ([]Repository, error) ListRoles(ctx context.Context, arg ListRolesParams) ([]Role, error) ListRolesByProjectID(ctx context.Context, arg ListRolesByProjectIDParams) ([]Role, error) ListRuleEvaluationsByProfileId(ctx context.Context, arg ListRuleEvaluationsByProfileIdParams) ([]ListRuleEvaluationsByProfileIdRow, error) ListRuleTypesByProviderAndProject(ctx context.Context, arg ListRuleTypesByProviderAndProjectParams) ([]RuleType, error) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error) ListUsersByOrganization(ctx context.Context, arg ListUsersByOrganizationParams) ([]User, error) ListUsersByProject(ctx context.Context, arg ListUsersByProjectParams) ([]User, error) ListUsersByRoleId(ctx context.Context, roleID int32) ([]int32, 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) // 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 UpdateAccessToken(ctx context.Context, arg UpdateAccessTokenParams) (ProviderAccessToken, error) UpdateLease(ctx context.Context, arg UpdateLeaseParams) error UpdateOrganization(ctx context.Context, arg UpdateOrganizationParams) (Project, error) UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error) // set clone_url if the value is not an empty string UpdateRepository(ctx context.Context, arg UpdateRepositoryParams) (Repository, error) UpdateRepositoryByID(ctx context.Context, arg UpdateRepositoryByIDParams) (Repository, error) UpdateRole(ctx context.Context, arg UpdateRoleParams) (Role, error) UpdateRuleType(ctx context.Context, arg UpdateRuleTypeParams) error UpsertArtifact(ctx context.Context, arg UpsertArtifactParams) (Artifact, error) UpsertArtifactVersion(ctx context.Context, arg UpsertArtifactVersionParams) (ArtifactVersion, error) UpsertProfileForEntity(ctx context.Context, arg UpsertProfileForEntityParams) (EntityProfile, error) UpsertPullRequest(ctx context.Context, arg UpsertPullRequestParams) (PullRequest, error) UpsertRuleDetailsAlert(ctx context.Context, arg UpsertRuleDetailsAlertParams) (uuid.UUID, error) UpsertRuleDetailsEval(ctx context.Context, arg UpsertRuleDetailsEvalParams) (uuid.UUID, error) UpsertRuleDetailsRemediate(ctx context.Context, arg UpsertRuleDetailsRemediateParams) (uuid.UUID, error) UpsertRuleEvaluations(ctx context.Context, arg UpsertRuleEvaluationsParams) (uuid.UUID, error) UpsertRuleInstantiation(ctx context.Context, arg UpsertRuleInstantiationParams) (EntityProfileRule, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddUserProject ¶
func (q *Queries) AddUserProject(ctx context.Context, arg AddUserProjectParams) (UserProject, error)
func (*Queries) AddUserRole ¶
func (*Queries) CountProfilesByEntityType ¶
func (q *Queries) CountProfilesByEntityType(ctx context.Context) ([]CountProfilesByEntityTypeRow, error)
func (*Queries) CountProfilesByName ¶ added in v0.0.20
func (*Queries) CountRepositories ¶ added in v0.0.16
func (*Queries) CreateAccessToken ¶
func (q *Queries) CreateAccessToken(ctx context.Context, arg CreateAccessTokenParams) (ProviderAccessToken, error)
func (*Queries) CreateArtifact ¶
func (*Queries) CreateArtifactVersion ¶
func (q *Queries) CreateArtifactVersion(ctx context.Context, arg CreateArtifactVersionParams) (ArtifactVersion, error)
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) CreateProvider ¶
func (*Queries) CreatePullRequest ¶
func (q *Queries) CreatePullRequest(ctx context.Context, arg CreatePullRequestParams) (PullRequest, error)
func (*Queries) CreateRepository ¶
func (q *Queries) CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error)
func (*Queries) CreateRole ¶
func (*Queries) CreateRuleType ¶
func (*Queries) CreateSessionState ¶
func (q *Queries) CreateSessionState(ctx context.Context, arg CreateSessionStateParams) (SessionStore, error)
func (*Queries) CreateSigningKey ¶
func (q *Queries) CreateSigningKey(ctx context.Context, arg CreateSigningKeyParams) (SigningKey, error)
func (*Queries) CreateUser ¶
func (*Queries) DeleteAccessToken ¶
func (q *Queries) DeleteAccessToken(ctx context.Context, arg DeleteAccessTokenParams) error
func (*Queries) DeleteArtifact ¶
func (*Queries) DeleteArtifactVersion ¶
func (*Queries) DeleteExpiredSessionStates ¶
func (*Queries) DeleteOldArtifactVersions ¶
func (q *Queries) DeleteOldArtifactVersions(ctx context.Context, arg DeleteOldArtifactVersionsParams) error
func (*Queries) DeleteOrganization ¶
func (*Queries) DeleteProfile ¶
func (*Queries) DeleteProfileForEntity ¶ added in v0.0.16
func (q *Queries) DeleteProfileForEntity(ctx context.Context, arg DeleteProfileForEntityParams) error
func (*Queries) DeleteProject ¶
func (*Queries) DeleteProvider ¶
func (q *Queries) DeleteProvider(ctx context.Context, arg DeleteProviderParams) error
func (*Queries) DeletePullRequest ¶
func (q *Queries) DeletePullRequest(ctx context.Context, arg DeletePullRequestParams) error
func (*Queries) DeleteRepository ¶
func (*Queries) DeleteRuleInstantiation ¶ added in v0.0.16
func (q *Queries) DeleteRuleInstantiation(ctx context.Context, arg DeleteRuleInstantiationParams) error
func (*Queries) DeleteRuleStatusesForProfileAndRuleType ¶ added in v0.0.16
func (q *Queries) DeleteRuleStatusesForProfileAndRuleType(ctx context.Context, arg DeleteRuleStatusesForProfileAndRuleTypeParams) error
DeleteRuleStatusesForProfileAndRuleType deletes a rule evaluation but locks the table before doing so.
func (*Queries) DeleteRuleType ¶
func (*Queries) DeleteSessionState ¶
func (*Queries) DeleteSessionStateByProjectID ¶
func (q *Queries) DeleteSessionStateByProjectID(ctx context.Context, arg DeleteSessionStateByProjectIDParams) error
func (*Queries) DeleteSigningKey ¶
func (q *Queries) DeleteSigningKey(ctx context.Context, arg DeleteSigningKeyParams) error
func (*Queries) EnqueueFlush ¶ added in v0.0.17
func (q *Queries) EnqueueFlush(ctx context.Context, arg EnqueueFlushParams) (FlushCache, error)
func (*Queries) FlushCache ¶ added in v0.0.17
func (q *Queries) FlushCache(ctx context.Context, arg FlushCacheParams) (FlushCache, 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) GetArtifactByID ¶
func (*Queries) GetArtifactByName ¶ added in v0.0.22
func (q *Queries) GetArtifactByName(ctx context.Context, arg GetArtifactByNameParams) (GetArtifactByNameRow, error)
func (*Queries) GetArtifactVersionByID ¶
func (*Queries) GetArtifactVersionBySha ¶
func (*Queries) GetChildrenProjects ¶
func (*Queries) GetEntityProfileByProjectAndName ¶ added in v0.0.16
func (q *Queries) GetEntityProfileByProjectAndName(ctx context.Context, arg GetEntityProfileByProjectAndNameParams) ([]GetEntityProfileByProjectAndNameRow, 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) GetOrganization ¶
func (*Queries) GetOrganizationByName ¶
func (*Queries) GetOrganizationForUpdate ¶
func (*Queries) GetParentProjects ¶
func (*Queries) GetParentProjectsUntil ¶
func (*Queries) GetProfileByID ¶
func (*Queries) GetProfileByIDAndLock ¶ added in v0.0.16
func (*Queries) GetProfileByNameAndLock ¶ added in v0.0.16
func (*Queries) GetProfileByProjectAndID ¶
func (q *Queries) GetProfileByProjectAndID(ctx context.Context, arg GetProfileByProjectAndIDParams) ([]GetProfileByProjectAndIDRow, error)
func (*Queries) GetProfileForEntity ¶ added in v0.0.16
func (q *Queries) GetProfileForEntity(ctx context.Context, arg GetProfileForEntityParams) (EntityProfile, 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) GetProjectIDPortBySessionState ¶
func (*Queries) GetProviderByID ¶
func (*Queries) GetProviderByName ¶
func (*Queries) GetPullRequest ¶
func (q *Queries) GetPullRequest(ctx context.Context, arg GetPullRequestParams) (PullRequest, error)
func (*Queries) GetPullRequestByID ¶ added in v0.0.17
func (*Queries) GetRepositoryByID ¶
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) GetRoleByID ¶
func (*Queries) GetRoleByName ¶
func (*Queries) GetRootProjects ¶
func (*Queries) GetRuleEvaluationByProfileIdAndRuleType ¶
func (q *Queries) GetRuleEvaluationByProfileIdAndRuleType( ctx context.Context, profileID uuid.UUID, entityType NullEntities, entityID uuid.NullUUID, ruleName sql.NullString, ) (ListRuleEvaluationsByProfileIdRow, error)
GetRuleEvaluationByProfileIdAndRuleType returns the rule evaluation for a given profile and its rule name
func (*Queries) GetRuleTypeByID ¶
func (*Queries) GetRuleTypeByName ¶
func (*Queries) GetSessionState ¶
func (*Queries) GetSessionStateByProjectID ¶
func (*Queries) GetSigningKeyByIdentifier ¶
func (*Queries) GetSigningKeyByProjectID ¶
func (*Queries) GetUserByID ¶
func (*Queries) GetUserBySubject ¶
func (*Queries) GetUserProjects ¶
func (*Queries) GetUserRoles ¶
func (*Queries) GlobalListProviders ¶
func (*Queries) ListAllRepositories ¶
func (*Queries) ListArtifactVersionsByArtifactID ¶
func (q *Queries) ListArtifactVersionsByArtifactID(ctx context.Context, arg ListArtifactVersionsByArtifactIDParams) ([]ArtifactVersion, error)
func (*Queries) ListArtifactVersionsByArtifactIDAndTag ¶
func (q *Queries) ListArtifactVersionsByArtifactIDAndTag(ctx context.Context, arg ListArtifactVersionsByArtifactIDAndTagParams) ([]ArtifactVersion, error)
func (*Queries) ListArtifactsByRepoID ¶
func (*Queries) ListFlushCache ¶ added in v0.0.17
func (q *Queries) ListFlushCache(ctx context.Context) ([]FlushCache, error)
func (*Queries) ListOrganizations ¶
func (*Queries) ListProfilesByProjectID ¶
func (*Queries) ListProfilesInstantiatingRuleType ¶
func (q *Queries) ListProfilesInstantiatingRuleType(ctx context.Context, ruleTypeID uuid.UUID) ([]ListProfilesInstantiatingRuleTypeRow, error)
get profile information that instantiate a rule. This is done by joining the profiles with entity_profiles, then correlating those with entity_profile_rules. The rule_type_id is used to filter the results. Note that we only really care about the overal profile, so we only return the profile information. We also should group the profiles so that we don't get duplicates.
func (*Queries) ListProvidersByProjectID ¶
func (*Queries) ListRegisteredRepositoriesByProjectIDAndProvider ¶
func (q *Queries) ListRegisteredRepositoriesByProjectIDAndProvider(ctx context.Context, arg ListRegisteredRepositoriesByProjectIDAndProviderParams) ([]Repository, error)
func (*Queries) ListRepositoriesByOwner ¶
func (q *Queries) ListRepositoriesByOwner(ctx context.Context, arg ListRepositoriesByOwnerParams) ([]Repository, error)
func (*Queries) ListRepositoriesByProjectID ¶
func (q *Queries) ListRepositoriesByProjectID(ctx context.Context, arg ListRepositoriesByProjectIDParams) ([]Repository, error)
func (*Queries) ListRolesByProjectID ¶
func (*Queries) ListRuleEvaluationsByProfileId ¶
func (q *Queries) ListRuleEvaluationsByProfileId(ctx context.Context, arg ListRuleEvaluationsByProfileIdParams) ([]ListRuleEvaluationsByProfileIdRow, error)
func (*Queries) ListRuleTypesByProviderAndProject ¶
func (*Queries) ListUsersByOrganization ¶
func (*Queries) ListUsersByProject ¶
func (*Queries) ListUsersByRoleId ¶
func (*Queries) LockIfThresholdNotExceeded ¶ added in v0.0.17
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) ReleaseLock ¶ added in v0.0.17
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) UpdateAccessToken ¶
func (q *Queries) UpdateAccessToken(ctx context.Context, arg UpdateAccessTokenParams) (ProviderAccessToken, error)
func (*Queries) UpdateLease ¶ added in v0.0.17
func (q *Queries) UpdateLease(ctx context.Context, arg UpdateLeaseParams) error
func (*Queries) UpdateOrganization ¶
func (*Queries) UpdateProfile ¶ added in v0.0.16
func (*Queries) UpdateRepository ¶
func (q *Queries) UpdateRepository(ctx context.Context, arg UpdateRepositoryParams) (Repository, error)
set clone_url if the value is not an empty string
func (*Queries) UpdateRepositoryByID ¶
func (q *Queries) UpdateRepositoryByID(ctx context.Context, arg UpdateRepositoryByIDParams) (Repository, error)
func (*Queries) UpdateRole ¶
func (*Queries) UpdateRuleType ¶
func (q *Queries) UpdateRuleType(ctx context.Context, arg UpdateRuleTypeParams) error
func (*Queries) UpsertArtifact ¶
func (*Queries) UpsertArtifactVersion ¶
func (q *Queries) UpsertArtifactVersion(ctx context.Context, arg UpsertArtifactVersionParams) (ArtifactVersion, error)
func (*Queries) UpsertProfileForEntity ¶ added in v0.0.16
func (q *Queries) UpsertProfileForEntity(ctx context.Context, arg UpsertProfileForEntityParams) (EntityProfile, error)
func (*Queries) UpsertPullRequest ¶
func (q *Queries) UpsertPullRequest(ctx context.Context, arg UpsertPullRequestParams) (PullRequest, error)
func (*Queries) UpsertRuleDetailsAlert ¶
func (*Queries) UpsertRuleDetailsEval ¶
func (*Queries) UpsertRuleDetailsRemediate ¶
func (*Queries) UpsertRuleEvaluations ¶
func (*Queries) UpsertRuleInstantiation ¶
func (q *Queries) UpsertRuleInstantiation(ctx context.Context, arg UpsertRuleInstantiationParams) (EntityProfileRule, error)
type ReleaseLockParams ¶ added in v0.0.17
type RemediationStatusTypes ¶
type RemediationStatusTypes string
const ( RemediationStatusTypesSuccess RemediationStatusTypes = "success" RemediationStatusTypesFailure RemediationStatusTypes = "failure" RemediationStatusTypesError RemediationStatusTypes = "error" RemediationStatusTypesSkipped RemediationStatusTypes = "skipped" RemediationStatusTypesNotAvailable RemediationStatusTypes = "not_available" )
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 int32 `json:"repo_id"` IsPrivate bool `json:"is_private"` IsFork bool `json:"is_fork"` WebhookID sql.NullInt32 `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"` }
type RuleDetailsAlert ¶
type RuleDetailsAlert struct { ID uuid.UUID `json:"id"` RuleEvalID uuid.UUID `json:"rule_eval_id"` Status AlertStatusTypes `json:"status"` Details string `json:"details"` Metadata json.RawMessage `json:"metadata"` LastUpdated time.Time `json:"last_updated"` }
type RuleDetailsEval ¶
type RuleDetailsRemediate ¶
type RuleEvaluation ¶
type RuleEvaluation struct { ID uuid.UUID `json:"id"` Entity Entities `json:"entity"` ProfileID uuid.UUID `json:"profile_id"` RuleTypeID uuid.UUID `json:"rule_type_id"` RepositoryID uuid.NullUUID `json:"repository_id"` ArtifactID uuid.NullUUID `json:"artifact_id"` PullRequestID uuid.NullUUID `json:"pull_request_id"` }
type RuleType ¶
type RuleType struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Provider string `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"` }
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
type SessionStore ¶
type SigningKey ¶
type SigningKey struct { ID int32 `json:"id"` ProjectID uuid.UUID `json:"project_id"` PrivateKey string `json:"private_key"` PublicKey string `json:"public_key"` Passphrase string `json:"passphrase"` KeyIdentifier string `json:"key_identifier"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
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 }
Store provides all functions to execute db queries and transactions
type UpdateAccessTokenParams ¶
type UpdateLeaseParams ¶ added in v0.0.17
type UpdateOrganizationParams ¶
type UpdateOrganizationParams struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Metadata json.RawMessage `json:"metadata"` }
type UpdateProfileParams ¶ added in v0.0.16
type UpdateProfileParams struct { ID uuid.UUID `json:"id"` Remediate NullActionType `json:"remediate"` Alert NullActionType `json:"alert"` }
type UpdateRepositoryByIDParams ¶
type UpdateRepositoryByIDParams struct { RepoID int32 `json:"repo_id"` ProjectID uuid.UUID `json:"project_id"` RepoOwner string `json:"repo_owner"` RepoName string `json:"repo_name"` IsPrivate bool `json:"is_private"` IsFork bool `json:"is_fork"` WebhookID sql.NullInt32 `json:"webhook_id"` WebhookUrl string `json:"webhook_url"` DeployUrl string `json:"deploy_url"` Provider string `json:"provider"` CloneUrl string `json:"clone_url"` DefaultBranch sql.NullString `json:"default_branch"` }
type UpdateRepositoryParams ¶
type UpdateRepositoryParams struct { ID uuid.UUID `json:"id"` ProjectID uuid.UUID `json:"project_id"` RepoOwner string `json:"repo_owner"` RepoName string `json:"repo_name"` RepoID int32 `json:"repo_id"` IsPrivate bool `json:"is_private"` IsFork bool `json:"is_fork"` WebhookID sql.NullInt32 `json:"webhook_id"` WebhookUrl string `json:"webhook_url"` DeployUrl string `json:"deploy_url"` Provider string `json:"provider"` CloneUrl string `json:"clone_url"` DefaultBranch sql.NullString `json:"default_branch"` }
type UpdateRoleParams ¶
type UpdateRuleTypeParams ¶
type UpdateRuleTypeParams struct { ID uuid.UUID `json:"id"` Description string `json:"description"` Definition json.RawMessage `json:"definition"` }
type UpsertArtifactParams ¶
type UpsertArtifactVersionParams ¶
type UpsertArtifactVersionParams struct { ArtifactID uuid.UUID `json:"artifact_id"` Version int64 `json:"version"` Tags sql.NullString `json:"tags"` Sha string `json:"sha"` CreatedAt time.Time `json:"created_at"` SignatureVerification json.RawMessage `json:"signature_verification"` GithubWorkflow json.RawMessage `json:"github_workflow"` }
type UpsertProfileForEntityParams ¶ added in v0.0.16
type UpsertProfileForEntityParams struct { Entity Entities `json:"entity"` ProfileID uuid.UUID `json:"profile_id"` ContextualRules json.RawMessage `json:"contextual_rules"` }
type UpsertPullRequestParams ¶
type UpsertRuleDetailsAlertParams ¶
type UpsertRuleDetailsAlertParams struct { RuleEvalID uuid.UUID `json:"rule_eval_id"` Status AlertStatusTypes `json:"status"` Details string `json:"details"` Metadata json.RawMessage `json:"metadata"` }
type UpsertRuleDetailsEvalParams ¶
type UpsertRuleDetailsEvalParams struct { RuleEvalID uuid.UUID `json:"rule_eval_id"` Status EvalStatusTypes `json:"status"` Details string `json:"details"` }
type UpsertRuleDetailsRemediateParams ¶
type UpsertRuleDetailsRemediateParams struct { RuleEvalID uuid.UUID `json:"rule_eval_id"` Status RemediationStatusTypes `json:"status"` Details string `json:"details"` }
type UpsertRuleEvaluationsParams ¶
type UpsertRuleEvaluationsParams struct { ProfileID uuid.UUID `json:"profile_id"` RepositoryID uuid.NullUUID `json:"repository_id"` ArtifactID uuid.NullUUID `json:"artifact_id"` PullRequestID uuid.NullUUID `json:"pull_request_id"` RuleTypeID uuid.UUID `json:"rule_type_id"` Entity Entities `json:"entity"` }
type UserProject ¶
Source Files
¶
- artifact_versions.sql.go
- artifacts.sql.go
- db.go
- entitlements.sql.go
- entity_execution_lock.sql.go
- errors.go
- models.go
- organizations.sql.go
- profile_status.sql.go
- profiles.sql.go
- projects.sql.go
- projects_helpers.go
- provider_access_tokens.sql.go
- providers.sql.go
- pull_requests.sql.go
- querier.go
- repositories.sql.go
- roles.sql.go
- rule_types.sql.go
- session_store.sql.go
- signing_keys.sql.go
- store.go
- user_projects.sql.go
- user_roles.sql.go
- users.sql.go