db

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateProjectHierarchyOffset added in v0.0.5

func CalculateProjectHierarchyOffset(hierarchy int) int

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.

Types

type AddUserProjectParams added in v0.0.5

type AddUserProjectParams struct {
	UserID    int32     `json:"user_id"`
	ProjectID uuid.UUID `json:"project_id"`
}

type AddUserRoleParams

type AddUserRoleParams struct {
	UserID int32 `json:"user_id"`
	RoleID int32 `json:"role_id"`
}

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 CreateAccessTokenParams struct {
	ProjectID      uuid.UUID      `json:"project_id"`
	Provider       string         `json:"provider"`
	EncryptedToken string         `json:"encrypted_token"`
	ExpirationTime time.Time      `json:"expiration_time"`
	OwnerFilter    sql.NullString `json:"owner_filter"`
}

type CreateArtifactParams

type CreateArtifactParams struct {
	RepositoryID       uuid.UUID `json:"repository_id"`
	ArtifactName       string    `json:"artifact_name"`
	ArtifactType       string    `json:"artifact_type"`
	ArtifactVisibility string    `json:"artifact_visibility"`
}

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 added in v0.0.6

type CreateProfileForEntityParams struct {
	Entity          Entities        `json:"entity"`
	ProfileID       uuid.UUID       `json:"profile_id"`
	ContextualRules json.RawMessage `json:"contextual_rules"`
}

type CreateProfileParams added in v0.0.6

type CreateProfileParams struct {
	Provider  string            `json:"provider"`
	ProjectID uuid.UUID         `json:"project_id"`
	Remediate NullRemediateType `json:"remediate"`
	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 added in v0.0.4

type CreateProviderParams struct {
	Name       string          `json:"name"`
	ProjectID  uuid.UUID       `json:"project_id"`
	Implements []ProviderType  `json:"implements"`
	Definition json.RawMessage `json:"definition"`
}

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"`
}

type CreateRoleParams

type CreateRoleParams struct {
	OrganizationID uuid.UUID     `json:"organization_id"`
	ProjectID      uuid.NullUUID `json:"project_id"`
	Name           string        `json:"name"`
	IsAdmin        bool          `json:"is_admin"`
	IsProtected    bool          `json:"is_protected"`
}

type CreateRuleEvaluationStatusForRepositoryParams

type CreateRuleEvaluationStatusForRepositoryParams struct {
	ProfileID    uuid.UUID       `json:"profile_id"`
	RepositoryID uuid.NullUUID   `json:"repository_id"`
	RuleTypeID   uuid.UUID       `json:"rule_type_id"`
	EvalStatus   EvalStatusTypes `json:"eval_status"`
	EvalDetails  string          `json:"eval_details"`
}

type CreateRuleTypeParams

type CreateRuleTypeParams struct {
	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"`
}

type CreateSessionStateParams

type CreateSessionStateParams struct {
	Provider     string         `json:"provider"`
	ProjectID    uuid.UUID      `json:"project_id"`
	Port         sql.NullInt32  `json:"port"`
	SessionState string         `json:"session_state"`
	OwnerFilter  sql.NullString `json:"owner_filter"`
}

type CreateSigningKeyParams

type CreateSigningKeyParams struct {
	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"`
}

type CreateUserParams

type CreateUserParams struct {
	OrganizationID  uuid.UUID      `json:"organization_id"`
	Email           sql.NullString `json:"email"`
	IdentitySubject string         `json:"identity_subject"`
	FirstName       sql.NullString `json:"first_name"`
	LastName        sql.NullString `json:"last_name"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteAccessTokenParams

type DeleteAccessTokenParams struct {
	Provider  string    `json:"provider"`
	ProjectID uuid.UUID `json:"project_id"`
}

type DeleteOldArtifactVersionsParams

type DeleteOldArtifactVersionsParams struct {
	ArtifactID uuid.UUID `json:"artifact_id"`
	CreatedAt  time.Time `json:"created_at"`
}

type DeleteProjectRow

type DeleteProjectRow struct {
	ID        uuid.UUID       `json:"id"`
	Name      string          `json:"name"`
	Metadata  json.RawMessage `json:"metadata"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
	ParentID  uuid.NullUUID   `json:"parent_id"`
}

type DeleteProviderParams added in v0.0.4

type DeleteProviderParams struct {
	ID        uuid.UUID `json:"id"`
	ProjectID uuid.UUID `json:"project_id"`
}

type DeleteSessionStateByProjectIDParams added in v0.0.5

type DeleteSessionStateByProjectIDParams struct {
	Provider  string    `json:"provider"`
	ProjectID uuid.UUID `json:"project_id"`
}

type DeleteSigningKeyParams

type DeleteSigningKeyParams struct {
	ProjectID     uuid.UUID `json:"project_id"`
	KeyIdentifier string    `json:"key_identifier"`
}

