diff --git a/pkg/registrybroker/coverage_test.go b/pkg/registrybroker/coverage_test.go index 52dda47..8004687 100644 --- a/pkg/registrybroker/coverage_test.go +++ b/pkg/registrybroker/coverage_test.go @@ -48,6 +48,7 @@ func TestCoverageAllEndpoints(t *testing.T) { // skills _, _ = client.GetSkillsCatalog(ctx, SkillCatalogOptions{}) _, _ = client.ListSkills(ctx, ListSkillsOptions{}) + _, _ = client.GetSkillSecurityBreakdown(ctx, SkillSecurityBreakdownOptions{JobID: "job-1"}) _, _ = client.ListSkillVersions(ctx, "skill-id") _, _ = client.ListMySkills(ctx, ListMySkillsOptions{}) _, _ = client.GetMySkillsList(ctx, MySkillsListOptions{}) diff --git a/pkg/registrybroker/skills.go b/pkg/registrybroker/skills.go index 969aeae..49e76c9 100644 --- a/pkg/registrybroker/skills.go +++ b/pkg/registrybroker/skills.go @@ -79,6 +79,26 @@ func (c *RegistryBrokerClient) ListSkills( ) } +// GetSkillSecurityBreakdown returns scanner summary and findings for a skill release. +func (c *RegistryBrokerClient) GetSkillSecurityBreakdown( + ctx context.Context, + options SkillSecurityBreakdownOptions, +) (JSONObject, error) { + if err := ensureNonEmpty(options.JobID, "jobID"); err != nil { + return nil, err + } + + path := "/skills/" + percentPath(strings.TrimSpace(options.JobID)) + "/security-breakdown" + + return c.requestJSON( + ctx, + http.MethodGet, + path, + nil, + nil, + ) +} + // ListSkillVersions performs the requested operation. func (c *RegistryBrokerClient) ListSkillVersions( ctx context.Context, diff --git a/pkg/registrybroker/types.go b/pkg/registrybroker/types.go index 0424fe2..7910ce0 100644 --- a/pkg/registrybroker/types.go +++ b/pkg/registrybroker/types.go @@ -311,6 +311,10 @@ type ListSkillsOptions struct { AccountID string } +type SkillSecurityBreakdownOptions struct { + JobID string +} + type ListMySkillsOptions struct { Limit *int }