Documentation
¶
Overview ¶
Package securityscanprofiles implements MCP tools for GitLab security scan profiles through the GraphQL API.
Security scan profiles bundle a security scanning configuration (for example the built-in dependency_scanning profile) that can be attached to, or detached from, projects and groups. The package attaches and detaches profiles, lists the per-project scan profile statuses, and renders the results as Markdown.
The package wraps the GitLab GraphQL security scan profile mutations and queries:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func FormatListProjectStatusesMarkdown(out ListProjectStatusesOutput) string
- func FormatMutationMarkdown(out MutationOutput) string
- type AttachInput
- type DetachInput
- type ListProjectStatusesInput
- type ListProjectStatusesOutput
- type MutationOutput
- type ScanProfile
- type ScanProfileStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionSpecs ¶
func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
ActionSpecs returns canonical specs for security scan profile actions.
func FormatListProjectStatusesMarkdown ¶
func FormatListProjectStatusesMarkdown(out ListProjectStatusesOutput) string
FormatListProjectStatusesMarkdown renders per-project scan profile statuses as a Markdown table.
func FormatMutationMarkdown ¶
func FormatMutationMarkdown(out MutationOutput) string
FormatMutationMarkdown renders an attach or detach confirmation as Markdown.
Types ¶
type AttachInput ¶
type AttachInput struct {
SecurityScanProfileID string `` /* 337-byte string literal not displayed */
ProjectIDs []int64 `json:"project_ids,omitempty" jsonschema:"Numeric IDs of the projects to attach the profile to"`
GroupIDs []int64 `json:"group_ids,omitempty" jsonschema:"Numeric IDs of the groups to attach the profile to"`
}
AttachInput holds parameters for attaching a security scan profile to projects and/or groups.
type DetachInput ¶
type DetachInput struct {
SecurityScanProfileID string `` /* 284-byte string literal not displayed */
ProjectIDs []int64 `json:"project_ids,omitempty" jsonschema:"Numeric IDs of the projects to detach the profile from"`
GroupIDs []int64 `json:"group_ids,omitempty" jsonschema:"Numeric IDs of the groups to detach the profile from"`
}
DetachInput holds parameters for detaching a security scan profile from projects and/or groups.
type ListProjectStatusesInput ¶
type ListProjectStatusesInput struct {
ProjectFullPath string `` /* 162-byte string literal not displayed */
}
ListProjectStatusesInput holds parameters for listing the scan profile statuses of a project.
type ListProjectStatusesOutput ¶
type ListProjectStatusesOutput struct {
toolutil.HintableOutput
ProjectFullPath string `json:"project_full_path"`
Statuses []ScanProfileStatus `json:"statuses"`
}
ListProjectStatusesOutput contains the scan profile statuses for a project.
func ListProjectStatuses ¶
func ListProjectStatuses(ctx context.Context, client *gitlabclient.Client, input ListProjectStatusesInput) (ListProjectStatusesOutput, error)
ListProjectStatuses returns the scan profile statuses for a project.
type MutationOutput ¶
type MutationOutput struct {
toolutil.HintableOutput
Status string `json:"status"`
Message string `json:"message"`
SecurityScanProfileID string `json:"security_scan_profile_id"`
ProjectIDs []int64 `json:"project_ids,omitempty"`
GroupIDs []int64 `json:"group_ids,omitempty"`
}
MutationOutput confirms a security scan profile attach or detach operation and echoes the resolved targets.
func Attach ¶
func Attach(ctx context.Context, client *gitlabclient.Client, input AttachInput) (MutationOutput, error)
Attach attaches a security scan profile to the given projects and/or groups.
func Detach ¶
func Detach(ctx context.Context, client *gitlabclient.Client, input DetachInput) (MutationOutput, error)
Detach detaches a security scan profile from the given projects and/or groups.
type ScanProfile ¶
type ScanProfile struct {
ID string `json:"id"`
Name string `json:"name"`
ScanType string `json:"scan_type"`
}
ScanProfile represents a security scan profile.
type ScanProfileStatus ¶
type ScanProfileStatus struct {
Status string `json:"status"`
ScanProfile ScanProfile `json:"scan_profile"`
}
ScanProfileStatus represents the status of a scan profile for a project.