type Entities

type Entities string
const (
	EntitiesRepository       Entities = "repository"
	EntitiesBuildEnvironment Entities = "build_environment"
	EntitiesArtifact         Entities = "artifact"
	EntitiesPullRequest      Entities = "pull_request"
)

func (*Entities) Scan

func (e *Entities) Scan(src interface{}) error

type EntityProfile added in v0.0.6

type EntityProfile struct {
	ID              uuid.UUID       `json:"id"`
	Entity          Entities        `json:"entity"`
	ProfileID       uuid.UUID       `json:"profile_id"`
	ContextualRules json.RawMessage `json:"contextual_rules"`
	CreatedAt       time.Time       `json:"created_at"`
	UpdatedAt       time.Time       `json:"updated_at"`
}

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 GetAccessTokenByProjectIDParams added in v0.0.5

type GetAccessTokenByProjectIDParams struct {
	Provider  string    `json:"provider"`
	ProjectID uuid.UUID `json:"project_id"`
}

type GetAccessTokenSinceDateParams

type GetAccessTokenSinceDateParams struct {
	Provider  string    `json:"provider"`
	ProjectID uuid.UUID `json:"project_id"`
	CreatedAt time.Time `json:"created_at"`
}

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 GetChildrenProjectsRow added in v0.0.5

