Documentation
¶
Index ¶
- Constants
- Variables
- func BuildIssueVariantMap(db database.Database, componentInstanceID int64, componentVersionID int64) (map[int64]entity.ServiceIssueVariant, error)
- func OnComponentInstanceCreate(db database.Database, event event.Event, authz openfga.Authorization)
- func OnComponentVersionAssignmentToComponentInstance(db database.Database, componentInstanceID int64, componentVersionID int64)
- func OnIssueMatchCreateAuthz(db database.Database, e event.Event, authz openfga.Authorization)
- func OnIssueMatchDeleteAuthz(db database.Database, e event.Event, authz openfga.Authorization)
- func OnIssueMatchUpdateAuthz(db database.Database, e event.Event, authz openfga.Authorization)
- type CreateIssueMatchEvent
- type DeleteIssueMatchEvent
- type GetIssueMatchEvent
- type IssueMatchHandler
- type IssueMatchHandlerError
- type ListIssueMatchesEvent
- type UpdateIssueMatchEvent
Constants ¶
const ( ListIssueMatchesEventName event.EventName = "ListIssueMatches" GetIssueMatchEventName event.EventName = "GetIssueMatch" CreateIssueMatchEventName event.EventName = "CreateIssueMatch" UpdateIssueMatchEventName event.EventName = "UpdateIssueMatch" DeleteIssueMatchEventName event.EventName = "DeleteIssueMatch" ListIssueMatchIDsEventName event.EventName = "ListIssueMatchIDs" )
Variables ¶
Functions ¶
func BuildIssueVariantMap ¶
func BuildIssueVariantMap(db database.Database, componentInstanceID int64, componentVersionID int64) (map[int64]entity.ServiceIssueVariant, error)
BuildIssueVariantMap builds a map of issue id to issue variant for the given issues and component instance id it does take the first issue_variant with the highest priority for the respective component instance. This is archived by utilizing database.GetServiceIssueVariants that does return ALL issue variants for a given component instance id together with the priorty and afterwards identifying for each issue the variant with the highest priority
Returns a map of issue id to issue variant
func OnComponentVersionAssignmentToComponentInstance ¶
func OnComponentVersionAssignmentToComponentInstance(db database.Database, componentInstanceID int64, componentVersionID int64)
OnComponentVersionAssignmentToComponentInstance is an event handler that is triggered when a component version is assigned to a component instance. It creates for the component instance ID that is assigned to component version ID a new issue match for each issue that is related to the component version. to do so it utilizes BuildIssueVariantMap to get the issue variants for the issues to identify the severity of the issueMatch.
func OnIssueMatchCreateAuthz ¶ added in v1.47.0
OnIssueMatchCreateAuthz is a handler for the CreateIssueMatchEvent It creates an OpenFGA relation tuple for the issue match and the current user
func OnIssueMatchDeleteAuthz ¶ added in v1.47.0
OnIssueMatchDeleteAuthz is a handler for the DeleteIssueMatchEvent
func OnIssueMatchUpdateAuthz ¶ added in v1.47.0
OnIssueMatchUpdateAuthz is a handler for the UpdateIssueMatchEvent Fields that can be updated in Issue Match which affect tuple relations include: issuematch_component_instance_id
Types ¶
type CreateIssueMatchEvent ¶
type CreateIssueMatchEvent struct {
IssueMatch *entity.IssueMatch
}
func (*CreateIssueMatchEvent) Name ¶
func (e *CreateIssueMatchEvent) Name() event.EventName
type DeleteIssueMatchEvent ¶
type DeleteIssueMatchEvent struct {
IssueMatchID int64
}
func (*DeleteIssueMatchEvent) Name ¶
func (e *DeleteIssueMatchEvent) Name() event.EventName
type GetIssueMatchEvent ¶
type GetIssueMatchEvent struct {
IssueMatchID int64
Result *entity.IssueMatch
}
func (*GetIssueMatchEvent) Name ¶
func (e *GetIssueMatchEvent) Name() event.EventName
type IssueMatchHandler ¶
type IssueMatchHandler interface {
ListIssueMatches(ctx context.Context, filter *entity.IssueMatchFilter, options *entity.ListOptions) (*entity.List[entity.IssueMatchResult], error)
GetIssueMatch(context.Context, int64) (*entity.IssueMatch, error)
CreateIssueMatch(context.Context, *entity.IssueMatch) (*entity.IssueMatch, error)
UpdateIssueMatch(context.Context, *entity.IssueMatch) (*entity.IssueMatch, error)
DeleteIssueMatch(context.Context, int64) error
}
func NewIssueMatchHandler ¶
func NewIssueMatchHandler(handlerContext common.HandlerContext, ss severity.SeverityHandler) IssueMatchHandler
type IssueMatchHandlerError ¶
type IssueMatchHandlerError struct {
// contains filtered or unexported fields
}
func NewIssueMatchHandlerError ¶
func NewIssueMatchHandlerError(message string) *IssueMatchHandlerError
func (*IssueMatchHandlerError) Error ¶
func (e *IssueMatchHandlerError) Error() string
type ListIssueMatchesEvent ¶
type ListIssueMatchesEvent struct {
Filter *entity.IssueMatchFilter
Options *entity.ListOptions
Results *entity.List[entity.IssueMatchResult]
}
func (*ListIssueMatchesEvent) Name ¶
func (e *ListIssueMatchesEvent) Name() event.EventName
type UpdateIssueMatchEvent ¶
type UpdateIssueMatchEvent struct {
IssueMatch *entity.IssueMatch
}
func (*UpdateIssueMatchEvent) Name ¶
func (e *UpdateIssueMatchEvent) Name() event.EventName