type GetChildrenProjectsRow struct {
	ID        uuid.UUID       `json:"id"`
	Name      string          `json:"name"`
	Metadata  json.RawMessage `json:"metadata"`
	ParentID  uuid.NullUUID   `json:"parent_id"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

type GetParentProjectsUntilParams

type GetParentProjectsUntilParams struct {
	ID   uuid.UUID `json:"id"`
	ID_2 uuid.UUID `json:"id_2"`
}

type GetProfileByProjectAndIDParams added in v0.0.6

type GetProfileByProjectAndIDParams struct {
	ProjectID uuid.UUID `json:"project_id"`
	ID        uuid.UUID `json:"id"`
}

type GetProfileByProjectAndIDRow added in v0.0.6

type GetProfileByProjectAndIDRow struct {
	ID              uuid.UUID         `json:"id"`
	Name            string            `json:"name"`
	Provider        string            `json:"provider"`
	ProjectID       uuid.UUID         `json:"project_id"`
	Remediate       NullRemediateType `json:"remediate"`
	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 GetProfileByProjectAndNameParams added in v0.0.6

type GetProfileByProjectAndNameParams struct {
	ProjectID uuid.UUID `json:"project_id"`
	Name      string    `json:"name"`
}

type GetProfileByProjectAndNameRow added in v0.0.6

type GetProfileByProjectAndNameRow struct {
	ID              uuid.UUID         `json:"id"`
	Name            string            `json:"name"`
	Provider        string            `json:"provider"`
	ProjectID       uuid.UUID         `json:"project_id"`
	Remediate       NullRemediateType `json:"remediate"`
	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 GetProfileStatusByIdAndProjectParams added in v0.0.6

type GetProfileStatusByIdAndProjectParams struct {
	ID        uuid.UUID `json:"id"`
	ProjectID uuid.UUID `json:"project_id"`
}

type GetProfileStatusByIdAndProjectRow added in v0.0.6

type GetProfileStatusByIdAndProjectRow struct {
	ID            uuid.UUID       `json:"id"`
	Name          string          `json:"name"`
	ProfileStatus EvalStatusTypes `json:"profile_status"`
	LastUpdated   time.Time       `json:"last_updated"`
}

type GetProfileStatusByNameAndProjectParams added in v0.0.6

type GetProfileStatusByNameAndProjectParams struct {
	Name      string    `json:"name"`
	ProjectID uuid.UUID `json:"project_id"`
}

type GetProfileStatusByNameAndProjectRow added in v0.0.6

type GetProfileStatusByNameAndProjectRow struct {
	ID            uuid.UUID       `json:"id"`
	Name          string          `json:"name"`
	ProfileStatus EvalStatusTypes `json:"profile_status"`
	LastUpdated   time.Time       `json:"last_updated"`
}

type GetProfileStatusByProjectRow added in v0.0.6

type GetProfileStatusByProjectRow struct {
	ID            uuid.UUID       `json:"id"`
	Name          string          `json:"name"`
	ProfileStatus EvalStatusTypes `json:"profile_status"`
	LastUpdated   time.Time       `json:"last_updated"`
}

type GetProjectIDPortBySessionStateRow added in v0.0.5

type GetProjectIDPortBySessionStateRow struct {
	Provider    string         `json:"provider"`
	ProjectID   uuid.UUID      `json:"project_id"`
	Port        sql.NullInt32  `json:"port"`
	OwnerFilter sql.NullString `json:"owner_filter"`
}

type GetProviderByIDParams added in v0.0.4

type GetProviderByIDParams struct {
	ID        uuid.UUID `json:"id"`
	ProjectID uuid.UUID `json:"project_id"`
}

type GetProviderByNameParams added in v0.0.4

type GetProviderByNameParams struct {
	Name      string    `json:"name"`
	ProjectID uuid.UUID `json:"project_id"`
}

type GetRepositoryByIDAndProjectParams added in v0.0.5

type GetRepositoryByIDAndProjectParams struct {
	Provider  string    `json:"provider"`
	RepoID    int32     `json:"repo_id"`
	ProjectID uuid.UUID `json:"project_id"`
}

type GetRepositoryByRepoNameParams

type GetRepositoryByRepoNameParams struct {
	Provider  string `json:"provider"`
	RepoOwner string `json:"repo_owner"`
	RepoName  string `json:"repo_name"`
}

type GetRoleByNameParams

type GetRoleByNameParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Name           string    `json:"name"`
}

type GetRuleTypeByNameParams

type GetRuleTypeByNameParams struct {
	Provider  string    `json:"provider"`
	ProjectID uuid.UUID `json:"project_id"`
	Name      string    `json:"name"`
}

type GetUserProjectsRow added in v0.0.5

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"`
	IsProtected    bool          `json:"is_protected"`
	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 ListArtifactVersionsByArtifactIDAndTagParams

type ListArtifactVersionsByArtifactIDAndTagParams struct {
	ArtifactID uuid.UUID      `json:"artifact_id"`
	Tags       sql.NullString `json:"tags"`
	Limit      sql.NullInt32  `json:"limit"`
}

type ListArtifactVersionsByArtifactIDParams

type ListArtifactVersionsByArtifactIDParams struct {
	ArtifactID uuid.UUID     `json:"artifact_id"`
	Limit      sql.NullInt32 `json:"limit"`
}

type ListOrganizationsParams

type ListOrganizationsParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListProfilesByProjectIDRow added in v0.0.6

type ListProfilesByProjectIDRow struct {
	ID              uuid.UUID         `json:"id"`
	Name            string            `json:"name"`
	Provider        string            `json:"provider"`
	ProjectID       uuid.UUID         `json:"project_id"`
	Remediate       NullRemediateType `json:"remediate"`
	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 ListRegisteredRepositoriesByProjectIDAndProviderParams added in v0.0.5

type ListRegisteredRepositoriesByProjectIDAndProviderParams struct {
	Provider  string    `json:"provider"`
	ProjectID uuid.UUID `json:"project_id"`
}

type ListRepositoriesByOwnerParams

type ListRepositoriesByOwnerParams struct {
	Provider  string `json:"provider"`
	RepoOwner string `json:"repo_owner"`
	Limit     int32  `json:"limit"`
	Offset    int32  `json:"offset"`
}

type ListRepositoriesByProjectIDParams added in v0.0.5

type ListRepositoriesByProjectIDParams struct {
	Provider  string    `json:"provider"`
	ProjectID uuid.UUID `json:"project_id"`
	Limit     int32     `json:"limit"`
	Offset    int32     `json:"offset"`
}

type ListRolesByProjectIDParams added in v0.0.5

type ListRolesByProjectIDParams struct {
	ProjectID uuid.NullUUID `json:"project_id"`
	Limit     int32         `json:"limit"`
	Offset    int32         `json:"offset"`
}

type ListRolesParams

type ListRolesParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Limit          int32     `json:"limit"`
	Offset         int32     `json:"offset"`
}

type ListRuleEvaluationStatusByProfileIdParams added in v0.0.6

type ListRuleEvaluationStatusByProfileIdParams 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 ListRuleEvaluationStatusByProfileIdRow added in v0.0.6

type ListRuleEvaluationStatusByProfileIdRow 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"`
	RemLastUpdated  sql.NullTime           `json:"rem_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 ListRuleTypesByProviderAndProjectParams added in v0.0.5

type ListRuleTypesByProviderAndProjectParams struct {
	Provider  string    `json:"provider"`
	ProjectID uuid.UUID `json:"project_id"`
}

type ListUsersByOrganizationParams

type ListUsersByOrganizationParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Limit          int32     `json:"limit"`
	Offset         int32     `json:"offset"`
}

type ListUsersByProjectParams added in v0.0.5

type ListUsersByProjectParams struct {
	ProjectID uuid.UUID `json:"project_id"`
	Limit     int32     `json:"limit"`
	Offset    int32     `json:"offset"`
}

type ListUsersParams

type ListUsersParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

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.

func (NullEntities) Value

func (ns NullEntities) Value() (driver.Value, error)

Value implements the driver Valuer 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.

func (NullEvalStatusTypes) Value

func (ns NullEvalStatusTypes) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullProviderType added in v0.0.4

type NullProviderType struct {
	ProviderType ProviderType `json:"provider_type"`
	Valid        bool         `json:"valid"` // Valid is true if ProviderType is not NULL
}

func (*NullProviderType) Scan added in v0.0.4

func (ns *NullProviderType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullProviderType) Value added in v0.0.4

func (ns NullProviderType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRemediateType added in v0.0.5

type NullRemediateType struct {
	RemediateType RemediateType `json:"remediate_type"`
	Valid         bool          `json:"valid"` // Valid is true if RemediateType is not NULL
}

func (*NullRemediateType) Scan added in v0.0.5

func (ns *NullRemediateType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRemediateType) Value added in v0.0.5

func (ns NullRemediateType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRemediationStatusTypes added in v0.0.5

type NullRemediationStatusTypes struct {
	RemediationStatusTypes RemediationStatusTypes `json:"remediation_status_types"`
	Valid                  bool                   `json:"valid"` // Valid is true if RemediationStatusTypes is not NULL
}

func (*NullRemediationStatusTypes) Scan added in v0.0.5

func (ns *NullRemediationStatusTypes) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRemediationStatusTypes) Value added in v0.0.5

Value implements the driver Valuer interface.

type Profile added in v0.0.6

type Profile struct {
	ID        uuid.UUID         `json:"id"`
	Name      string            `json:"name"`
	Provider  string            `json:"provider"`
	ProjectID uuid.UUID         `json:"project_id"`
	Remediate NullRemediateType `json:"remediate"`
	CreatedAt time.Time         `json:"created_at"`
	UpdatedAt time.Time         `json:"updated_at"`
}

type ProfileStatus added in v0.0.6

type ProfileStatus struct {
	ID            uuid.UUID       `json:"id"`
	ProfileID     uuid.UUID       `json:"profile_id"`
	ProfileStatus EvalStatusTypes `json:"profile_status"`
	LastUpdated   time.Time       `json:"last_updated"`
}

type Project

type Project 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"`
}

type Provider added in v0.0.4

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 added in v0.0.4

type ProviderType string
const (
	ProviderTypeGithub ProviderType = "github"
	ProviderTypeRest   ProviderType = "rest"
	ProviderTypeGit    ProviderType = "git"
	ProviderTypeOci    ProviderType = "oci"
)

func (*ProviderType) Scan added in v0.0.4

func (e *ProviderType) Scan(src interface{}) error

type Querier

type Querier interface {
	AddUserProject(ctx context.Context, arg AddUserProjectParams) (UserProject, error)
	AddUserRole(ctx context.Context, arg AddUserRoleParams) (UserRole, 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)
	CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error)
	CreateRole(ctx context.Context, arg CreateRoleParams) (Role, error)
	CreateRuleEvaluationStatusForRepository(ctx context.Context, arg CreateRuleEvaluationStatusForRepositoryParams) 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
	DeleteProject(ctx context.Context, id uuid.UUID) ([]DeleteProjectRow, error)
	DeleteProvider(ctx context.Context, arg DeleteProviderParams) error
	DeleteRepository(ctx context.Context, id uuid.UUID) error
	DeleteRole(ctx context.Context, id int32) 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
	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)
	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)
	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)
	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)
	GetProjectIDPortBySessionState(ctx context.Context, sessionState string) (GetProjectIDPortBySessionStateRow, error)
	GetProviderByID(ctx context.Context, arg GetProviderByIDParams) (Provider, error)
	GetProviderByName(ctx context.Context, arg GetProviderByNameParams) (Provider, 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)
	ListOrganizations(ctx context.Context, arg ListOrganizationsParams) ([]Project, error)
	ListProfilesByProjectID(ctx context.Context, projectID uuid.UUID) ([]ListProfilesByProjectIDRow, 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)
	ListRuleEvaluationStatusByProfileId(ctx context.Context, arg ListRuleEvaluationStatusByProfileIdParams) ([]ListRuleEvaluationStatusByProfileIdRow, 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)
	UpdateAccessToken(ctx context.Context, arg UpdateAccessTokenParams) (ProviderAccessToken, error)
	UpdateOrganization(ctx context.Context, arg UpdateOrganizationParams) (Project, 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)
	UpdateRuleEvaluationStatusForRepository(ctx context.Context, arg UpdateRuleEvaluationStatusForRepositoryParams) error
	UpdateRuleType(ctx context.Context, arg UpdateRuleTypeParams) error
	UpsertArtifact(ctx context.Context, arg UpsertArtifactParams) (Artifact, error)
	UpsertArtifactVersion(ctx context.Context, arg UpsertArtifactVersionParams) (ArtifactVersion, error)
	UpsertRuleEvaluationStatus(ctx context.Context, arg UpsertRuleEvaluationStatusParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddUserProject added in v0.0.5

func (q *Queries) AddUserProject(ctx context.Context, arg AddUserProjectParams) (UserProject, error)

func (*Queries) AddUserRole

func (q *Queries) AddUserRole(ctx context.Context, arg AddUserRoleParams) (UserRole, error)

func (*Queries) CreateAccessToken

func (q *Queries) CreateAccessToken(ctx context.Context, arg CreateAccessTokenParams) (ProviderAccessToken, error)

func (*Queries) CreateArtifact

func (q *Queries) CreateArtifact(ctx context.Context, arg CreateArtifactParams) (Artifact, error)

func (*Queries) CreateArtifactVersion

func (q *Queries) CreateArtifactVersion(ctx context.Context, arg CreateArtifactVersionParams) (ArtifactVersion, error)

func (*Queries) CreateOrganization

func (q *Queries) CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Project, error)

func (*Queries) CreateProfile added in v0.0.6

func (q *Queries) CreateProfile(ctx context.Context, arg CreateProfileParams) (Profile, error)

func (*Queries) CreateProfileForEntity added in v0.0.6

func (q *Queries) CreateProfileForEntity(ctx context.Context, arg CreateProfileForEntityParams) (EntityProfile, error)

func (*Queries) CreateProject

func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error)

func (*Queries) CreateProvider added in v0.0.4

func (q *Queries) CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error)

func (*Queries) CreateRepository

func (q *Queries) CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error)

func (*Queries) CreateRole

func (q *Queries) CreateRole(ctx context.Context, arg CreateRoleParams) (Role, error)

func (*Queries) CreateRuleEvaluationStatusForRepository

func (q *Queries) CreateRuleEvaluationStatusForRepository(ctx context.Context, arg CreateRuleEvaluationStatusForRepositoryParams) error

func (*Queries) CreateRuleType

func (q *Queries) CreateRuleType(ctx context.Context, arg CreateRuleTypeParams) (RuleType, error)

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 (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteAccessToken

func (q *Queries) DeleteAccessToken(ctx context.Context, arg DeleteAccessTokenParams) error

func (*Queries) DeleteArtifact

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

func (*Queries) DeleteArtifactVersion

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

func (*Queries) DeleteExpiredSessionStates

func (q *Queries) DeleteExpiredSessionStates(ctx context.Context) error

func (*Queries) DeleteOldArtifactVersions

func (q *Queries) DeleteOldArtifactVersions(ctx context.Context, arg DeleteOldArtifactVersionsParams) error

func (*Queries) DeleteOrganization

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

func (*Queries) DeleteProfile added in v0.0.6

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

func (*Queries) DeleteProject

func (q *Queries) DeleteProject(ctx context.Context, id uuid.UUID) ([]DeleteProjectRow, error)

func (*Queries) DeleteProvider added in v0.0.4

func (q *Queries) DeleteProvider(ctx context.Context, arg DeleteProviderParams) error

func (*Queries) DeleteRepository

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

func (*Queries) DeleteRole

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

func (*Queries) DeleteRuleType

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

func (*Queries) DeleteSessionState

func (q *Queries) DeleteSessionState(ctx context.Context, id int32) error

func (*Queries) DeleteSessionStateByProjectID added in v0.0.5

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) DeleteUser

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

func (*Queries) GetAccessTokenByProjectID added in v0.0.5

func (q *Queries) GetAccessTokenByProjectID(ctx context.Context, arg GetAccessTokenByProjectIDParams) (ProviderAccessToken, error)

func (*Queries) GetAccessTokenByProvider

func (q *Queries) GetAccessTokenByProvider(ctx context.Context, provider string) ([]ProviderAccessToken, error)

func (*Queries) GetAccessTokenSinceDate

func (q *Queries) GetAccessTokenSinceDate(ctx context.Context, arg GetAccessTokenSinceDateParams) (ProviderAccessToken, error)

func (*Queries) GetArtifactByID

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

func (*Queries) GetArtifactVersionByID

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

func (*Queries) GetArtifactVersionBySha

func (q *Queries) GetArtifactVersionBySha(ctx context.Context, sha string) (ArtifactVersion, error)

func (*Queries) GetChildrenProjects

func (q *Queries) GetChildrenProjects(ctx context.Context, id uuid.UUID) ([]GetChildrenProjectsRow, error)

func (*Queries) GetOrganization

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

func (*Queries) GetOrganizationByName

func (q *Queries) GetOrganizationByName(ctx context.Context, name string) (Project, error)

func (*Queries) GetOrganizationForUpdate

func (q *Queries) GetOrganizationForUpdate(ctx context.Context, name string) (Project, error)

func (*Queries) GetParentProjects

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

func (*Queries) GetParentProjectsUntil

func (q *Queries) GetParentProjectsUntil(ctx context.Context, arg GetParentProjectsUntilParams) ([]uuid.UUID, error)

func (*Queries) GetProfileByID added in v0.0.6

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

func (*Queries) GetProfileByProjectAndID added in v0.0.6

func (q *Queries) GetProfileByProjectAndID(ctx context.Context, arg GetProfileByProjectAndIDParams) ([]GetProfileByProjectAndIDRow, error)

func (*Queries) GetProfileByProjectAndName added in v0.0.6

func (q *Queries) GetProfileByProjectAndName(ctx context.Context, arg GetProfileByProjectAndNameParams) ([]GetProfileByProjectAndNameRow, error)

func (*Queries) GetProfileStatusByIdAndProject added in v0.0.6

func (*Queries) GetProfileStatusByNameAndProject added in v0.0.6

func (*Queries) GetProfileStatusByProject added in v0.0.6

func (q *Queries) GetProfileStatusByProject(ctx context.Context, projectID uuid.UUID) ([]GetProfileStatusByProjectRow, error)

func (*Queries) GetProjectByID

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

func (*Queries) GetProjectByName added in v0.0.5

func (q *Queries) GetProjectByName(ctx context.Context, name string) (Project, error)

func (*Queries) GetProjectIDPortBySessionState added in v0.0.5

func (q *Queries) GetProjectIDPortBySessionState(ctx context.Context, sessionState string) (GetProjectIDPortBySessionStateRow, error)

func (*Queries) GetProviderByID added in v0.0.4

func (q *Queries) GetProviderByID(ctx context.Context, arg GetProviderByIDParams) (Provider, error)

func (*Queries) GetProviderByName added in v0.0.4

func (q *Queries) GetProviderByName(ctx context.Context, arg GetProviderByNameParams) (Provider, error)

func (*Queries) GetRepositoryByID

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

func (*Queries) GetRepositoryByIDAndProject added in v0.0.5

func (q *Queries) GetRepositoryByIDAndProject(ctx context.Context, arg GetRepositoryByIDAndProjectParams) (Repository, error)

func (*Queries) GetRepositoryByRepoID

func (q *Queries) GetRepositoryByRepoID(ctx context.Context, repoID int32) (Repository, error)

func (*Queries) GetRepositoryByRepoName

func (q *Queries) GetRepositoryByRepoName(ctx context.Context, arg GetRepositoryByRepoNameParams) (Repository, error)

func (*Queries) GetRoleByID

func (q *Queries) GetRoleByID(ctx context.Context, id int32) (Role, error)

func (*Queries) GetRoleByName

func (q *Queries) GetRoleByName(ctx context.Context, arg GetRoleByNameParams) (Role, error)

func (*Queries) GetRootProjects

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

func (*Queries) GetRuleTypeByID

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

func (*Queries) GetRuleTypeByName

func (q *Queries) GetRuleTypeByName(ctx context.Context, arg GetRuleTypeByNameParams) (RuleType, error)

func (*Queries) GetSessionState

func (q *Queries) GetSessionState(ctx context.Context, id int32) (SessionStore, error)

func (*Queries) GetSessionStateByProjectID added in v0.0.5

func (q *Queries) GetSessionStateByProjectID(ctx context.Context, projectID uuid.UUID) (SessionStore, error)

func (*Queries) GetSigningKeyByIdentifier

func (q *Queries) GetSigningKeyByIdentifier(ctx context.Context, keyIdentifier string) (SigningKey, error)

func (*Queries) GetSigningKeyByProjectID added in v0.0.5

func (q *Queries) GetSigningKeyByProjectID(ctx context.Context, projectID uuid.UUID) (SigningKey, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id int32) (User, error)

func (*Queries) GetUserBySubject added in v0.0.4

func (q *Queries) GetUserBySubject(ctx context.Context, identitySubject string) (User, error)

func (*Queries) GetUserProjects added in v0.0.5

func (q *Queries) GetUserProjects(ctx context.Context, userID int32) ([]GetUserProjectsRow, error)

func (*Queries) GetUserRoles

func (q *Queries) GetUserRoles(ctx context.Context, userID int32) ([]GetUserRolesRow, error)

func (*Queries) GlobalListProviders added in v0.0.4

func (q *Queries) GlobalListProviders(ctx context.Context) ([]Provider, error)

func (*Queries) ListAllRepositories

func (q *Queries) ListAllRepositories(ctx context.Context, provider string) ([]Repository, error)

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 (q *Queries) ListArtifactsByRepoID(ctx context.Context, repositoryID uuid.UUID) ([]Artifact, error)

func (*Queries) ListOrganizations

func (q *Queries) ListOrganizations(ctx context.Context, arg ListOrganizationsParams) ([]Project, error)

func (*Queries) ListProfilesByProjectID added in v0.0.6

func (q *Queries) ListProfilesByProjectID(ctx context.Context, projectID uuid.UUID) ([]ListProfilesByProjectIDRow, error)

func (*Queries) ListProvidersByProjectID added in v0.0.5

func (q *Queries) ListProvidersByProjectID(ctx context.Context, projectID uuid.UUID) ([]Provider, error)

func (*Queries) ListRegisteredRepositoriesByProjectIDAndProvider added in v0.0.5

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 added in v0.0.5

func (q *Queries) ListRepositoriesByProjectID(ctx context.Context, arg ListRepositoriesByProjectIDParams) ([]Repository, error)

func (*Queries) ListRoles

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

func (*Queries) ListRolesByProjectID added in v0.0.5

func (q *Queries) ListRolesByProjectID(ctx context.Context, arg ListRolesByProjectIDParams) ([]Role, error)

func (*Queries) ListRuleEvaluationStatusByProfileId added in v0.0.6

func (*Queries) ListRuleTypesByProviderAndProject added in v0.0.5

func (q *Queries) ListRuleTypesByProviderAndProject(ctx context.Context, arg ListRuleTypesByProviderAndProjectParams) ([]RuleType, error)

func (*Queries) ListUsers

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

func (*Queries) ListUsersByOrganization

func (q *Queries) ListUsersByOrganization(ctx context.Context, arg ListUsersByOrganizationParams) ([]User, error)

func (*Queries) ListUsersByProject added in v0.0.5

func (q *Queries) ListUsersByProject(ctx context.Context, arg ListUsersByProjectParams) ([]User, error)

func (*Queries) ListUsersByRoleId

func (q *Queries) ListUsersByRoleId(ctx context.Context, roleID int32) ([]int32, error)

func (*Queries) UpdateAccessToken

func (q *Queries) UpdateAccessToken(ctx context.Context, arg UpdateAccessTokenParams) (ProviderAccessToken, error)

func (*Queries) UpdateOrganization

func (q *Queries) UpdateOrganization(ctx context.Context, arg UpdateOrganizationParams) (Project, error)

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 (q *Queries) UpdateRole(ctx context.Context, arg UpdateRoleParams) (Role, error)

func (*Queries) UpdateRuleEvaluationStatusForRepository

func (q *Queries) UpdateRuleEvaluationStatusForRepository(ctx context.Context, arg UpdateRuleEvaluationStatusForRepositoryParams) error

func (*Queries) UpdateRuleType

func (q *Queries) UpdateRuleType(ctx context.Context, arg UpdateRuleTypeParams) error

func (*Queries) UpsertArtifact

func (q *Queries) UpsertArtifact(ctx context.Context, arg UpsertArtifactParams) (Artifact, error)

func (*Queries) UpsertArtifactVersion

func (q *Queries) UpsertArtifactVersion(ctx context.Context, arg UpsertArtifactVersionParams) (ArtifactVersion, error)

func (*Queries) UpsertRuleEvaluationStatus

func (q *Queries) UpsertRuleEvaluationStatus(ctx context.Context, arg UpsertRuleEvaluationStatusParams) error

func (*Queries) WithTx

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

type RemediateType added in v0.0.5

type RemediateType string
const (
	RemediateTypeOn     RemediateType = "on"
	RemediateTypeOff    RemediateType = "off"
	RemediateTypeDryRun RemediateType = "dry_run"
)

func (*RemediateType) Scan added in v0.0.5

func (e *RemediateType) Scan(src interface{}) error

type RemediationStatusTypes added in v0.0.5

type RemediationStatusTypes string
const (
	RemediationStatusTypesSuccess      RemediationStatusTypes = "success"
	RemediationStatusTypesFailure      RemediationStatusTypes = "failure"
	RemediationStatusTypesError        RemediationStatusTypes = "error"
	RemediationStatusTypesSkipped      RemediationStatusTypes = "skipped"
	RemediationStatusTypesNotAvailable RemediationStatusTypes = "not_available"
)

func (*RemediationStatusTypes) Scan added in v0.0.5

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"`
}

type Role

type Role 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"`
	IsProtected    bool          `json:"is_protected"`
	CreatedAt      time.Time     `json:"created_at"`
	UpdatedAt      time.Time     `json:"updated_at"`
}

type RuleEvaluationStatus

type RuleEvaluationStatus struct {
	ID                     uuid.UUID              `json:"id"`
	Entity                 Entities               `json:"entity"`
	ProfileID              uuid.UUID              `json:"profile_id"`
	RuleTypeID             uuid.UUID              `json:"rule_type_id"`
	EvalStatus             EvalStatusTypes        `json:"eval_status"`
	RemediationStatus      RemediationStatusTypes `json:"remediation_status"`
	RepositoryID           uuid.NullUUID          `json:"repository_id"`
	ArtifactID             uuid.NullUUID          `json:"artifact_id"`
	EvalDetails            string                 `json:"eval_details"`
	EvalLastUpdated        time.Time              `json:"eval_last_updated"`
	RemediationDetails     string                 `json:"remediation_details"`
	RemediationLastUpdated sql.NullTime           `json:"remediation_last_updated"`
}

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

func (s *SQLStore) BeginTransaction() (*sql.Tx, error)

BeginTransaction begins a new transaction

func (*SQLStore) CheckHealth

func (s *SQLStore) CheckHealth() error

CheckHealth checks the health of the database

func (*SQLStore) Commit

func (*SQLStore) Commit(tx *sql.Tx) error

Commit commits a transaction

func (*SQLStore) GetQuerierWithTransaction

func (*SQLStore) GetQuerierWithTransaction(tx *sql.Tx) Querier

GetQuerierWithTransaction returns a new Querier with the provided transaction

func (*SQLStore) Rollback

func (*SQLStore) Rollback(tx *sql.Tx) error

Rollback rolls back a transaction

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"`
}

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 {
	Querier
	CheckHealth() error
	BeginTransaction() (*sql.Tx, error)
	GetQuerierWithTransaction(tx *sql.Tx) Querier
	Commit(tx *sql.Tx) error
	Rollback(tx *sql.Tx) error
}

Store provides all functions to execute db queries and transactions

func NewStore

func NewStore(db *sql.DB) Store

NewStore creates a new store

type UpdateAccessTokenParams

type UpdateAccessTokenParams struct {
	Provider       string         `json:"provider"`
	ProjectID      uuid.UUID      `json:"project_id"`
	EncryptedToken string         `json:"encrypted_token"`
	ExpirationTime time.Time      `json:"expiration_time"`
	OwnerFilter    sql.NullString `json:"owner_filter"`
}

type UpdateOrganizationParams

type UpdateOrganizationParams struct {
	ID       uuid.UUID       `json:"id"`
	Name     string          `json:"name"`
	Metadata json.RawMessage `json:"metadata"`
}

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"`
}

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"`
}

type UpdateRoleParams

type UpdateRoleParams 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"`
	IsProtected    bool          `json:"is_protected"`
}

type UpdateRuleEvaluationStatusForRepositoryParams

type UpdateRuleEvaluationStatusForRepositoryParams struct {
	EvalStatus             EvalStatusTypes        `json:"eval_status"`
	EvalDetails            string                 `json:"eval_details"`
	RemediationStatus      RemediationStatusTypes `json:"remediation_status"`
	RemediationDetails     string                 `json:"remediation_details"`
	RemediationLastUpdated sql.NullTime           `json:"remediation_last_updated"`
}

type UpdateRuleTypeParams

type UpdateRuleTypeParams struct {
	ID          uuid.UUID       `json:"id"`
	Description string          `json:"description"`
	Definition  json.RawMessage `json:"definition"`
}

type UpsertArtifactParams

type UpsertArtifactParams struct {
	RepositoryID       uuid.UUID `json:"repository_id"`
	ArtifactName       string    `json:"artifact_name"`
	ArtifactType       string    `json:"artifact_type"`
	ArtifactVisibility string    `json:"artifact_visibility"`
}

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 UpsertRuleEvaluationStatusParams

type UpsertRuleEvaluationStatusParams struct {
	ProfileID              uuid.UUID              `json:"profile_id"`
	RepositoryID           uuid.NullUUID          `json:"repository_id"`
	ArtifactID             uuid.NullUUID          `json:"artifact_id"`
	RuleTypeID             uuid.UUID              `json:"rule_type_id"`
	Entity                 Entities               `json:"entity"`
	EvalStatus             EvalStatusTypes        `json:"eval_status"`
	EvalDetails            string                 `json:"eval_details"`
	RemediationStatus      RemediationStatusTypes `json:"remediation_status"`
	RemediationDetails     string                 `json:"remediation_details"`
	RemediationLastUpdated sql.NullTime           `json:"remediation_last_updated"`
}

type User

type User struct {
	ID              int32          `json:"id"`
	OrganizationID  uuid.UUID      `json:"organization_id"`
	Email           sql.NullString `json:"email"`
	IdentitySubject string         `json:"identity_subject"`
	FirstName       sql.NullString `json:"first_name"`
	LastName        sql.NullString `json:"last_name"`
	CreatedAt       time.Time      `json:"created_at"`
	UpdatedAt       time.Time      `json:"updated_at"`
}

type UserProject added in v0.0.5

type UserProject struct {
	ID        int32     `json:"id"`
	UserID    int32     `json:"user_id"`
	ProjectID uuid.UUID `json:"project_id"`
}

type UserRole

type UserRole struct {
	ID     int32 `json:"id"`
	UserID int32 `json:"user_id"`
	RoleID int32 `json:"role_id"`
}

Jump to

Keyboard shortcuts

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