Documentation
¶
Overview ¶
Package testapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- Constants
- Variables
- func GetSummariesFromIssues(issues []Issue) map[string]*IssueSummary
- func Jitter(d time.Duration) time.Duration
- func NewCreateTestRequestWithApplicationVndAPIPlusJSONBody(server string, orgId OrgIdParam, params *CreateTestParams, ...) (*http.Request, error)
- func NewCreateTestRequestWithBody(server string, orgId OrgIdParam, params *CreateTestParams, contentType string, ...) (*http.Request, error)
- func NewGetAPIVersionRequest(server string, version string) (*http.Request, error)
- func NewGetJobRequest(server string, orgId OrgIdParam, jobId JobIdParam, params *GetJobParams) (*http.Request, error)
- func NewGetTestRequest(server string, orgId OrgIdParam, testId TestIdParam, params *GetTestParams) (*http.Request, error)
- func NewListAPIVersionsRequest(server string) (*http.Request, error)
- func NewListFindingsRequest(server string, orgId OrgIdParam, testId TestIdParam, ...) (*http.Request, error)
- type ActualVersion
- type AppliedPolicy
- func (t AppliedPolicy) AsIgnore() (Ignore, error)
- func (t AppliedPolicy) AsSeverityChange() (SeverityChange, error)
- func (t AppliedPolicy) Discriminator() (string, error)
- func (t *AppliedPolicy) FromIgnore(v Ignore) error
- func (t *AppliedPolicy) FromSeverityChange(v SeverityChange) error
- func (t AppliedPolicy) MarshalJSON() ([]byte, error)
- func (t *AppliedPolicy) MergeIgnore(v Ignore) error
- func (t *AppliedPolicy) MergeSeverityChange(v SeverityChange) error
- func (t *AppliedPolicy) UnmarshalJSON(b []byte) error
- func (t AppliedPolicy) ValueByDiscriminator() (interface{}, error)
- type BaseResource
- type BaseResourceCreateItem
- type BaseResourceCreateItemType
- type BaseResourceType
- type BaseResourceVariant
- func (t BaseResourceVariant) AsBundleResource() (BundleResource, error)
- func (t BaseResourceVariant) AsContainerRepoResource() (ContainerRepoResource, error)
- func (t BaseResourceVariant) AsInlineResource() (InlineResource, error)
- func (t BaseResourceVariant) AsScmResource() (ScmResource, error)
- func (t BaseResourceVariant) AsSnykReferenceResource() (SnykReferenceResource, error)
- func (t BaseResourceVariant) AsUploadResource() (UploadResource, error)
- func (t BaseResourceVariant) Discriminator() (string, error)
- func (t *BaseResourceVariant) FromBundleResource(v BundleResource) error
- func (t *BaseResourceVariant) FromContainerRepoResource(v ContainerRepoResource) error
- func (t *BaseResourceVariant) FromInlineResource(v InlineResource) error
- func (t *BaseResourceVariant) FromScmResource(v ScmResource) error
- func (t *BaseResourceVariant) FromSnykReferenceResource(v SnykReferenceResource) error
- func (t *BaseResourceVariant) FromUploadResource(v UploadResource) error
- func (t BaseResourceVariant) MarshalJSON() ([]byte, error)
- func (t *BaseResourceVariant) MergeBundleResource(v BundleResource) error
- func (t *BaseResourceVariant) MergeContainerRepoResource(v ContainerRepoResource) error
- func (t *BaseResourceVariant) MergeInlineResource(v InlineResource) error
- func (t *BaseResourceVariant) MergeScmResource(v ScmResource) error
- func (t *BaseResourceVariant) MergeSnykReferenceResource(v SnykReferenceResource) error
- func (t *BaseResourceVariant) MergeUploadResource(v UploadResource) error
- func (t *BaseResourceVariant) UnmarshalJSON(b []byte) error
- func (t BaseResourceVariant) ValueByDiscriminator() (interface{}, error)
- type BaseResourceVariantCreateItem
- func (t BaseResourceVariantCreateItem) AsBundleResource() (BundleResource, error)
- func (t BaseResourceVariantCreateItem) AsContainerRepoResource() (ContainerRepoResource, error)
- func (t BaseResourceVariantCreateItem) AsInlineResourceCreateItem() (InlineResourceCreateItem, error)
- func (t BaseResourceVariantCreateItem) AsScmResource() (ScmResource, error)
- func (t BaseResourceVariantCreateItem) AsSnykReferenceResource() (SnykReferenceResource, error)
- func (t BaseResourceVariantCreateItem) AsUploadResource() (UploadResource, error)
- func (t BaseResourceVariantCreateItem) Discriminator() (string, error)
- func (t *BaseResourceVariantCreateItem) FromBundleResource(v BundleResource) error
- func (t *BaseResourceVariantCreateItem) FromContainerRepoResource(v ContainerRepoResource) error
- func (t *BaseResourceVariantCreateItem) FromInlineResourceCreateItem(v InlineResourceCreateItem) error
- func (t *BaseResourceVariantCreateItem) FromScmResource(v ScmResource) error
- func (t *BaseResourceVariantCreateItem) FromSnykReferenceResource(v SnykReferenceResource) error
- func (t *BaseResourceVariantCreateItem) FromUploadResource(v UploadResource) error
- func (t BaseResourceVariantCreateItem) MarshalJSON() ([]byte, error)
- func (t *BaseResourceVariantCreateItem) MergeBundleResource(v BundleResource) error
- func (t *BaseResourceVariantCreateItem) MergeContainerRepoResource(v ContainerRepoResource) error
- func (t *BaseResourceVariantCreateItem) MergeInlineResourceCreateItem(v InlineResourceCreateItem) error
- func (t *BaseResourceVariantCreateItem) MergeScmResource(v ScmResource) error
- func (t *BaseResourceVariantCreateItem) MergeSnykReferenceResource(v SnykReferenceResource) error
- func (t *BaseResourceVariantCreateItem) MergeUploadResource(v UploadResource) error
- func (t *BaseResourceVariantCreateItem) UnmarshalJSON(b []byte) error
- func (t BaseResourceVariantCreateItem) ValueByDiscriminator() (interface{}, error)
- type BundleResource
- type BundleResourceContentType
- type BundleResourceType
- type Client
- func (c *Client) CreateTestWithApplicationVndAPIPlusJSONBody(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, ...) (*http.Response, error)
- func (c *Client) CreateTestWithBody(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, ...) (*http.Response, error)
- func (c *Client) GetAPIVersion(ctx context.Context, version string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetJob(ctx context.Context, orgId OrgIdParam, jobId JobIdParam, params *GetJobParams, ...) (*http.Response, error)
- func (c *Client) GetTest(ctx context.Context, orgId OrgIdParam, testId TestIdParam, ...) (*http.Response, error)
- func (c *Client) ListAPIVersions(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListFindings(ctx context.Context, orgId OrgIdParam, testId TestIdParam, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CreateTestWithApplicationVndAPIPlusJSONBodyWithResponse(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, ...) (*CreateTestResponse, error)
- func (c *ClientWithResponses) CreateTestWithBodyWithResponse(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, ...) (*CreateTestResponse, error)
- func (c *ClientWithResponses) GetAPIVersionWithResponse(ctx context.Context, version string, reqEditors ...RequestEditorFn) (*GetAPIVersionResponse, error)
- func (c *ClientWithResponses) GetJobWithResponse(ctx context.Context, orgId OrgIdParam, jobId JobIdParam, params *GetJobParams, ...) (*GetJobResponse, error)
- func (c *ClientWithResponses) GetTestWithResponse(ctx context.Context, orgId OrgIdParam, testId TestIdParam, ...) (*GetTestResponse, error)
- func (c *ClientWithResponses) ListAPIVersionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAPIVersionsResponse, error)
- func (c *ClientWithResponses) ListFindingsWithResponse(ctx context.Context, orgId OrgIdParam, testId TestIdParam, ...) (*ListFindingsResponse, error)
- type ClientWithResponsesInterface
- type ConfigOption
- func WithAPIVersion(v string) ConfigOption
- func WithCustomHTTPClient(doer HttpRequestDoer) ConfigOption
- func WithCustomRequestEditorFn(fn RequestEditorFn) ConfigOption
- func WithJitterFunc(fn func(time.Duration) time.Duration) ConfigOption
- func WithLogger(l *zerolog.Logger) ConfigOption
- func WithPollInterval(d time.Duration) ConfigOption
- func WithPollTimeout(d time.Duration) ConfigOption
- type ContainerRepoResource
- type ContainerRepoResourceType
- type ContainerScanConfiguration
- type CreateTest202DataType
- type CreateTestApplicationVndAPIPlusJSONRequestBody
- type CreateTestParams
- type CreateTestResponse
- type CreateTest_202_Links
- type CveProblem
- type CveProblemSource
- type CweProblem
- type CweProblemSource
- type DeepcodeBundleSubject
- type DeepcodeBundleSubjectType
- type DepGraphContent
- type DepGraphContentType
- type DepGraphSubject
- type DepGraphSubjectCreate
- type DepGraphSubjectCreateType
- type DepGraphSubjectType
- type DependencyCountFact
- type DependencyCountFactType
- type DependencyPathEvidence
- type DependencyPathEvidenceSource
- type Diff
- type DiffFormat
- type DiffResource
- type DiffResourceCreateItem
- type DiffResourceCreateItemType
- type DiffResourceType
- type DiffSuggestion
- type Error
- type ErrorDocument
- type ErrorLink
- type Evidence
- func (t Evidence) AsDependencyPathEvidence() (DependencyPathEvidence, error)
- func (t Evidence) AsExecutionFlowEvidence() (ExecutionFlowEvidence, error)
- func (t Evidence) AsOtherEvidence() (OtherEvidence, error)
- func (t Evidence) AsReachabilityEvidence() (ReachabilityEvidence, error)
- func (t Evidence) Discriminator() (string, error)
- func (t *Evidence) FromDependencyPathEvidence(v DependencyPathEvidence) error
- func (t *Evidence) FromExecutionFlowEvidence(v ExecutionFlowEvidence) error
- func (t *Evidence) FromOtherEvidence(v OtherEvidence) error
- func (t *Evidence) FromReachabilityEvidence(v ReachabilityEvidence) error
- func (t Evidence) MarshalJSON() ([]byte, error)
- func (t *Evidence) MergeDependencyPathEvidence(v DependencyPathEvidence) error
- func (t *Evidence) MergeExecutionFlowEvidence(v ExecutionFlowEvidence) error
- func (t *Evidence) MergeOtherEvidence(v OtherEvidence) error
- func (t *Evidence) MergeReachabilityEvidence(v ReachabilityEvidence) error
- func (t *Evidence) UnmarshalJSON(b []byte) error
- func (t Evidence) ValueByDiscriminator() (interface{}, error)
- type ExecutionFlowEvidence
- type ExecutionFlowEvidenceSource
- type FileRegion
- type FindingAttributes
- type FindingData
- type FindingDataType
- type FindingLocation
- func (t FindingLocation) AsOtherLocation() (OtherLocation, error)
- func (t FindingLocation) AsPackageLocation() (PackageLocation, error)
- func (t FindingLocation) AsSourceLocation() (SourceLocation, error)
- func (t FindingLocation) Discriminator() (string, error)
- func (t *FindingLocation) FromOtherLocation(v OtherLocation) error
- func (t *FindingLocation) FromPackageLocation(v PackageLocation) error
- func (t *FindingLocation) FromSourceLocation(v SourceLocation) error
- func (t FindingLocation) MarshalJSON() ([]byte, error)
- func (t *FindingLocation) MergeOtherLocation(v OtherLocation) error
- func (t *FindingLocation) MergePackageLocation(v PackageLocation) error
- func (t *FindingLocation) MergeSourceLocation(v SourceLocation) error
- func (t *FindingLocation) UnmarshalJSON(b []byte) error
- func (t FindingLocation) ValueByDiscriminator() (interface{}, error)
- type FindingSummary
- type FindingType
- type FixAction
- func (t FixAction) AsDiff() (Diff, error)
- func (t FixAction) AsPinPackageAdvice() (PinPackageAdvice, error)
- func (t FixAction) AsUpgradePackageAdvice() (UpgradePackageAdvice, error)
- func (t FixAction) Discriminator() (string, error)
- func (t *FixAction) FromDiff(v Diff) error
- func (t *FixAction) FromPinPackageAdvice(v PinPackageAdvice) error
- func (t *FixAction) FromUpgradePackageAdvice(v UpgradePackageAdvice) error
- func (t FixAction) MarshalJSON() ([]byte, error)
- func (t *FixAction) MergeDiff(v Diff) error
- func (t *FixAction) MergePinPackageAdvice(v PinPackageAdvice) error
- func (t *FixAction) MergeUpgradePackageAdvice(v UpgradePackageAdvice) error
- func (t *FixAction) UnmarshalJSON(b []byte) error
- func (t FixAction) ValueByDiscriminator() (interface{}, error)
- type FixAppliedOutcome
- type FixAttributes
- type GetAPIVersionResponse
- type GetJobParams
- type GetJobResponse
- type GetJob_200_Links
- type GetJob_303_Links
- type GetTestParams
- type GetTestResponse
- type GetTest_200_Links
- type GitUrlCoordinatesSubject
- type GitUrlCoordinatesSubjectType
- type GithubSecurityAdvisoryProblem
- type GithubSecurityAdvisoryProblemSource
- type HttpRequestDoer
- type IacScanConfiguration
- type Ignore
- type IgnoreActionType
- type IgnoreDetails
- type IgnoreDetailsReasonType
- type IgnoredBy
- type InlineContent
- type InlineResource
- type InlineResourceCreateItem
- type InlineResourceCreateItemType
- type InlineResourceType
- type IoSnykApiCommonError
- type IoSnykApiCommonErrorDocument
- type IoSnykApiCommonErrorLink
- func (a IoSnykApiCommonErrorLink) Get(fieldName string) (value IoSnykApiCommonLinkProperty, found bool)
- func (a IoSnykApiCommonErrorLink) MarshalJSON() ([]byte, error)
- func (a *IoSnykApiCommonErrorLink) Set(fieldName string, value IoSnykApiCommonLinkProperty)
- func (a *IoSnykApiCommonErrorLink) UnmarshalJSON(b []byte) error
- type IoSnykApiCommonJsonApi
- type IoSnykApiCommonJsonApiVersion
- type IoSnykApiCommonLinkObject
- type IoSnykApiCommonLinkProperty
- func (t IoSnykApiCommonLinkProperty) AsIoSnykApiCommonLinkObject() (IoSnykApiCommonLinkObject, error)
- func (t IoSnykApiCommonLinkProperty) AsIoSnykApiCommonLinkString() (IoSnykApiCommonLinkString, error)
- func (t *IoSnykApiCommonLinkProperty) FromIoSnykApiCommonLinkObject(v IoSnykApiCommonLinkObject) error
- func (t *IoSnykApiCommonLinkProperty) FromIoSnykApiCommonLinkString(v IoSnykApiCommonLinkString) error
- func (t IoSnykApiCommonLinkProperty) MarshalJSON() ([]byte, error)
- func (t *IoSnykApiCommonLinkProperty) MergeIoSnykApiCommonLinkObject(v IoSnykApiCommonLinkObject) error
- func (t *IoSnykApiCommonLinkProperty) MergeIoSnykApiCommonLinkString(v IoSnykApiCommonLinkString) error
- func (t *IoSnykApiCommonLinkProperty) UnmarshalJSON(b []byte) error
- type IoSnykApiCommonLinkString
- type IoSnykApiCommonMeta
- type IoSnykApiCommonPaginatedLinks
- type IoSnykApiCommonRelatedLink
- type IoSnykApiRequestPaginatedRequestEndingBefore
- type IoSnykApiRequestPaginatedRequestLimit
- type IoSnykApiRequestPaginatedRequestStartingAfter
- type IoSnykApiRequestSnykApiRequestInteractionId
- type IoSnykApiRequestSnykApiRequestRequestId
- type IoSnykApiRequestSnykApiRequestVersion
- type IoSnykApiV1testdepgraphRequestDepGraph
- func (a IoSnykApiV1testdepgraphRequestDepGraph) Get(fieldName string) (value interface{}, found bool)
- func (a IoSnykApiV1testdepgraphRequestDepGraph) MarshalJSON() ([]byte, error)
- func (a *IoSnykApiV1testdepgraphRequestDepGraph) Set(fieldName string, value interface{})
- func (a *IoSnykApiV1testdepgraphRequestDepGraph) UnmarshalJSON(b []byte) error
- type IoSnykApiV1testdepgraphRequestGraph
- func (a IoSnykApiV1testdepgraphRequestGraph) Get(fieldName string) (value interface{}, found bool)
- func (a IoSnykApiV1testdepgraphRequestGraph) MarshalJSON() ([]byte, error)
- func (a *IoSnykApiV1testdepgraphRequestGraph) Set(fieldName string, value interface{})
- func (a *IoSnykApiV1testdepgraphRequestGraph) UnmarshalJSON(b []byte) error
- type IoSnykApiV1testdepgraphRequestNode
- func (a IoSnykApiV1testdepgraphRequestNode) Get(fieldName string) (value interface{}, found bool)
- func (a IoSnykApiV1testdepgraphRequestNode) MarshalJSON() ([]byte, error)
- func (a *IoSnykApiV1testdepgraphRequestNode) Set(fieldName string, value interface{})
- func (a *IoSnykApiV1testdepgraphRequestNode) UnmarshalJSON(b []byte) error
- type IoSnykApiV1testdepgraphRequestNodeRef
- func (a IoSnykApiV1testdepgraphRequestNodeRef) Get(fieldName string) (value interface{}, found bool)
- func (a IoSnykApiV1testdepgraphRequestNodeRef) MarshalJSON() ([]byte, error)
- func (a *IoSnykApiV1testdepgraphRequestNodeRef) Set(fieldName string, value interface{})
- func (a *IoSnykApiV1testdepgraphRequestNodeRef) UnmarshalJSON(b []byte) error
- type IoSnykApiV1testdepgraphRequestPackage
- func (a IoSnykApiV1testdepgraphRequestPackage) Get(fieldName string) (value interface{}, found bool)
- func (a IoSnykApiV1testdepgraphRequestPackage) MarshalJSON() ([]byte, error)
- func (a *IoSnykApiV1testdepgraphRequestPackage) Set(fieldName string, value interface{})
- func (a *IoSnykApiV1testdepgraphRequestPackage) UnmarshalJSON(b []byte) error
- type IoSnykApiV1testdepgraphRequestPackageInfo
- func (a IoSnykApiV1testdepgraphRequestPackageInfo) Get(fieldName string) (value interface{}, found bool)
- func (a IoSnykApiV1testdepgraphRequestPackageInfo) MarshalJSON() ([]byte, error)
- func (a *IoSnykApiV1testdepgraphRequestPackageInfo) Set(fieldName string, value interface{})
- func (a *IoSnykApiV1testdepgraphRequestPackageInfo) UnmarshalJSON(b []byte) error
- type IoSnykApiV1testdepgraphRequestPackageManager
- func (a IoSnykApiV1testdepgraphRequestPackageManager) Get(fieldName string) (value interface{}, found bool)
- func (a IoSnykApiV1testdepgraphRequestPackageManager) MarshalJSON() ([]byte, error)
- func (a *IoSnykApiV1testdepgraphRequestPackageManager) Set(fieldName string, value interface{})
- func (a *IoSnykApiV1testdepgraphRequestPackageManager) UnmarshalJSON(b []byte) error
- type Issue
- type IssueError
- type IssueIgnoreDetails
- type IssueSummary
- type JobAttributes
- type JobData
- type JobDataType
- type JobIdParam
- type JobRelationshipField
- type JobRelationshipFieldDataType
- type JobRelationships
- type JsonApi
- type LinkProperty
- func (t LinkProperty) AsLinkProperty0() (LinkProperty0, error)
- func (t LinkProperty) AsLinkProperty1() (LinkProperty1, error)
- func (t *LinkProperty) FromLinkProperty0(v LinkProperty0) error
- func (t *LinkProperty) FromLinkProperty1(v LinkProperty1) error
- func (t LinkProperty) MarshalJSON() ([]byte, error)
- func (t *LinkProperty) MergeLinkProperty0(v LinkProperty0) error
- func (t *LinkProperty) MergeLinkProperty1(v LinkProperty1) error
- func (t *LinkProperty) UnmarshalJSON(b []byte) error
- type LinkProperty0
- type LinkProperty1
- type ListAPIVersionsResponse
- type ListFindingsParams
- type ListFindingsResponse
- type LocalIgnore
- type LocalPathLocator
- type LocalPathLocatorType
- type LocalPolicy
- type ManagedPolicyRef
- type Meta
- type N400
- type N401
- type N404
- type N500
- type OrgIdParam
- type OtherEvidence
- type OtherEvidenceSource
- type OtherLocation
- type OtherLocationType
- type OtherLocator
- type OtherLocatorType
- type OtherProblem
- type OtherProblemSource
- type OtherSubject
- type OtherSubjectType
- type Package
- type PackageLocation
- type PackageLocationType
- type PassFail
- type PinPackageAdvice
- type PinPackageAdviceFormat
- type Policy
- type PolicyAttributes
- type PolicyModification
- type PolicyRef
- func (t PolicyRef) AsManagedPolicyRef() (ManagedPolicyRef, error)
- func (t PolicyRef) AsPolicyRef0() (PolicyRef0, error)
- func (t *PolicyRef) FromManagedPolicyRef(v ManagedPolicyRef) error
- func (t *PolicyRef) FromPolicyRef0(v PolicyRef0) error
- func (t PolicyRef) MarshalJSON() ([]byte, error)
- func (t *PolicyRef) MergeManagedPolicyRef(v ManagedPolicyRef) error
- func (t *PolicyRef) MergePolicyRef0(v PolicyRef0) error
- func (t *PolicyRef) UnmarshalJSON(b []byte) error
- type PolicyRef0
- type PolicyRefSet
- type PolicyRule
- type PolicyRuleReview
- type PolicyType
- type Problem
- func (t Problem) AsCveProblem() (CveProblem, error)
- func (t Problem) AsCweProblem() (CweProblem, error)
- func (t Problem) AsGithubSecurityAdvisoryProblem() (GithubSecurityAdvisoryProblem, error)
- func (t Problem) AsOtherProblem() (OtherProblem, error)
- func (t Problem) AsSecretsRuleProblem() (SecretsRuleProblem, error)
- func (t Problem) AsSnykCloudRuleProblem() (SnykCloudRuleProblem, error)
- func (t Problem) AsSnykCodeRuleProblem() (SnykCodeRuleProblem, error)
- func (t Problem) AsSnykLicenseProblem() (SnykLicenseProblem, error)
- func (t Problem) AsSnykVulnProblem() (SnykVulnProblem, error)
- func (t Problem) Discriminator() (string, error)
- func (t *Problem) FromCveProblem(v CveProblem) error
- func (t *Problem) FromCweProblem(v CweProblem) error
- func (t *Problem) FromGithubSecurityAdvisoryProblem(v GithubSecurityAdvisoryProblem) error
- func (t *Problem) FromOtherProblem(v OtherProblem) error
- func (t *Problem) FromSecretsRuleProblem(v SecretsRuleProblem) error
- func (t *Problem) FromSnykCloudRuleProblem(v SnykCloudRuleProblem) error
- func (t *Problem) FromSnykCodeRuleProblem(v SnykCodeRuleProblem) error
- func (t *Problem) FromSnykLicenseProblem(v SnykLicenseProblem) error
- func (t *Problem) FromSnykVulnProblem(v SnykVulnProblem) error
- func (p Problem) GetID() string
- func (p Problem) HasID() bool
- func (t Problem) MarshalJSON() ([]byte, error)
- func (t *Problem) MergeCveProblem(v CveProblem) error
- func (t *Problem) MergeCweProblem(v CweProblem) error
- func (t *Problem) MergeGithubSecurityAdvisoryProblem(v GithubSecurityAdvisoryProblem) error
- func (t *Problem) MergeOtherProblem(v OtherProblem) error
- func (t *Problem) MergeSecretsRuleProblem(v SecretsRuleProblem) error
- func (t *Problem) MergeSnykCloudRuleProblem(v SnykCloudRuleProblem) error
- func (t *Problem) MergeSnykCodeRuleProblem(v SnykCodeRuleProblem) error
- func (t *Problem) MergeSnykLicenseProblem(v SnykLicenseProblem) error
- func (t *Problem) MergeSnykVulnProblem(v SnykVulnProblem) error
- func (t *Problem) UnmarshalJSON(b []byte) error
- func (t Problem) ValueByDiscriminator() (interface{}, error)
- type ProjectEntityLocator
- type ProjectEntityLocatorType
- type ProjectNameLocator
- type ProjectNameLocatorType
- type QueryVersion
- type Rating
- type ReachabilityEvidence
- type ReachabilityEvidenceSource
- type ReachabilityFilter
- type ReachabilityType
- type ReachablePath
- type RequestEditorFn
- type Risk
- type RiskScore
- type SastScanConfiguration
- type SbomReachabilitySubject
- type SbomReachabilitySubjectType
- type SbomSubject
- type SbomSubjectType
- type ScaScanConfiguration
- type ScanConfiguration
- type ScmContext
- type ScmRepoLocator
- type ScmRepoLocatorType
- type ScmResource
- type ScmResourceType
- type SdlcStage
- type SecretsRuleProblem
- type SecretsRuleProblemSource
- type SecretsScanConfiguration
- type Severity
- type SeverityChange
- type SeverityChangeActionType
- type SeverityChangeDetails
- type SnykCloudRuleProblem
- type SnykCloudRuleProblemSource
- type SnykCodeRuleProblem
- type SnykCodeRuleProblemSource
- type SnykLicenseProblem
- type SnykLicenseProblemSource
- type SnykPolicyRef
- type SnykPolicyRefOwner
- type SnykReferenceResource
- type SnykReferenceResourceReferenceType
- type SnykReferenceResourceType
- type SnykVulnProblem
- type SnykVulnProblemSource
- type SnykcoderuleConfiguration
- type SnykcoderuleExampleCommitChange
- type SnykcoderuleExampleCommitFix
- type SnykcoderuleMultiformatMessageString
- type SnykcoderuleProperties
- type SnykvulndbBuildPackageEcosystem
- type SnykvulndbBuildPackageEcosystemType
- type SnykvulndbCvssScore
- type SnykvulndbCvssSource
- type SnykvulndbCvssSourceType
- type SnykvulndbEpssDetails
- type SnykvulndbExploitDetails
- type SnykvulndbExploitMaturityLevel
- type SnykvulndbLicenseInstructions
- type SnykvulndbOsPackageEcosystem
- type SnykvulndbOsPackageEcosystemType
- type SnykvulndbOtherPackageEcosystem
- type SnykvulndbOtherPackageEcosystemType
- type SnykvulndbPackageEcosystem
- func (t SnykvulndbPackageEcosystem) AsSnykvulndbBuildPackageEcosystem() (SnykvulndbBuildPackageEcosystem, error)
- func (t SnykvulndbPackageEcosystem) AsSnykvulndbOsPackageEcosystem() (SnykvulndbOsPackageEcosystem, error)
- func (t SnykvulndbPackageEcosystem) AsSnykvulndbOtherPackageEcosystem() (SnykvulndbOtherPackageEcosystem, error)
- func (t SnykvulndbPackageEcosystem) Discriminator() (string, error)
- func (t *SnykvulndbPackageEcosystem) FromSnykvulndbBuildPackageEcosystem(v SnykvulndbBuildPackageEcosystem) error
- func (t *SnykvulndbPackageEcosystem) FromSnykvulndbOsPackageEcosystem(v SnykvulndbOsPackageEcosystem) error
- func (t *SnykvulndbPackageEcosystem) FromSnykvulndbOtherPackageEcosystem(v SnykvulndbOtherPackageEcosystem) error
- func (t SnykvulndbPackageEcosystem) MarshalJSON() ([]byte, error)
- func (t *SnykvulndbPackageEcosystem) MergeSnykvulndbBuildPackageEcosystem(v SnykvulndbBuildPackageEcosystem) error
- func (t *SnykvulndbPackageEcosystem) MergeSnykvulndbOsPackageEcosystem(v SnykvulndbOsPackageEcosystem) error
- func (t *SnykvulndbPackageEcosystem) MergeSnykvulndbOtherPackageEcosystem(v SnykvulndbOtherPackageEcosystem) error
- func (t *SnykvulndbPackageEcosystem) UnmarshalJSON(b []byte) error
- func (t SnykvulndbPackageEcosystem) ValueByDiscriminator() (interface{}, error)
- type SnykvulndbReferenceLinks
- type SnykvulndbVulnerableFunction
- type SnykvulndbVulnerableFunctionId
- type SourceLocation
- type SourceLocationType
- type StartTestParams
- type String256
- type Suppression
- type SuppressionStatus
- type TestAttributes
- type TestAttributesCreate
- type TestClient
- type TestComponent
- type TestConfiguration
- type TestData
- type TestDataCreate
- type TestDataCreateType
- type TestDataType
- type TestExecutionStates
- type TestFact
- type TestHandle
- type TestIdParam
- type TestOutcome
- type TestOutcomeReason
- type TestRequestBody
- type TestResource
- func (t TestResource) AsBaseResource() (BaseResource, error)
- func (t TestResource) AsDiffResource() (DiffResource, error)
- func (t TestResource) Discriminator() (string, error)
- func (t *TestResource) FromBaseResource(v BaseResource) error
- func (t *TestResource) FromDiffResource(v DiffResource) error
- func (t TestResource) MarshalJSON() ([]byte, error)
- func (t *TestResource) MergeBaseResource(v BaseResource) error
- func (t *TestResource) MergeDiffResource(v DiffResource) error
- func (t *TestResource) UnmarshalJSON(b []byte) error
- func (t TestResource) ValueByDiscriminator() (interface{}, error)
- type TestResourceCreateItem
- func (t TestResourceCreateItem) AsBaseResourceCreateItem() (BaseResourceCreateItem, error)
- func (t TestResourceCreateItem) AsDiffResourceCreateItem() (DiffResourceCreateItem, error)
- func (t TestResourceCreateItem) Discriminator() (string, error)
- func (t *TestResourceCreateItem) FromBaseResourceCreateItem(v BaseResourceCreateItem) error
- func (t *TestResourceCreateItem) FromDiffResourceCreateItem(v DiffResourceCreateItem) error
- func (t TestResourceCreateItem) MarshalJSON() ([]byte, error)
- func (t *TestResourceCreateItem) MergeBaseResourceCreateItem(v BaseResourceCreateItem) error
- func (t *TestResourceCreateItem) MergeDiffResourceCreateItem(v DiffResourceCreateItem) error
- func (t *TestResourceCreateItem) UnmarshalJSON(b []byte) error
- func (t TestResourceCreateItem) ValueByDiscriminator() (interface{}, error)
- type TestResult
- type TestResultKeys
- type TestState
- type TestSubject
- func (t TestSubject) AsDeepcodeBundleSubject() (DeepcodeBundleSubject, error)
- func (t TestSubject) AsDepGraphSubject() (DepGraphSubject, error)
- func (t TestSubject) AsGitUrlCoordinatesSubject() (GitUrlCoordinatesSubject, error)
- func (t TestSubject) AsOtherSubject() (OtherSubject, error)
- func (t TestSubject) AsSbomReachabilitySubject() (SbomReachabilitySubject, error)
- func (t TestSubject) AsSbomSubject() (SbomSubject, error)
- func (t TestSubject) Discriminator() (string, error)
- func (t *TestSubject) FromDeepcodeBundleSubject(v DeepcodeBundleSubject) error
- func (t *TestSubject) FromDepGraphSubject(v DepGraphSubject) error
- func (t *TestSubject) FromGitUrlCoordinatesSubject(v GitUrlCoordinatesSubject) error
- func (t *TestSubject) FromOtherSubject(v OtherSubject) error
- func (t *TestSubject) FromSbomReachabilitySubject(v SbomReachabilitySubject) error
- func (t *TestSubject) FromSbomSubject(v SbomSubject) error
- func (t TestSubject) MarshalJSON() ([]byte, error)
- func (t *TestSubject) MergeDeepcodeBundleSubject(v DeepcodeBundleSubject) error
- func (t *TestSubject) MergeDepGraphSubject(v DepGraphSubject) error
- func (t *TestSubject) MergeGitUrlCoordinatesSubject(v GitUrlCoordinatesSubject) error
- func (t *TestSubject) MergeOtherSubject(v OtherSubject) error
- func (t *TestSubject) MergeSbomReachabilitySubject(v SbomReachabilitySubject) error
- func (t *TestSubject) MergeSbomSubject(v SbomSubject) error
- func (t *TestSubject) UnmarshalJSON(b []byte) error
- func (t TestSubject) ValueByDiscriminator() (interface{}, error)
- type TestSubjectCreate
- func (t TestSubjectCreate) AsDeepcodeBundleSubject() (DeepcodeBundleSubject, error)
- func (t TestSubjectCreate) AsDepGraphSubjectCreate() (DepGraphSubjectCreate, error)
- func (t TestSubjectCreate) AsGitUrlCoordinatesSubject() (GitUrlCoordinatesSubject, error)
- func (t TestSubjectCreate) AsOtherSubject() (OtherSubject, error)
- func (t TestSubjectCreate) AsSbomReachabilitySubject() (SbomReachabilitySubject, error)
- func (t TestSubjectCreate) AsSbomSubject() (SbomSubject, error)
- func (t TestSubjectCreate) Discriminator() (string, error)
- func (t *TestSubjectCreate) FromDeepcodeBundleSubject(v DeepcodeBundleSubject) error
- func (t *TestSubjectCreate) FromDepGraphSubjectCreate(v DepGraphSubjectCreate) error
- func (t *TestSubjectCreate) FromGitUrlCoordinatesSubject(v GitUrlCoordinatesSubject) error
- func (t *TestSubjectCreate) FromOtherSubject(v OtherSubject) error
- func (t *TestSubjectCreate) FromSbomReachabilitySubject(v SbomReachabilitySubject) error
- func (t *TestSubjectCreate) FromSbomSubject(v SbomSubject) error
- func (t TestSubjectCreate) MarshalJSON() ([]byte, error)
- func (t *TestSubjectCreate) MergeDeepcodeBundleSubject(v DeepcodeBundleSubject) error
- func (t *TestSubjectCreate) MergeDepGraphSubjectCreate(v DepGraphSubjectCreate) error
- func (t *TestSubjectCreate) MergeGitUrlCoordinatesSubject(v GitUrlCoordinatesSubject) error
- func (t *TestSubjectCreate) MergeOtherSubject(v OtherSubject) error
- func (t *TestSubjectCreate) MergeSbomReachabilitySubject(v SbomReachabilitySubject) error
- func (t *TestSubjectCreate) MergeSbomSubject(v SbomSubject) error
- func (t *TestSubjectCreate) UnmarshalJSON(b []byte) error
- func (t TestSubjectCreate) ValueByDiscriminator() (interface{}, error)
- type TestSubjectLocator
- func (t TestSubjectLocator) AsLocalPathLocator() (LocalPathLocator, error)
- func (t TestSubjectLocator) AsOtherLocator() (OtherLocator, error)
- func (t TestSubjectLocator) AsProjectEntityLocator() (ProjectEntityLocator, error)
- func (t TestSubjectLocator) AsProjectNameLocator() (ProjectNameLocator, error)
- func (t TestSubjectLocator) AsScmRepoLocator() (ScmRepoLocator, error)
- func (t TestSubjectLocator) Discriminator() (string, error)
- func (t *TestSubjectLocator) FromLocalPathLocator(v LocalPathLocator) error
- func (t *TestSubjectLocator) FromOtherLocator(v OtherLocator) error
- func (t *TestSubjectLocator) FromProjectEntityLocator(v ProjectEntityLocator) error
- func (t *TestSubjectLocator) FromProjectNameLocator(v ProjectNameLocator) error
- func (t *TestSubjectLocator) FromScmRepoLocator(v ScmRepoLocator) error
- func (t TestSubjectLocator) MarshalJSON() ([]byte, error)
- func (t *TestSubjectLocator) MergeLocalPathLocator(v LocalPathLocator) error
- func (t *TestSubjectLocator) MergeOtherLocator(v OtherLocator) error
- func (t *TestSubjectLocator) MergeProjectEntityLocator(v ProjectEntityLocator) error
- func (t *TestSubjectLocator) MergeProjectNameLocator(v ProjectNameLocator) error
- func (t *TestSubjectLocator) MergeScmRepoLocator(v ScmRepoLocator) error
- func (t *TestSubjectLocator) UnmarshalJSON(b []byte) error
- func (t TestSubjectLocator) ValueByDiscriminator() (interface{}, error)
- type TimeoutSpec
- type UpgradePackageAdvice
- type UpgradePackageAdviceFormat
- type UpgradePath
- type UploadResource
- type UploadResourceContentType
- type UploadResourceType
- type Uuid
Constants ¶
const ( // DataKeyComponent is the key for accessing the component information (name and version) // Value type: map[string]string with keys "name" and "version" DataKeyComponent = "component" // DataKeyComponentName is the key for accessing just the component name // Value type: string DataKeyComponentName = "component-name" // DataKeyComponentVersion is the key for accessing just the component version // Value type: string DataKeyComponentVersion = "component-version" // DataKeyTechnology is the key for the technology/ecosystem // For SCA: package manager (e.g., "npm", "maven") // For SAST: language/framework (e.g., "javascript", "python") // Value type: string DataKeyTechnology = "technology" // DataKeyCVSSScore is the key for CVSS base score // Value type: float32 DataKeyCVSSScore = "cvss-score" // DataKeyIsFixable is the key for whether a fix is available // Value type: bool DataKeyIsFixable = "is-fixable" // DataKeyFixedInVersions is the key for versions that fix this issue // Value type: []string DataKeyFixedInVersions = "fixed-in-versions" // DataKeyDependencyPaths is the key for dependency paths (SCA findings) // Value type: [][]Package DataKeyDependencyPaths = "dependency-paths" // DataKeyRuleShortDescription is the key for the rule short description (SAST or Secret findings) // Value type: string DataKeyRuleShortDescription = "rule-short-description" FindingTypeLicense = "license" )
Data keys for common issue properties (case-insensitive)
const ( DefaultPollInterval = 2 * time.Second MinPollInterval = 1 * time.Second MaxFindingsPerPage = 100 DefaultAPIVersion = "2024-10-15" )
Variables ¶
var ( ErrInvalidStateForFindings = errors.New("cannot fetch findings: test ID or internal handle is missing") ErrFindingsFetchCanceled = errors.New("findings fetch operation was canceled") ErrFindingsPageRequest = errors.New("failed to request a page of findings") ErrFindingsPageResponse = errors.New("unexpected API response when fetching findings page") ErrFindingsPageData = errors.New("invalid data in findings page API response") ErrFindingsNextPageCursor = errors.New("failed to determine next findings page cursor from API response") )
Predefined errors for findings operations
Functions ¶
func GetSummariesFromIssues ¶
func GetSummariesFromIssues(issues []Issue) map[string]*IssueSummary
func NewCreateTestRequestWithApplicationVndAPIPlusJSONBody ¶
func NewCreateTestRequestWithApplicationVndAPIPlusJSONBody(server string, orgId OrgIdParam, params *CreateTestParams, body CreateTestApplicationVndAPIPlusJSONRequestBody) (*http.Request, error)
NewCreateTestRequestWithApplicationVndAPIPlusJSONBody calls the generic CreateTest builder with application/vnd.api+json body
func NewCreateTestRequestWithBody ¶
func NewCreateTestRequestWithBody(server string, orgId OrgIdParam, params *CreateTestParams, contentType string, body io.Reader) (*http.Request, error)
NewCreateTestRequestWithBody generates requests for CreateTest with any type of body
func NewGetAPIVersionRequest ¶
NewGetAPIVersionRequest generates requests for GetAPIVersion
func NewGetJobRequest ¶
func NewGetJobRequest(server string, orgId OrgIdParam, jobId JobIdParam, params *GetJobParams) (*http.Request, error)
NewGetJobRequest generates requests for GetJob
func NewGetTestRequest ¶
func NewGetTestRequest(server string, orgId OrgIdParam, testId TestIdParam, params *GetTestParams) (*http.Request, error)
NewGetTestRequest generates requests for GetTest
func NewListAPIVersionsRequest ¶
NewListAPIVersionsRequest generates requests for ListAPIVersions
func NewListFindingsRequest ¶
func NewListFindingsRequest(server string, orgId OrgIdParam, testId TestIdParam, params *ListFindingsParams) (*http.Request, error)
NewListFindingsRequest generates requests for ListFindings
Types ¶
type AppliedPolicy ¶
type AppliedPolicy struct {
// contains filtered or unexported fields
}
AppliedPolicy defines model for AppliedPolicy.
func (AppliedPolicy) AsIgnore ¶
func (t AppliedPolicy) AsIgnore() (Ignore, error)
AsIgnore returns the union data inside the AppliedPolicy as a Ignore
func (AppliedPolicy) AsSeverityChange ¶
func (t AppliedPolicy) AsSeverityChange() (SeverityChange, error)
AsSeverityChange returns the union data inside the AppliedPolicy as a SeverityChange
func (AppliedPolicy) Discriminator ¶
func (t AppliedPolicy) Discriminator() (string, error)
func (*AppliedPolicy) FromIgnore ¶
func (t *AppliedPolicy) FromIgnore(v Ignore) error
FromIgnore overwrites any union data inside the AppliedPolicy as the provided Ignore
func (*AppliedPolicy) FromSeverityChange ¶
func (t *AppliedPolicy) FromSeverityChange(v SeverityChange) error
FromSeverityChange overwrites any union data inside the AppliedPolicy as the provided SeverityChange
func (AppliedPolicy) MarshalJSON ¶
func (t AppliedPolicy) MarshalJSON() ([]byte, error)
func (*AppliedPolicy) MergeIgnore ¶
func (t *AppliedPolicy) MergeIgnore(v Ignore) error
MergeIgnore performs a merge with any union data inside the AppliedPolicy, using the provided Ignore
func (*AppliedPolicy) MergeSeverityChange ¶
func (t *AppliedPolicy) MergeSeverityChange(v SeverityChange) error
MergeSeverityChange performs a merge with any union data inside the AppliedPolicy, using the provided SeverityChange
func (*AppliedPolicy) UnmarshalJSON ¶
func (t *AppliedPolicy) UnmarshalJSON(b []byte) error
func (AppliedPolicy) ValueByDiscriminator ¶
func (t AppliedPolicy) ValueByDiscriminator() (interface{}, error)
type BaseResource ¶
type BaseResource struct {
// Resource The specific representation of what content to test.
Resource BaseResourceVariant `json:"resource"`
Type BaseResourceType `json:"type"`
}
BaseResource BaseResources contain a single instance of testable content.
type BaseResourceCreateItem ¶
type BaseResourceCreateItem struct {
// Resource The specific representation of what content to test.
Resource BaseResourceVariantCreateItem `json:"resource"`
Type BaseResourceCreateItemType `json:"type"`
}
BaseResourceCreateItem BaseResources contain a single instance of testable content.
type BaseResourceCreateItemType ¶
type BaseResourceCreateItemType string
BaseResourceCreateItemType defines model for BaseResourceCreateItem.Type.
const (
BaseResourceCreateItemTypeBase BaseResourceCreateItemType = "base"
)
Defines values for BaseResourceCreateItemType.
type BaseResourceType ¶
type BaseResourceType string
BaseResourceType defines model for BaseResource.Type.
const (
BaseResourceTypeBase BaseResourceType = "base"
)
Defines values for BaseResourceType.
type BaseResourceVariant ¶
type BaseResourceVariant struct {
// contains filtered or unexported fields
}
BaseResourceVariant defines model for BaseResourceVariant.
func (BaseResourceVariant) AsBundleResource ¶
func (t BaseResourceVariant) AsBundleResource() (BundleResource, error)
AsBundleResource returns the union data inside the BaseResourceVariant as a BundleResource
func (BaseResourceVariant) AsContainerRepoResource ¶
func (t BaseResourceVariant) AsContainerRepoResource() (ContainerRepoResource, error)
AsContainerRepoResource returns the union data inside the BaseResourceVariant as a ContainerRepoResource
func (BaseResourceVariant) AsInlineResource ¶
func (t BaseResourceVariant) AsInlineResource() (InlineResource, error)
AsInlineResource returns the union data inside the BaseResourceVariant as a InlineResource
func (BaseResourceVariant) AsScmResource ¶
func (t BaseResourceVariant) AsScmResource() (ScmResource, error)
AsScmResource returns the union data inside the BaseResourceVariant as a ScmResource
func (BaseResourceVariant) AsSnykReferenceResource ¶
func (t BaseResourceVariant) AsSnykReferenceResource() (SnykReferenceResource, error)
AsSnykReferenceResource returns the union data inside the BaseResourceVariant as a SnykReferenceResource
func (BaseResourceVariant) AsUploadResource ¶
func (t BaseResourceVariant) AsUploadResource() (UploadResource, error)
AsUploadResource returns the union data inside the BaseResourceVariant as a UploadResource
func (BaseResourceVariant) Discriminator ¶
func (t BaseResourceVariant) Discriminator() (string, error)
func (*BaseResourceVariant) FromBundleResource ¶
func (t *BaseResourceVariant) FromBundleResource(v BundleResource) error
FromBundleResource overwrites any union data inside the BaseResourceVariant as the provided BundleResource
func (*BaseResourceVariant) FromContainerRepoResource ¶
func (t *BaseResourceVariant) FromContainerRepoResource(v ContainerRepoResource) error
FromContainerRepoResource overwrites any union data inside the BaseResourceVariant as the provided ContainerRepoResource
func (*BaseResourceVariant) FromInlineResource ¶
func (t *BaseResourceVariant) FromInlineResource(v InlineResource) error
FromInlineResource overwrites any union data inside the BaseResourceVariant as the provided InlineResource
func (*BaseResourceVariant) FromScmResource ¶
func (t *BaseResourceVariant) FromScmResource(v ScmResource) error
FromScmResource overwrites any union data inside the BaseResourceVariant as the provided ScmResource
func (*BaseResourceVariant) FromSnykReferenceResource ¶
func (t *BaseResourceVariant) FromSnykReferenceResource(v SnykReferenceResource) error
FromSnykReferenceResource overwrites any union data inside the BaseResourceVariant as the provided SnykReferenceResource
func (*BaseResourceVariant) FromUploadResource ¶
func (t *BaseResourceVariant) FromUploadResource(v UploadResource) error
FromUploadResource overwrites any union data inside the BaseResourceVariant as the provided UploadResource
func (BaseResourceVariant) MarshalJSON ¶
func (t BaseResourceVariant) MarshalJSON() ([]byte, error)
func (*BaseResourceVariant) MergeBundleResource ¶
func (t *BaseResourceVariant) MergeBundleResource(v BundleResource) error
MergeBundleResource performs a merge with any union data inside the BaseResourceVariant, using the provided BundleResource
func (*BaseResourceVariant) MergeContainerRepoResource ¶
func (t *BaseResourceVariant) MergeContainerRepoResource(v ContainerRepoResource) error
MergeContainerRepoResource performs a merge with any union data inside the BaseResourceVariant, using the provided ContainerRepoResource
func (*BaseResourceVariant) MergeInlineResource ¶
func (t *BaseResourceVariant) MergeInlineResource(v InlineResource) error
MergeInlineResource performs a merge with any union data inside the BaseResourceVariant, using the provided InlineResource
func (*BaseResourceVariant) MergeScmResource ¶
func (t *BaseResourceVariant) MergeScmResource(v ScmResource) error
MergeScmResource performs a merge with any union data inside the BaseResourceVariant, using the provided ScmResource
func (*BaseResourceVariant) MergeSnykReferenceResource ¶
func (t *BaseResourceVariant) MergeSnykReferenceResource(v SnykReferenceResource) error
MergeSnykReferenceResource performs a merge with any union data inside the BaseResourceVariant, using the provided SnykReferenceResource
func (*BaseResourceVariant) MergeUploadResource ¶
func (t *BaseResourceVariant) MergeUploadResource(v UploadResource) error
MergeUploadResource performs a merge with any union data inside the BaseResourceVariant, using the provided UploadResource
func (*BaseResourceVariant) UnmarshalJSON ¶
func (t *BaseResourceVariant) UnmarshalJSON(b []byte) error
func (BaseResourceVariant) ValueByDiscriminator ¶
func (t BaseResourceVariant) ValueByDiscriminator() (interface{}, error)
type BaseResourceVariantCreateItem ¶
type BaseResourceVariantCreateItem struct {
// contains filtered or unexported fields
}
BaseResourceVariantCreateItem defines model for BaseResourceVariantCreateItem.
func (BaseResourceVariantCreateItem) AsBundleResource ¶
func (t BaseResourceVariantCreateItem) AsBundleResource() (BundleResource, error)
AsBundleResource returns the union data inside the BaseResourceVariantCreateItem as a BundleResource
func (BaseResourceVariantCreateItem) AsContainerRepoResource ¶
func (t BaseResourceVariantCreateItem) AsContainerRepoResource() (ContainerRepoResource, error)
AsContainerRepoResource returns the union data inside the BaseResourceVariantCreateItem as a ContainerRepoResource
func (BaseResourceVariantCreateItem) AsInlineResourceCreateItem ¶
func (t BaseResourceVariantCreateItem) AsInlineResourceCreateItem() (InlineResourceCreateItem, error)
AsInlineResourceCreateItem returns the union data inside the BaseResourceVariantCreateItem as a InlineResourceCreateItem
func (BaseResourceVariantCreateItem) AsScmResource ¶
func (t BaseResourceVariantCreateItem) AsScmResource() (ScmResource, error)
AsScmResource returns the union data inside the BaseResourceVariantCreateItem as a ScmResource
func (BaseResourceVariantCreateItem) AsSnykReferenceResource ¶
func (t BaseResourceVariantCreateItem) AsSnykReferenceResource() (SnykReferenceResource, error)
AsSnykReferenceResource returns the union data inside the BaseResourceVariantCreateItem as a SnykReferenceResource
func (BaseResourceVariantCreateItem) AsUploadResource ¶
func (t BaseResourceVariantCreateItem) AsUploadResource() (UploadResource, error)
AsUploadResource returns the union data inside the BaseResourceVariantCreateItem as a UploadResource
func (BaseResourceVariantCreateItem) Discriminator ¶
func (t BaseResourceVariantCreateItem) Discriminator() (string, error)
func (*BaseResourceVariantCreateItem) FromBundleResource ¶
func (t *BaseResourceVariantCreateItem) FromBundleResource(v BundleResource) error
FromBundleResource overwrites any union data inside the BaseResourceVariantCreateItem as the provided BundleResource
func (*BaseResourceVariantCreateItem) FromContainerRepoResource ¶
func (t *BaseResourceVariantCreateItem) FromContainerRepoResource(v ContainerRepoResource) error
FromContainerRepoResource overwrites any union data inside the BaseResourceVariantCreateItem as the provided ContainerRepoResource
func (*BaseResourceVariantCreateItem) FromInlineResourceCreateItem ¶
func (t *BaseResourceVariantCreateItem) FromInlineResourceCreateItem(v InlineResourceCreateItem) error
FromInlineResourceCreateItem overwrites any union data inside the BaseResourceVariantCreateItem as the provided InlineResourceCreateItem
func (*BaseResourceVariantCreateItem) FromScmResource ¶
func (t *BaseResourceVariantCreateItem) FromScmResource(v ScmResource) error
FromScmResource overwrites any union data inside the BaseResourceVariantCreateItem as the provided ScmResource
func (*BaseResourceVariantCreateItem) FromSnykReferenceResource ¶
func (t *BaseResourceVariantCreateItem) FromSnykReferenceResource(v SnykReferenceResource) error
FromSnykReferenceResource overwrites any union data inside the BaseResourceVariantCreateItem as the provided SnykReferenceResource
func (*BaseResourceVariantCreateItem) FromUploadResource ¶
func (t *BaseResourceVariantCreateItem) FromUploadResource(v UploadResource) error
FromUploadResource overwrites any union data inside the BaseResourceVariantCreateItem as the provided UploadResource
func (BaseResourceVariantCreateItem) MarshalJSON ¶
func (t BaseResourceVariantCreateItem) MarshalJSON() ([]byte, error)
func (*BaseResourceVariantCreateItem) MergeBundleResource ¶
func (t *BaseResourceVariantCreateItem) MergeBundleResource(v BundleResource) error
MergeBundleResource performs a merge with any union data inside the BaseResourceVariantCreateItem, using the provided BundleResource
func (*BaseResourceVariantCreateItem) MergeContainerRepoResource ¶
func (t *BaseResourceVariantCreateItem) MergeContainerRepoResource(v ContainerRepoResource) error
MergeContainerRepoResource performs a merge with any union data inside the BaseResourceVariantCreateItem, using the provided ContainerRepoResource
func (*BaseResourceVariantCreateItem) MergeInlineResourceCreateItem ¶
func (t *BaseResourceVariantCreateItem) MergeInlineResourceCreateItem(v InlineResourceCreateItem) error
MergeInlineResourceCreateItem performs a merge with any union data inside the BaseResourceVariantCreateItem, using the provided InlineResourceCreateItem
func (*BaseResourceVariantCreateItem) MergeScmResource ¶
func (t *BaseResourceVariantCreateItem) MergeScmResource(v ScmResource) error
MergeScmResource performs a merge with any union data inside the BaseResourceVariantCreateItem, using the provided ScmResource
func (*BaseResourceVariantCreateItem) MergeSnykReferenceResource ¶
func (t *BaseResourceVariantCreateItem) MergeSnykReferenceResource(v SnykReferenceResource) error
MergeSnykReferenceResource performs a merge with any union data inside the BaseResourceVariantCreateItem, using the provided SnykReferenceResource
func (*BaseResourceVariantCreateItem) MergeUploadResource ¶
func (t *BaseResourceVariantCreateItem) MergeUploadResource(v UploadResource) error
MergeUploadResource performs a merge with any union data inside the BaseResourceVariantCreateItem, using the provided UploadResource
func (*BaseResourceVariantCreateItem) UnmarshalJSON ¶
func (t *BaseResourceVariantCreateItem) UnmarshalJSON(b []byte) error
func (BaseResourceVariantCreateItem) ValueByDiscriminator ¶
func (t BaseResourceVariantCreateItem) ValueByDiscriminator() (interface{}, error)
type BundleResource ¶
type BundleResource struct {
// BundleId The ID returned from the Files Bundle Store API for a given Bundle.
// The Deepcode Bundle API is not intended for direct public use,
// and will be replaced with the File Upload API in the future.
//
// These IDs are sha256 digests (32 bytes or 64 hex digits).
BundleId string `json:"bundle_id"`
// ContentType Content present in the Bundle.
//
// Currently only SBOMs and Source files are accepted
// content types.
ContentType BundleResourceContentType `json:"content_type"`
// FilePatterns File Patterns to include in the scan. Elements must be less than 256 characters.
//
// Currently unsupported. Provide an empty list.
FilePatterns []String256 `json:"file_patterns"`
// Name A name to assign to the SBOM contained in the BundleRevision.
//
// Overrides the filename in the BundleRevision.
Name *string `json:"name,omitempty"`
// RepositoryUrl Repository URL at which the Source files are stored.
RepositoryUrl *string `json:"repository_url,omitempty"`
// RootFolderId Folder inside the BundleRevision at which the Source files are located.
RootFolderId *string `json:"root_folder_id,omitempty"`
// ScmContext Additional SCM information about a resource.
// Provides context about where the content came from; the resource itself is the testable item.
// ScmResource does not use this; it identifies SCM via its own fields.
ScmContext *ScmContext `json:"scm_context,omitempty"`
Type BundleResourceType `json:"type"`
}
BundleResource Resource representing Bundles of files created through the Deepcode Bundle API.
Bundles contain collections of files uploaded by clients to Snyk for testing.
BundleResources can be marked either as SBOM or Source to indicate the contents of the Bundle.
SBOM BundleResources should provide the following fields: - type - bundle_id - name - file_patterns (may be empty)
Source BundleResources should provide the following fields: - type - bundle_id - repository_url - root_folder_id - file_patterns (may be empty)
Currently supported scans utilizing BundleResources are: - SAST: (1) BundleResource containing Source files. - SBOM (SCA): (1) BundleResource containing an SBOM - SBOM + Reachability Analysis (SCA): (1) BundleResource containing an SBOM, (1) BundleResource containing Source files.
type BundleResourceContentType ¶
type BundleResourceContentType string
BundleResourceContentType Content present in the Bundle.
Currently only SBOMs and Source files are accepted content types.
const ( BundleResourceContentTypeSbom BundleResourceContentType = "sbom" BundleResourceContentTypeSource BundleResourceContentType = "source" )
Defines values for BundleResourceContentType.
type BundleResourceType ¶
type BundleResourceType string
BundleResourceType defines model for BundleResource.Type.
const (
Bundle BundleResourceType = "bundle"
)
Defines values for BundleResourceType.
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) CreateTestWithApplicationVndAPIPlusJSONBody ¶
func (c *Client) CreateTestWithApplicationVndAPIPlusJSONBody(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, body CreateTestApplicationVndAPIPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateTestWithBody ¶
func (c *Client) CreateTestWithBody(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetAPIVersion ¶
func (*Client) GetJob ¶
func (c *Client) GetJob(ctx context.Context, orgId OrgIdParam, jobId JobIdParam, params *GetJobParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetTest ¶
func (c *Client) GetTest(ctx context.Context, orgId OrgIdParam, testId TestIdParam, params *GetTestParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ListAPIVersions ¶
func (*Client) ListFindings ¶
func (c *Client) ListFindings(ctx context.Context, orgId OrgIdParam, testId TestIdParam, params *ListFindingsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// ListAPIVersions request
ListAPIVersions(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetAPIVersion request
GetAPIVersion(ctx context.Context, version string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetJob request
GetJob(ctx context.Context, orgId OrgIdParam, jobId JobIdParam, params *GetJobParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateTestWithBody request with any body
CreateTestWithBody(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateTestWithApplicationVndAPIPlusJSONBody(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, body CreateTestApplicationVndAPIPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTest request
GetTest(ctx context.Context, orgId OrgIdParam, testId TestIdParam, params *GetTestParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListFindings request
ListFindings(ctx context.Context, orgId OrgIdParam, testId TestIdParam, params *ListFindingsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) CreateTestWithApplicationVndAPIPlusJSONBodyWithResponse ¶
func (c *ClientWithResponses) CreateTestWithApplicationVndAPIPlusJSONBodyWithResponse(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, body CreateTestApplicationVndAPIPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTestResponse, error)
func (*ClientWithResponses) CreateTestWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateTestWithBodyWithResponse(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTestResponse, error)
CreateTestWithBodyWithResponse request with arbitrary body returning *CreateTestResponse
func (*ClientWithResponses) GetAPIVersionWithResponse ¶
func (c *ClientWithResponses) GetAPIVersionWithResponse(ctx context.Context, version string, reqEditors ...RequestEditorFn) (*GetAPIVersionResponse, error)
GetAPIVersionWithResponse request returning *GetAPIVersionResponse
func (*ClientWithResponses) GetJobWithResponse ¶
func (c *ClientWithResponses) GetJobWithResponse(ctx context.Context, orgId OrgIdParam, jobId JobIdParam, params *GetJobParams, reqEditors ...RequestEditorFn) (*GetJobResponse, error)
GetJobWithResponse request returning *GetJobResponse
func (*ClientWithResponses) GetTestWithResponse ¶
func (c *ClientWithResponses) GetTestWithResponse(ctx context.Context, orgId OrgIdParam, testId TestIdParam, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error)
GetTestWithResponse request returning *GetTestResponse
func (*ClientWithResponses) ListAPIVersionsWithResponse ¶
func (c *ClientWithResponses) ListAPIVersionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAPIVersionsResponse, error)
ListAPIVersionsWithResponse request returning *ListAPIVersionsResponse
func (*ClientWithResponses) ListFindingsWithResponse ¶
func (c *ClientWithResponses) ListFindingsWithResponse(ctx context.Context, orgId OrgIdParam, testId TestIdParam, params *ListFindingsParams, reqEditors ...RequestEditorFn) (*ListFindingsResponse, error)
ListFindingsWithResponse request returning *ListFindingsResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// ListAPIVersionsWithResponse request
ListAPIVersionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAPIVersionsResponse, error)
// GetAPIVersionWithResponse request
GetAPIVersionWithResponse(ctx context.Context, version string, reqEditors ...RequestEditorFn) (*GetAPIVersionResponse, error)
// GetJobWithResponse request
GetJobWithResponse(ctx context.Context, orgId OrgIdParam, jobId JobIdParam, params *GetJobParams, reqEditors ...RequestEditorFn) (*GetJobResponse, error)
// CreateTestWithBodyWithResponse request with any body
CreateTestWithBodyWithResponse(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTestResponse, error)
CreateTestWithApplicationVndAPIPlusJSONBodyWithResponse(ctx context.Context, orgId OrgIdParam, params *CreateTestParams, body CreateTestApplicationVndAPIPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTestResponse, error)
// GetTestWithResponse request
GetTestWithResponse(ctx context.Context, orgId OrgIdParam, testId TestIdParam, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error)
// ListFindingsWithResponse request
ListFindingsWithResponse(ctx context.Context, orgId OrgIdParam, testId TestIdParam, params *ListFindingsParams, reqEditors ...RequestEditorFn) (*ListFindingsResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type ConfigOption ¶
type ConfigOption func(c *config)
ConfigOption allows setting custom parameters during construction
func WithAPIVersion ¶
func WithAPIVersion(v string) ConfigOption
WithAPIVersion sets the API version for the test client.
func WithCustomHTTPClient ¶
func WithCustomHTTPClient(doer HttpRequestDoer) ConfigOption
WithCustomHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithCustomRequestEditorFn ¶
func WithCustomRequestEditorFn(fn RequestEditorFn) ConfigOption
WithCustomRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
func WithJitterFunc ¶
func WithJitterFunc(fn func(time.Duration) time.Duration) ConfigOption
WithJitterFunc allows setting a custom jitter function for polling.
func WithLogger ¶
func WithLogger(l *zerolog.Logger) ConfigOption
WithLogger sets the logger for the test client.
func WithPollInterval ¶
func WithPollInterval(d time.Duration) ConfigOption
WithPollInterval sets the poll interval for the test client. Defaults to 2 seconds if unset or <= 0. Minimum interval is 1 second.
func WithPollTimeout ¶
func WithPollTimeout(d time.Duration) ConfigOption
WithPollTimeout sets the maximum total time for polling.
type ContainerRepoResource ¶
type ContainerRepoResource struct {
// ImageUrl URL at which the specific container image can be found
// in a container registry.
ImageUrl string `json:"image_url"`
// ScmContext Additional SCM information about a resource.
// Provides context about where the content came from; the resource itself is the testable item.
// ScmResource does not use this; it identifies SCM via its own fields.
ScmContext *ScmContext `json:"scm_context,omitempty"`
// Tag Tagged version of the container to scan.
Tag string `json:"tag"`
Type ContainerRepoResourceType `json:"type"`
}
ContainerRepoResource Resource representing a container repository.
Container Repos identify a specific container image in a container registry. These images can be scanned using the Snyk Container scanner.
Currently no scans are supported through the Test API for ContainerRepoResources.
type ContainerRepoResourceType ¶
type ContainerRepoResourceType string
ContainerRepoResourceType defines model for ContainerRepoResource.Type.
const (
Container ContainerRepoResourceType = "container"
)
Defines values for ContainerRepoResourceType.
type ContainerScanConfiguration ¶
type ContainerScanConfiguration = map[string]interface{}
ContainerScanConfiguration Scan configuration parameters for the Container scanner.
type CreateTest202DataType ¶
type CreateTest202DataType string
type CreateTestApplicationVndAPIPlusJSONRequestBody ¶
type CreateTestApplicationVndAPIPlusJSONRequestBody = TestRequestBody
CreateTestApplicationVndAPIPlusJSONRequestBody defines body for CreateTest for application/vnd.api+json ContentType.
type CreateTestParams ¶
type CreateTestParams struct {
// Version The API version requested.
Version IoSnykApiRequestSnykApiRequestVersion `form:"version" json:"version"`
// SnykRequestId A unique ID assigned to each API request, for tracing and troubleshooting.
//
// Snyk clients can optionally provide this ID.
SnykRequestId *IoSnykApiRequestSnykApiRequestRequestId `json:"snyk-request-id,omitempty"`
// SnykInteractionId Identifies the Snyk client interaction in which this API request occurs.
//
// The identifier is an opaque string. though at the time of writing it may either be a
// uuid or a urn containing a uuid and some metadata.
SnykInteractionId *IoSnykApiRequestSnykApiRequestInteractionId `json:"snyk-interaction-id,omitempty"`
}
CreateTestParams defines parameters for CreateTest.
type CreateTestResponse ¶
type CreateTestResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationvndApiJSON202 *struct {
Data struct {
// Attributes JobAttributes represents the attributes of a Job resource
Attributes JobAttributes `json:"attributes"`
Id openapi_types.UUID `json:"id"`
Type CreateTest202DataType `json:"type"`
} `json:"data"`
Jsonapi IoSnykApiCommonJsonApi `json:"jsonapi"`
Links CreateTest_202_Links `json:"links"`
// Meta Free-form object that may contain non-standard information.
Meta *IoSnykApiCommonMeta `json:"meta,omitempty"`
}
ApplicationvndApiJSON400 *IoSnykApiCommonErrorDocument
}
func ParseCreateTestResponse ¶
func ParseCreateTestResponse(rsp *http.Response) (*CreateTestResponse, error)
ParseCreateTestResponse parses an HTTP response from a CreateTestWithResponse call
func (CreateTestResponse) Status ¶
func (r CreateTestResponse) Status() string
Status returns HTTPResponse.Status
func (CreateTestResponse) StatusCode ¶
func (r CreateTestResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CreateTest_202_Links ¶
type CreateTest_202_Links struct {
Related *IoSnykApiCommonLinkProperty `json:"related,omitempty"`
Self *IoSnykApiCommonLinkProperty `json:"self,omitempty"`
AdditionalProperties map[string]IoSnykApiCommonLinkProperty `json:"-"`
}
type CveProblem ¶
type CveProblem struct {
Id string `json:"id"`
Source CveProblemSource `json:"source"`
}
CveProblem CVE designation according to the public Common Vulnerability Exposure database.
type CveProblemSource ¶
type CveProblemSource string
CveProblemSource defines model for CveProblem.Source.
const (
Cve CveProblemSource = "cve"
)
Defines values for CveProblemSource.
type CweProblem ¶
type CweProblem struct {
Id string `json:"id"`
Source CweProblemSource `json:"source"`
}
CweProblem CWE classification according to MITRE's Common Weakness Enumeration (CWE) database.
type CweProblemSource ¶
type CweProblemSource string
CweProblemSource defines model for CweProblem.Source.
const (
Cwe CweProblemSource = "cwe"
)
Defines values for CweProblemSource.
type DeepcodeBundleSubject ¶
type DeepcodeBundleSubject struct {
// BundleId Deepcode Bundle ID. These IDs are sha256 digests (32 bytes or 64 hex digits).
BundleId string `json:"bundle_id"`
// Locator Locate local paths from which the source code bundle was derived.
Locator LocalPathLocator `json:"locator"`
Type DeepcodeBundleSubjectType `json:"type"`
}
DeepcodeBundleSubject **Deprecated**
Provide a BundleResource and include the SAST Scan Configuration instead.
Test subject representing source code uploaded to Snyk using DeepCode bundle APIs.
Deepcode bundles are accepted through the API, but are not guaranteed to return Findings.
type DeepcodeBundleSubjectType ¶
type DeepcodeBundleSubjectType string
DeepcodeBundleSubjectType defines model for DeepcodeBundleSubject.Type.
const (
DeepcodeBundle DeepcodeBundleSubjectType = "deepcode_bundle"
)
Defines values for DeepcodeBundleSubjectType.
type DepGraphContent ¶
type DepGraphContent struct {
DepGraph IoSnykApiV1testdepgraphRequestDepGraph `json:"dep_graph"`
Type DepGraphContentType `json:"type"`
}
DepGraphContent Dep Graph file contents, of the same format as Dep Graphs provided to /v1/test-dep-graph endpoint.
type DepGraphContentType ¶
type DepGraphContentType string
DepGraphContentType defines model for DepGraphContent.Type.
const (
DepGraphContentTypeDepGraph DepGraphContentType = "dep_graph"
)
Defines values for DepGraphContentType.
type DepGraphSubject ¶
type DepGraphSubject struct {
// Locator Source file(s) from which the dependency graph was derived.
//
// For some managed package ecosystems (examples: Maven, Yarn workspaces),
// Snyk might derive a dependency graph from several files.
Locator LocalPathLocator `json:"locator"`
Type DepGraphSubjectType `json:"type"`
}
DepGraphSubject **Deprecated**
Provide an InlineResource with the DepGraph contents and the SCA Scan Configuration instead.
Test subject representing a Snyk dependency graph (a legacy SBOM format).
type DepGraphSubjectCreate ¶
type DepGraphSubjectCreate struct {
// DepGraph When creating a test, provide the dep-graph contents inline to the request.
//
// This attribute is only available when creating a new Test.
DepGraph IoSnykApiV1testdepgraphRequestDepGraph `json:"dep_graph"`
// Locator Source file(s) from which the dependency graph was derived.
//
// For some managed package ecosystems (examples: Maven, Yarn workspaces),
// Snyk might derive a dependency graph from several files.
Locator LocalPathLocator `json:"locator"`
Type DepGraphSubjectCreateType `json:"type"`
}
DepGraphSubjectCreate **Deprecated**
Provide an InlineResource with the DepGraph contents and the SCA Scan Configuration instead.
Test subject representing a Snyk dependency graph (a legacy SBOM format).
type DepGraphSubjectCreateType ¶
type DepGraphSubjectCreateType string
DepGraphSubjectCreateType defines model for DepGraphSubjectCreate.Type.
const (
DepGraph DepGraphSubjectCreateType = "dep_graph"
)
Defines values for DepGraphSubjectCreateType.
type DepGraphSubjectType ¶
type DepGraphSubjectType string
DepGraphSubjectType defines model for DepGraphSubject.Type.
const (
DepGraphSubjectTypeDepGraph DepGraphSubjectType = "dep_graph"
)
Defines values for DepGraphSubjectType.
type DependencyCountFact ¶
type DependencyCountFact struct {
TotalDependencyCount int64 `json:"total_dependency_count"`
Type DependencyCountFactType `json:"type"`
}
DependencyCountFact DependencyCountFact represents a dependency count fact.
type DependencyCountFactType ¶
type DependencyCountFactType string
DependencyCountFactType defines model for DependencyCountFact.Type.
const (
DependencyCountFactTypeDependencyCountFact DependencyCountFactType = "dependency_count_fact"
)
Defines values for DependencyCountFactType.
type DependencyPathEvidence ¶
type DependencyPathEvidence struct {
// Path Series of component identifiers starting from the top-level component tested,
// and ending in the vulnerable software component.
//
// The identifiers are domain-specific and determined by the test subject.
Path []Package `json:"path"`
Source DependencyPathEvidenceSource `json:"source"`
}
DependencyPathEvidence Dependency path to a software component within an SBOM dependency graph.
Finding types: SCA
type DependencyPathEvidenceSource ¶
type DependencyPathEvidenceSource string
DependencyPathEvidenceSource defines model for DependencyPathEvidence.Source.
const (
DependencyPath DependencyPathEvidenceSource = "dependency_path"
)
Defines values for DependencyPathEvidenceSource.
type Diff ¶
type Diff struct {
Format DiffFormat `json:"format"`
// Suggestions Alternative suggestions - choose one to fix the vulnerability.
// The 'rank' field signals the relative confidence in each one.
Suggestions []DiffSuggestion `json:"suggestions"`
}
Diff Fix suggestions in the unified diff format that introduce code changes to remediate the vulnerability.
type DiffFormat ¶
type DiffFormat string
DiffFormat defines model for Diff.Format.
const (
DiffFormatDiff DiffFormat = "diff"
)
Defines values for DiffFormat.
type DiffResource ¶
type DiffResource struct {
Base BaseResourceVariant `json:"base"`
Compare BaseResourceVariant `json:"compare"`
Type DiffResourceType `json:"type"`
}
DiffResource DiffResources contain two versions of the same content to compare against each other.
The Base and Compare fields contain Resources representing an "existing" (base) version as well as a "new" (compare) version. Most commonly these Resources will be of the same type, e.g. an ScmResource containing a reference the `main` branch being compared to an ScmResource containing a reference to a new feature branch.
Currently no scans are supported through the Test API for DiffResources.
type DiffResourceCreateItem ¶
type DiffResourceCreateItem struct {
Base BaseResourceVariantCreateItem `json:"base"`
Compare BaseResourceVariantCreateItem `json:"compare"`
Type DiffResourceCreateItemType `json:"type"`
}
DiffResourceCreateItem DiffResources contain two versions of the same content to compare against each other.
The Base and Compare fields contain Resources representing an "existing" (base) version as well as a "new" (compare) version. Most commonly these Resources will be of the same type, e.g. an ScmResource containing a reference the `main` branch being compared to an ScmResource containing a reference to a new feature branch.
Currently no scans are supported through the Test API for DiffResources.
type DiffResourceCreateItemType ¶
type DiffResourceCreateItemType string
DiffResourceCreateItemType defines model for DiffResourceCreateItem.Type.
const (
DiffResourceCreateItemTypeDiff DiffResourceCreateItemType = "diff"
)
Defines values for DiffResourceCreateItemType.
type DiffResourceType ¶
type DiffResourceType string
DiffResourceType defines model for DiffResource.Type.
const (
DiffResourceTypeDiff DiffResourceType = "diff"
)
Defines values for DiffResourceType.
type DiffSuggestion ¶
type DiffSuggestion struct {
// Diff Unified diff that contains changes for one or multiple files.
// It already contains file path, but this can be extracted as a separate field if needed.
Diff string `json:"diff"`
// ExternalId The fix suggestion identifier from an external source.
ExternalId *openapi_types.UUID `json:"external_id,omitempty"`
Rank *uint8 `json:"rank,omitempty"`
}
DiffSuggestion A suggestion in unified diff format representing the code changes to fix the vulnerability.
type Error ¶
type Error struct {
// Code An application-specific error code, expressed as a string value.
Code *string `json:"code,omitempty"`
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Id A unique identifier for this particular occurrence of the problem.
Id *openapi_types.UUID `json:"id,omitempty"`
// Links A link that leads to further details about this particular occurrance of the problem.
Links *ErrorLink `json:"links,omitempty"`
Meta *map[string]interface{} `json:"meta,omitempty"`
Source *struct {
// Parameter A string indicating which URI query parameter caused the error.
Parameter *string `json:"parameter,omitempty"`
// Pointer A JSON Pointer [RFC6901] to the associated entity in the request document.
Pointer *string `json:"pointer,omitempty"`
} `json:"source,omitempty"`
// Status The HTTP status code applicable to this problem, expressed as a string value.
Status string `json:"status"`
// Title A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
Title *string `json:"title,omitempty"`
}
Error defines model for Error.
type ErrorDocument ¶
ErrorDocument defines model for ErrorDocument.
type ErrorLink ¶
type ErrorLink struct {
About *LinkProperty `json:"about,omitempty"`
}
ErrorLink A link that leads to further details about this particular occurrance of the problem.
type Evidence ¶
type Evidence struct {
// contains filtered or unexported fields
}
Evidence Supporting evidence for (rather than representative of) the finding in other security domains and systems, lacking a well-known identifier.
More detailed attributes may also be included inline, especially when this information is not yet generally available in a well-known public APIs.
Examples include: - Detailed enumeration of dependency paths - Execution flows leading to a code rule violation
func (Evidence) AsDependencyPathEvidence ¶
func (t Evidence) AsDependencyPathEvidence() (DependencyPathEvidence, error)
AsDependencyPathEvidence returns the union data inside the Evidence as a DependencyPathEvidence
func (Evidence) AsExecutionFlowEvidence ¶
func (t Evidence) AsExecutionFlowEvidence() (ExecutionFlowEvidence, error)
AsExecutionFlowEvidence returns the union data inside the Evidence as a ExecutionFlowEvidence
func (Evidence) AsOtherEvidence ¶
func (t Evidence) AsOtherEvidence() (OtherEvidence, error)
AsOtherEvidence returns the union data inside the Evidence as a OtherEvidence
func (Evidence) AsReachabilityEvidence ¶
func (t Evidence) AsReachabilityEvidence() (ReachabilityEvidence, error)
AsReachabilityEvidence returns the union data inside the Evidence as a ReachabilityEvidence
func (Evidence) Discriminator ¶
func (*Evidence) FromDependencyPathEvidence ¶
func (t *Evidence) FromDependencyPathEvidence(v DependencyPathEvidence) error
FromDependencyPathEvidence overwrites any union data inside the Evidence as the provided DependencyPathEvidence
func (*Evidence) FromExecutionFlowEvidence ¶
func (t *Evidence) FromExecutionFlowEvidence(v ExecutionFlowEvidence) error
FromExecutionFlowEvidence overwrites any union data inside the Evidence as the provided ExecutionFlowEvidence
func (*Evidence) FromOtherEvidence ¶
func (t *Evidence) FromOtherEvidence(v OtherEvidence) error
FromOtherEvidence overwrites any union data inside the Evidence as the provided OtherEvidence
func (*Evidence) FromReachabilityEvidence ¶
func (t *Evidence) FromReachabilityEvidence(v ReachabilityEvidence) error
FromReachabilityEvidence overwrites any union data inside the Evidence as the provided ReachabilityEvidence
func (Evidence) MarshalJSON ¶
func (*Evidence) MergeDependencyPathEvidence ¶
func (t *Evidence) MergeDependencyPathEvidence(v DependencyPathEvidence) error
MergeDependencyPathEvidence performs a merge with any union data inside the Evidence, using the provided DependencyPathEvidence
func (*Evidence) MergeExecutionFlowEvidence ¶
func (t *Evidence) MergeExecutionFlowEvidence(v ExecutionFlowEvidence) error
MergeExecutionFlowEvidence performs a merge with any union data inside the Evidence, using the provided ExecutionFlowEvidence
func (*Evidence) MergeOtherEvidence ¶
func (t *Evidence) MergeOtherEvidence(v OtherEvidence) error
MergeOtherEvidence performs a merge with any union data inside the Evidence, using the provided OtherEvidence
func (*Evidence) MergeReachabilityEvidence ¶
func (t *Evidence) MergeReachabilityEvidence(v ReachabilityEvidence) error
MergeReachabilityEvidence performs a merge with any union data inside the Evidence, using the provided ReachabilityEvidence
func (*Evidence) UnmarshalJSON ¶
func (Evidence) ValueByDiscriminator ¶
type ExecutionFlowEvidence ¶
type ExecutionFlowEvidence struct {
// Flow Sequence of locations within this flow of execution.
//
// For example, a sequence of locations connecting the "source" location
// where input data is obtained, to a "sink" location where it is used.
Flow []FileRegion `json:"flow"`
Source ExecutionFlowEvidenceSource `json:"source"`
}
ExecutionFlowEvidence Indicate a program flow of execution as additional evidence for the finding.
type ExecutionFlowEvidenceSource ¶
type ExecutionFlowEvidenceSource string
ExecutionFlowEvidenceSource defines model for ExecutionFlowEvidence.Source.
const (
ExecutionFlow ExecutionFlowEvidenceSource = "execution_flow"
)
Defines values for ExecutionFlowEvidenceSource.
type FileRegion ¶
type FileRegion struct {
// FilePath File path for the code snippet.
FilePath string `json:"file_path"`
// FromColumn Column on which the snippet starts.
FromColumn *int `json:"from_column,omitempty"`
// FromLine Line in the file where the code snippet starts.
FromLine int `json:"from_line"`
// ToColumn Column at which the code snippet ends.
ToColumn *int `json:"to_column,omitempty"`
// ToLine Line on which the code snippet ends.
ToLine *int `json:"to_line,omitempty"`
}
FileRegion FileRegion models a location where vulnerable code is found.
type FindingAttributes ¶
type FindingAttributes struct {
// CauseOfFailure Did this finding cause the test outcome to fail?
CauseOfFailure bool `json:"cause_of_failure"`
// ComponentKey A test-scoped key referring to the component in which the Finding
// originated.
//
// Component keys are unique only within a Test.
ComponentKey *String256 `json:"component_key,omitempty"`
// Description A longer human-readable text description for this finding.
Description string `json:"description"`
// Evidence Supporting evidence for (rather than representative of) the finding in
// other security domains and systems, lacking a well-known identifier.
Evidence []Evidence `json:"evidence"`
// FindingType Type of finding.
FindingType FindingType `json:"finding_type"`
// Key An opaque key used for aggregating the finding across multiple test
// executions operating on the same or originating Asset.
//
// Findings within a Test execution are aggregated by this key.
Key string `json:"key"`
// Locations Locations in the tested component's contents where the finding may be found.
Locations []FindingLocation `json:"locations"`
// PolicyModifications Attributes which have been modified by policy decisions.
PolicyModifications *[]PolicyModification `json:"policy_modifications,omitempty"`
// Problems Problems are representative of the finding in other security domains and
// systems with a well-known identifier.
Problems []Problem `json:"problems"`
// Rating Qualitative ratings on a finding.
Rating Rating `json:"rating"`
// Risk Qualitative risk analysis on a finding.
Risk Risk `json:"risk"`
// Suppression Indication of whether a finding is suppressed by a policy decision.
Suppression *Suppression `json:"suppression,omitempty"`
// Title A human-readable title for this finding.
Title string `json:"title"`
}
FindingAttributes FindingAttributes represent the attributes of a Finding resource.
type FindingData ¶
type FindingData struct {
Attributes *FindingAttributes `json:"attributes,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
// Links Links to external resources outside this API.
//
// Because these are not REST API resources, they are expressed here as links,
// rather than as relationships.
Links *struct {
// SnykAdvisory Link to Snyk's vulnerability advisory for more information on the
// finding, if applicable.
SnykAdvisory *IoSnykApiCommonLinkProperty `json:"snyk_advisory,omitempty"`
// SnykLearn Link to a Snyk Learn lesson relevant to the finding, if applicable.
SnykLearn *IoSnykApiCommonLinkProperty `json:"snyk_learn,omitempty"`
} `json:"links,omitempty"`
Relationships *struct {
// Asset Originating asset in which this finding was discovered.
Asset *struct {
Data *struct {
Id openapi_types.UUID `json:"id"`
Type string `json:"type"`
} `json:"data,omitempty"`
Links IoSnykApiCommonRelatedLink `json:"links"`
// Meta Free-form object that may contain non-standard information.
Meta *IoSnykApiCommonMeta `json:"meta,omitempty"`
} `json:"asset,omitempty"`
// Fix Fix for this finding, it comes expanded with all data preloaded
Fix *struct {
Data *struct {
// Attributes Inlined attributes included in the relationship, if it is expanded.
//
// Expansion is a Snyk variation on JSON API. See
// https://snyk.roadie.so/docs/default/component/sweater-comb/standards/rest/#expansion
Attributes *FixAttributes `json:"attributes,omitempty"`
Id openapi_types.UUID `json:"id"`
Type string `json:"type"`
} `json:"data,omitempty"`
} `json:"fix,omitempty"`
// Org Snyk organization scope in which the finding was discovered.
Org *struct {
Data *struct {
Id openapi_types.UUID `json:"id"`
Type string `json:"type"`
} `json:"data,omitempty"`
} `json:"org,omitempty"`
// Policy Relate to the policy or policies applied to this finding.
Policy *struct {
Data *struct {
// Attributes Inlined attributes included in the relationship, if it is expanded.
//
// Expansion is a Snyk variation on JSON API. See
// https://snyk.roadie.so/docs/default/component/sweater-comb/standards/rest/#expansion
Attributes *PolicyAttributes `json:"attributes,omitempty"`
Id openapi_types.UUID `json:"id"`
Type string `json:"type"`
} `json:"data,omitempty"`
Links IoSnykApiCommonRelatedLink `json:"links"`
// Meta Free-form object that may contain non-standard information.
Meta *IoSnykApiCommonMeta `json:"meta,omitempty"`
} `json:"policy,omitempty"`
// Project Snyk Project in which the Finding was discovered
Project *struct {
Data *struct {
Id openapi_types.UUID `json:"id"`
Type string `json:"type"`
} `json:"data,omitempty"`
} `json:"project,omitempty"`
// Test Test in which this finding was discovered.
Test *struct {
Data *struct {
Id openapi_types.UUID `json:"id"`
Type string `json:"type"`
} `json:"data,omitempty"`
Links IoSnykApiCommonRelatedLink `json:"links"`
// Meta Free-form object that may contain non-standard information.
Meta *IoSnykApiCommonMeta `json:"meta,omitempty"`
} `json:"test,omitempty"`
} `json:"relationships,omitempty"`
Type *FindingDataType `json:"type,omitempty"`
}
FindingData FindingData represents a Finding resource object.
func (*FindingData) GetIgnoreDetails ¶
func (f *FindingData) GetIgnoreDetails() IssueIgnoreDetails
type FindingDataType ¶
type FindingDataType string
FindingDataType defines model for FindingData.Type.
const (
Findings FindingDataType = "findings"
)
Defines values for FindingDataType.
type FindingLocation ¶
type FindingLocation struct {
// contains filtered or unexported fields
}
FindingLocation Location within an Subject's contents where the finding was discovered.
func (FindingLocation) AsOtherLocation ¶
func (t FindingLocation) AsOtherLocation() (OtherLocation, error)
AsOtherLocation returns the union data inside the FindingLocation as a OtherLocation
func (FindingLocation) AsPackageLocation ¶
func (t FindingLocation) AsPackageLocation() (PackageLocation, error)
AsPackageLocation returns the union data inside the FindingLocation as a PackageLocation
func (FindingLocation) AsSourceLocation ¶
func (t FindingLocation) AsSourceLocation() (SourceLocation, error)
AsSourceLocation returns the union data inside the FindingLocation as a SourceLocation
func (FindingLocation) Discriminator ¶
func (t FindingLocation) Discriminator() (string, error)
func (*FindingLocation) FromOtherLocation ¶
func (t *FindingLocation) FromOtherLocation(v OtherLocation) error
FromOtherLocation overwrites any union data inside the FindingLocation as the provided OtherLocation
func (*FindingLocation) FromPackageLocation ¶
func (t *FindingLocation) FromPackageLocation(v PackageLocation) error
FromPackageLocation overwrites any union data inside the FindingLocation as the provided PackageLocation
func (*FindingLocation) FromSourceLocation ¶
func (t *FindingLocation) FromSourceLocation(v SourceLocation) error
FromSourceLocation overwrites any union data inside the FindingLocation as the provided SourceLocation
func (FindingLocation) MarshalJSON ¶
func (t FindingLocation) MarshalJSON() ([]byte, error)
func (*FindingLocation) MergeOtherLocation ¶
func (t *FindingLocation) MergeOtherLocation(v OtherLocation) error
MergeOtherLocation performs a merge with any union data inside the FindingLocation, using the provided OtherLocation
func (*FindingLocation) MergePackageLocation ¶
func (t *FindingLocation) MergePackageLocation(v PackageLocation) error
MergePackageLocation performs a merge with any union data inside the FindingLocation, using the provided PackageLocation
func (*FindingLocation) MergeSourceLocation ¶
func (t *FindingLocation) MergeSourceLocation(v SourceLocation) error
MergeSourceLocation performs a merge with any union data inside the FindingLocation, using the provided SourceLocation
func (*FindingLocation) UnmarshalJSON ¶
func (t *FindingLocation) UnmarshalJSON(b []byte) error
func (FindingLocation) ValueByDiscriminator ¶
func (t FindingLocation) ValueByDiscriminator() (interface{}, error)
type FindingSummary ¶
type FindingSummary struct {
// Count Total count of findings.
Count uint32 `json:"count"`
// CountBy Counts of findings grouped by various finding attributes.
//
// The outer record is keyed by finding attribute name. The value is a record
// keyed by distinct values of this attribute, whose value is the number of
// findings with a distinct value.
CountBy *map[string]map[string]uint32 `json:"count_by,omitempty"`
}
FindingSummary Summary of findings found by the Test.
type FindingType ¶
type FindingType string
FindingType Type of Finding which was discovered.
const ( FindingTypeConfig FindingType = "config" FindingTypeDast FindingType = "dast" FindingTypeOther FindingType = "other" FindingTypeSast FindingType = "sast" FindingTypeSca FindingType = "sca" FindingTypeSecret FindingType = "secret" FindingTypeSecrets FindingType = "secrets" )
Defines values for FindingType.
type FixAction ¶
type FixAction struct {
// contains filtered or unexported fields
}
FixAction Different fix formats in which the fix action is represented. We distinguish between advice and diff formats.
Advice - Fix advice in a display only / informational format. These are highly product line specific, so they have their own model. - upgradePackageAdvice: Upgrade a direct package from one version to a newer one that resolves the vulnerability. - pinPackageAdvice: Pin a package at a specific version.
Diff - Fix suggestions in the unified diff format that introduce code changes to remediate the vulnerability. Can be used to represent fix actions for any product line.
func (FixAction) AsPinPackageAdvice ¶
func (t FixAction) AsPinPackageAdvice() (PinPackageAdvice, error)
AsPinPackageAdvice returns the union data inside the FixAction as a PinPackageAdvice
func (FixAction) AsUpgradePackageAdvice ¶
func (t FixAction) AsUpgradePackageAdvice() (UpgradePackageAdvice, error)
AsUpgradePackageAdvice returns the union data inside the FixAction as a UpgradePackageAdvice
func (FixAction) Discriminator ¶
func (*FixAction) FromDiff ¶
FromDiff overwrites any union data inside the FixAction as the provided Diff
func (*FixAction) FromPinPackageAdvice ¶
func (t *FixAction) FromPinPackageAdvice(v PinPackageAdvice) error
FromPinPackageAdvice overwrites any union data inside the FixAction as the provided PinPackageAdvice
func (*FixAction) FromUpgradePackageAdvice ¶
func (t *FixAction) FromUpgradePackageAdvice(v UpgradePackageAdvice) error
FromUpgradePackageAdvice overwrites any union data inside the FixAction as the provided UpgradePackageAdvice
func (FixAction) MarshalJSON ¶
func (*FixAction) MergeDiff ¶
MergeDiff performs a merge with any union data inside the FixAction, using the provided Diff
func (*FixAction) MergePinPackageAdvice ¶
func (t *FixAction) MergePinPackageAdvice(v PinPackageAdvice) error
MergePinPackageAdvice performs a merge with any union data inside the FixAction, using the provided PinPackageAdvice
func (*FixAction) MergeUpgradePackageAdvice ¶
func (t *FixAction) MergeUpgradePackageAdvice(v UpgradePackageAdvice) error
MergeUpgradePackageAdvice performs a merge with any union data inside the FixAction, using the provided UpgradePackageAdvice
func (*FixAction) UnmarshalJSON ¶
func (FixAction) ValueByDiscriminator ¶
type FixAppliedOutcome ¶
type FixAppliedOutcome string
FixAppliedOutcome Indicates the outcome of a fix in terms of resolving the finding at hand
const ( FullyResolved FixAppliedOutcome = "fully_resolved" PartiallyResolved FixAppliedOutcome = "partially_resolved" Unresolved FixAppliedOutcome = "unresolved" )
Defines values for FixAppliedOutcome.
type FixAttributes ¶
type FixAttributes struct {
// Action Applying the steps specified by the action within the fix leads to resolving either completely or partially this finding.
// An action may be a simple upgrade, a code swap, or may model sets of boolean operations.
//
// For now only simple actions are modelled but could be extended to include more complex actions in the future.
// See doc for more info: https://docs.google.com/document/d/151vAXurvX4k8fNOWspSI2Ou9OF1G5fj8LHa-NuKOfgw
Action *FixAction `json:"action,omitempty"`
// Outcome Indicates whether applying these actions will address the finding or not
Outcome FixAppliedOutcome `json:"outcome"`
}
FixAttributes FixAttributes is the main payload modelling a fix
type GetAPIVersionResponse ¶
type GetAPIVersionResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *map[string]interface{}
ApplicationvndApiJSON400 *N400
ApplicationvndApiJSON401 *N401
ApplicationvndApiJSON404 *N404
ApplicationvndApiJSON500 *N500
}
func ParseGetAPIVersionResponse ¶
func ParseGetAPIVersionResponse(rsp *http.Response) (*GetAPIVersionResponse, error)
ParseGetAPIVersionResponse parses an HTTP response from a GetAPIVersionWithResponse call
func (GetAPIVersionResponse) Status ¶
func (r GetAPIVersionResponse) Status() string
Status returns HTTPResponse.Status
func (GetAPIVersionResponse) StatusCode ¶
func (r GetAPIVersionResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetJobParams ¶
type GetJobParams struct {
// Version The API version requested.
Version IoSnykApiRequestSnykApiRequestVersion `form:"version" json:"version"`
// SnykRequestId A unique ID assigned to each API request, for tracing and troubleshooting.
//
// Snyk clients can optionally provide this ID.
SnykRequestId *IoSnykApiRequestSnykApiRequestRequestId `json:"snyk-request-id,omitempty"`
// SnykInteractionId Identifies the Snyk client interaction in which this API request occurs.
//
// The identifier is an opaque string. though at the time of writing it may either be a
// uuid or a urn containing a uuid and some metadata.
SnykInteractionId *IoSnykApiRequestSnykApiRequestInteractionId `json:"snyk-interaction-id,omitempty"`
}
GetJobParams defines parameters for GetJob.
type GetJobResponse ¶
type GetJobResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationvndApiJSON200 *struct {
// Data JobData represents a Job resource object.
Data JobData `json:"data"`
Jsonapi IoSnykApiCommonJsonApi `json:"jsonapi"`
Links GetJob_200_Links `json:"links"`
// Meta Free-form object that may contain non-standard information.
Meta *IoSnykApiCommonMeta `json:"meta,omitempty"`
}
ApplicationvndApiJSON303 *struct {
// Data JobData represents a Job resource object.
Data JobData `json:"data"`
Jsonapi IoSnykApiCommonJsonApi `json:"jsonapi"`
Links GetJob_303_Links `json:"links"`
// Meta Free-form object that may contain non-standard information.
Meta *IoSnykApiCommonMeta `json:"meta,omitempty"`
}
ApplicationvndApiJSON400 *IoSnykApiCommonErrorDocument
}
func ParseGetJobResponse ¶
func ParseGetJobResponse(rsp *http.Response) (*GetJobResponse, error)
ParseGetJobResponse parses an HTTP response from a GetJobWithResponse call
func (GetJobResponse) Status ¶
func (r GetJobResponse) Status() string
Status returns HTTPResponse.Status
func (GetJobResponse) StatusCode ¶
func (r GetJobResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetJob_200_Links ¶
type GetJob_200_Links struct {
Related *IoSnykApiCommonLinkProperty `json:"related,omitempty"`
Self *IoSnykApiCommonLinkProperty `json:"self,omitempty"`
AdditionalProperties map[string]IoSnykApiCommonLinkProperty `json:"-"`
}
type GetJob_303_Links ¶
type GetJob_303_Links struct {
Related *IoSnykApiCommonLinkProperty `json:"related,omitempty"`
Self *IoSnykApiCommonLinkProperty `json:"self,omitempty"`
AdditionalProperties map[string]IoSnykApiCommonLinkProperty `json:"-"`
}
type GetTestParams ¶
type GetTestParams struct {
// Version The API version requested.
Version IoSnykApiRequestSnykApiRequestVersion `form:"version" json:"version"`
// SnykRequestId A unique ID assigned to each API request, for tracing and troubleshooting.
//
// Snyk clients can optionally provide this ID.
SnykRequestId *IoSnykApiRequestSnykApiRequestRequestId `json:"snyk-request-id,omitempty"`
// SnykInteractionId Identifies the Snyk client interaction in which this API request occurs.
//
// The identifier is an opaque string. though at the time of writing it may either be a
// uuid or a urn containing a uuid and some metadata.
SnykInteractionId *IoSnykApiRequestSnykApiRequestInteractionId `json:"snyk-interaction-id,omitempty"`
}
GetTestParams defines parameters for GetTest.
type GetTestResponse ¶
type GetTestResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationvndApiJSON200 *struct {
// Data TestData represents a Test resource object.
Data TestData `json:"data"`
Jsonapi IoSnykApiCommonJsonApi `json:"jsonapi"`
Links GetTest_200_Links `json:"links"`
// Meta Free-form object that may contain non-standard information.
Meta *IoSnykApiCommonMeta `json:"meta,omitempty"`
}
ApplicationvndApiJSON400 *IoSnykApiCommonErrorDocument
}
func ParseGetTestResponse ¶
func ParseGetTestResponse(rsp *http.Response) (*GetTestResponse, error)
ParseGetTestResponse parses an HTTP response from a GetTestWithResponse call
func (GetTestResponse) Status ¶
func (r GetTestResponse) Status() string
Status returns HTTPResponse.Status
func (GetTestResponse) StatusCode ¶
func (r GetTestResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTest_200_Links ¶
type GetTest_200_Links struct {
Related *IoSnykApiCommonLinkProperty `json:"related,omitempty"`
Self *IoSnykApiCommonLinkProperty `json:"self,omitempty"`
AdditionalProperties map[string]IoSnykApiCommonLinkProperty `json:"-"`
}
type GitUrlCoordinatesSubject ¶
type GitUrlCoordinatesSubject struct {
// CommitId Commit ID of the Git commit from which content will be retrieved for the
// test.
CommitId string `json:"commit_id"`
// IntegrationId Integration used to access the Git SCM repository in order to retrieve its source contents.
IntegrationId openapi_types.UUID `json:"integration_id"`
// Locator Locate the SCM repository from which content will be retrieved for the
// test.
Locator ScmRepoLocator `json:"locator"`
Type GitUrlCoordinatesSubjectType `json:"type"`
}
GitUrlCoordinatesSubject **Deprecated**
Provide an ScmResource and include the SAST Scan Configuration instead.
Test subject representing a source tree located in a Git repository that has a Snyk SCM integration.
Git URL coordinates are accepted through the API, but are not guaranteed to return Findings.
type GitUrlCoordinatesSubjectType ¶
type GitUrlCoordinatesSubjectType string
GitUrlCoordinatesSubjectType defines model for GitUrlCoordinatesSubject.Type.
const (
GitUrlCoordinates GitUrlCoordinatesSubjectType = "git_url_coordinates"
)
Defines values for GitUrlCoordinatesSubjectType.
type GithubSecurityAdvisoryProblem ¶
type GithubSecurityAdvisoryProblem struct {
Id string `json:"id"`
Source GithubSecurityAdvisoryProblemSource `json:"source"`
}
GithubSecurityAdvisoryProblem Github Security Advisory associated with this finding.
type GithubSecurityAdvisoryProblemSource ¶
type GithubSecurityAdvisoryProblemSource string
GithubSecurityAdvisoryProblemSource defines model for GithubSecurityAdvisoryProblem.Source.
const (
Ghsa GithubSecurityAdvisoryProblemSource = "ghsa"
)
Defines values for GithubSecurityAdvisoryProblemSource.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type IacScanConfiguration ¶
type IacScanConfiguration = map[string]interface{}
IacScanConfiguration Scan configuration parameters for the IAC scanner.
type Ignore ¶
type Ignore struct {
ActionType IgnoreActionType `json:"action_type"`
Ignore IgnoreDetails `json:"ignore"`
// PolicyRef Reference to a policy, serving as a container for a set of policy-rules and can be owned by the group or the org.
PolicyRef *SnykPolicyRef `json:"policy_ref,omitempty"`
// Rule A policy rule is the central entity of a policy, including an action as well as conditions
// when this policy applies.
// Only a subset of fields are included, for more details see the API documentation
// https://apidocs.snyk.io/?version=2024-10-15#get-/orgs/-org_id-/policies/-policy_id-
Rule *PolicyRule `json:"rule,omitempty"`
}
Ignore defines model for Ignore.
type IgnoreActionType ¶
type IgnoreActionType string
IgnoreActionType defines model for Ignore.ActionType.
const (
IgnoreActionTypeIgnore IgnoreActionType = "ignore"
)
Defines values for IgnoreActionType.
type IgnoreDetails ¶
type IgnoreDetails struct {
Created *time.Time `json:"created,omitempty"`
// DisregardIfFixable Disregards the policy if set to true and the finding this policy is applied to is fixable
DisregardIfFixable *bool `json:"disregard_if_fixable,omitempty"`
Expires *time.Time `json:"expires,omitempty"`
IgnoredBy *IgnoredBy `json:"ignored_by,omitempty"`
Path *[]string `json:"path,omitempty"`
Reason string `json:"reason"`
ReasonType *IgnoreDetailsReasonType `json:"reason_type,omitempty"`
Source string `json:"source"`
}
IgnoreDetails defines model for IgnoreDetails.
type IgnoreDetailsReasonType ¶
type IgnoreDetailsReasonType string
IgnoreDetailsReasonType defines model for IgnoreDetails.ReasonType.
const ( NotVulnerable IgnoreDetailsReasonType = "not-vulnerable" TemporaryIgnore IgnoreDetailsReasonType = "temporary-ignore" WontFix IgnoreDetailsReasonType = "wont-fix" )
Defines values for IgnoreDetailsReasonType.
type IgnoredBy ¶
type IgnoredBy struct {
// Email Email of the user who created the ignore
Email *string `json:"email,omitempty"`
// Id User ID of the author of the ignore
Id openapi_types.UUID `json:"id"`
// Name Name of the user who created the ignore
Name string `json:"name"`
}
IgnoredBy defines model for IgnoredBy.
type InlineContent ¶
type InlineContent = DepGraphContent
InlineContent Dep Graph file contents, of the same format as Dep Graphs provided to /v1/test-dep-graph endpoint.
type InlineResource ¶
type InlineResource struct {
Name string `json:"name"`
// ScmContext Additional SCM information about a resource.
// Provides context about where the content came from; the resource itself is the testable item.
// ScmResource does not use this; it identifies SCM via its own fields.
ScmContext *ScmContext `json:"scm_context,omitempty"`
Type InlineResourceType `json:"type"`
}
InlineResource Resource comprised of file contents included directly in a request body.
Currently supported scans utilizing InlineResources are: - SCA (Open Source): (1) InlineResource containing a Dep Graph
type InlineResourceCreateItem ¶
type InlineResourceCreateItem struct {
// Content File contents to be tested.
Content InlineContent `json:"content"`
Name string `json:"name"`
// ScmContext Additional SCM information about a resource.
// Provides context about where the content came from; the resource itself is the testable item.
// ScmResource does not use this; it identifies SCM via its own fields.
ScmContext *ScmContext `json:"scm_context,omitempty"`
Type InlineResourceCreateItemType `json:"type"`
}
InlineResourceCreateItem Resource comprised of file contents included directly in a request body.
Currently supported scans utilizing InlineResources are: - SCA (Open Source): (1) InlineResource containing a Dep Graph
type InlineResourceCreateItemType ¶
type InlineResourceCreateItemType string
InlineResourceCreateItemType defines model for InlineResourceCreateItem.Type.
const (
InlineResourceCreateItemTypeInline InlineResourceCreateItemType = "inline"
)
Defines values for InlineResourceCreateItemType.
type InlineResourceType ¶
type InlineResourceType string
InlineResourceType defines model for InlineResource.Type.
const (
InlineResourceTypeInline InlineResourceType = "inline"
)
Defines values for InlineResourceType.
type IoSnykApiCommonError ¶
type IoSnykApiCommonError struct {
// Code An application-specific error code, expressed as a string value.
Code *string `json:"code,omitempty"`
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail string `json:"detail"`
// Id A unique identifier for this particular occurrence of the problem.
Id *openapi_types.UUID `json:"id,omitempty"`
// Links A link that leads to further details about this particular occurrance of the problem.
Links *IoSnykApiCommonErrorLink `json:"links,omitempty"`
Meta *map[string]interface{} `json:"meta,omitempty"`
Source *struct {
Parameter *string `json:"parameter,omitempty"`
Pointer *string `json:"pointer,omitempty"`
} `json:"source,omitempty"`
// Status The HTTP status code applicable to this problem, expressed as a string value.
Status string `json:"status"`
// Title A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
Title *string `json:"title,omitempty"`
}
IoSnykApiCommonError defines model for io.snyk.api.common.Error.
type IoSnykApiCommonErrorDocument ¶
type IoSnykApiCommonErrorDocument struct {
Errors []IoSnykApiCommonError `json:"errors"`
Jsonapi IoSnykApiCommonJsonApi `json:"jsonapi"`
}
IoSnykApiCommonErrorDocument defines model for io.snyk.api.common.ErrorDocument.
type IoSnykApiCommonErrorLink ¶
type IoSnykApiCommonErrorLink struct {
About *IoSnykApiCommonLinkProperty `json:"about,omitempty"`
AdditionalProperties map[string]IoSnykApiCommonLinkProperty `json:"-"`
}
IoSnykApiCommonErrorLink A link that leads to further details about this particular occurrance of the problem.
func (IoSnykApiCommonErrorLink) Get ¶
func (a IoSnykApiCommonErrorLink) Get(fieldName string) (value IoSnykApiCommonLinkProperty, found bool)
Getter for additional properties for IoSnykApiCommonErrorLink. Returns the specified element and whether it was found
func (IoSnykApiCommonErrorLink) MarshalJSON ¶
func (a IoSnykApiCommonErrorLink) MarshalJSON() ([]byte, error)
Override default JSON handling for IoSnykApiCommonErrorLink to handle AdditionalProperties
func (*IoSnykApiCommonErrorLink) Set ¶
func (a *IoSnykApiCommonErrorLink) Set(fieldName string, value IoSnykApiCommonLinkProperty)
Setter for additional properties for IoSnykApiCommonErrorLink
func (*IoSnykApiCommonErrorLink) UnmarshalJSON ¶
func (a *IoSnykApiCommonErrorLink) UnmarshalJSON(b []byte) error
Override default JSON handling for IoSnykApiCommonErrorLink to handle AdditionalProperties
type IoSnykApiCommonJsonApi ¶
type IoSnykApiCommonJsonApi struct {
// Version Version of the JSON API specification this server supports.
Version IoSnykApiCommonJsonApiVersion `json:"version"`
}
IoSnykApiCommonJsonApi defines model for io.snyk.api.common.JsonApi.
type IoSnykApiCommonJsonApiVersion ¶
type IoSnykApiCommonJsonApiVersion string
IoSnykApiCommonJsonApiVersion Version of the JSON API specification this server supports.
const (
N10 IoSnykApiCommonJsonApiVersion = "1.0"
)
Defines values for IoSnykApiCommonJsonApiVersion.
type IoSnykApiCommonLinkObject ¶
type IoSnykApiCommonLinkObject struct {
Href IoSnykApiCommonLinkString `json:"href"`
// Meta Free-form object that may contain non-standard information.
Meta *IoSnykApiCommonMeta `json:"meta,omitempty"`
}
IoSnykApiCommonLinkObject defines model for io.snyk.api.common.LinkObject.
type IoSnykApiCommonLinkProperty ¶
type IoSnykApiCommonLinkProperty struct {
// contains filtered or unexported fields
}
IoSnykApiCommonLinkProperty defines model for io.snyk.api.common.LinkProperty.
func (IoSnykApiCommonLinkProperty) AsIoSnykApiCommonLinkObject ¶
func (t IoSnykApiCommonLinkProperty) AsIoSnykApiCommonLinkObject() (IoSnykApiCommonLinkObject, error)
AsIoSnykApiCommonLinkObject returns the union data inside the IoSnykApiCommonLinkProperty as a IoSnykApiCommonLinkObject
func (IoSnykApiCommonLinkProperty) AsIoSnykApiCommonLinkString ¶
func (t IoSnykApiCommonLinkProperty) AsIoSnykApiCommonLinkString() (IoSnykApiCommonLinkString, error)
AsIoSnykApiCommonLinkString returns the union data inside the IoSnykApiCommonLinkProperty as a IoSnykApiCommonLinkString
func (*IoSnykApiCommonLinkProperty) FromIoSnykApiCommonLinkObject ¶
func (t *IoSnykApiCommonLinkProperty) FromIoSnykApiCommonLinkObject(v IoSnykApiCommonLinkObject) error
FromIoSnykApiCommonLinkObject overwrites any union data inside the IoSnykApiCommonLinkProperty as the provided IoSnykApiCommonLinkObject
func (*IoSnykApiCommonLinkProperty) FromIoSnykApiCommonLinkString ¶
func (t *IoSnykApiCommonLinkProperty) FromIoSnykApiCommonLinkString(v IoSnykApiCommonLinkString) error
FromIoSnykApiCommonLinkString overwrites any union data inside the IoSnykApiCommonLinkProperty as the provided IoSnykApiCommonLinkString
func (IoSnykApiCommonLinkProperty) MarshalJSON ¶
func (t IoSnykApiCommonLinkProperty) MarshalJSON() ([]byte, error)
func (*IoSnykApiCommonLinkProperty) MergeIoSnykApiCommonLinkObject ¶
func (t *IoSnykApiCommonLinkProperty) MergeIoSnykApiCommonLinkObject(v IoSnykApiCommonLinkObject) error
MergeIoSnykApiCommonLinkObject performs a merge with any union data inside the IoSnykApiCommonLinkProperty, using the provided IoSnykApiCommonLinkObject
func (*IoSnykApiCommonLinkProperty) MergeIoSnykApiCommonLinkString ¶
func (t *IoSnykApiCommonLinkProperty) MergeIoSnykApiCommonLinkString(v IoSnykApiCommonLinkString) error
MergeIoSnykApiCommonLinkString performs a merge with any union data inside the IoSnykApiCommonLinkProperty, using the provided IoSnykApiCommonLinkString
func (*IoSnykApiCommonLinkProperty) UnmarshalJSON ¶
func (t *IoSnykApiCommonLinkProperty) UnmarshalJSON(b []byte) error
type IoSnykApiCommonLinkString ¶
type IoSnykApiCommonLinkString = string
IoSnykApiCommonLinkString defines model for io.snyk.api.common.LinkString.
type IoSnykApiCommonMeta ¶
type IoSnykApiCommonMeta map[string]interface{}
IoSnykApiCommonMeta Free-form object that may contain non-standard information.
type IoSnykApiCommonPaginatedLinks ¶
type IoSnykApiCommonPaginatedLinks struct {
First *IoSnykApiCommonLinkProperty `json:"first,omitempty"`
Last *IoSnykApiCommonLinkProperty `json:"last,omitempty"`
Next *IoSnykApiCommonLinkProperty `json:"next,omitempty"`
Prev *IoSnykApiCommonLinkProperty `json:"prev,omitempty"`
Self *IoSnykApiCommonLinkProperty `json:"self,omitempty"`
}
IoSnykApiCommonPaginatedLinks defines model for io.snyk.api.common.PaginatedLinks.
type IoSnykApiCommonRelatedLink ¶
type IoSnykApiCommonRelatedLink struct {
Related *IoSnykApiCommonLinkProperty `json:"related,omitempty"`
}
IoSnykApiCommonRelatedLink defines model for io.snyk.api.common.RelatedLink.
type IoSnykApiRequestPaginatedRequestEndingBefore ¶
type IoSnykApiRequestPaginatedRequestEndingBefore = string
IoSnykApiRequestPaginatedRequestEndingBefore defines model for io.snyk.api.request.PaginatedRequest.ending_before.
type IoSnykApiRequestPaginatedRequestLimit ¶
type IoSnykApiRequestPaginatedRequestLimit = int8
IoSnykApiRequestPaginatedRequestLimit defines model for io.snyk.api.request.PaginatedRequest.limit.
type IoSnykApiRequestPaginatedRequestStartingAfter ¶
type IoSnykApiRequestPaginatedRequestStartingAfter = string
IoSnykApiRequestPaginatedRequestStartingAfter defines model for io.snyk.api.request.PaginatedRequest.starting_after.
type IoSnykApiRequestSnykApiRequestInteractionId ¶
type IoSnykApiRequestSnykApiRequestInteractionId = string
IoSnykApiRequestSnykApiRequestInteractionId defines model for io.snyk.api.request.SnykApiRequest.interaction_id.
type IoSnykApiRequestSnykApiRequestRequestId ¶
type IoSnykApiRequestSnykApiRequestRequestId = openapi_types.UUID
IoSnykApiRequestSnykApiRequestRequestId defines model for io.snyk.api.request.SnykApiRequest.request_id.
type IoSnykApiRequestSnykApiRequestVersion ¶
type IoSnykApiRequestSnykApiRequestVersion = string
IoSnykApiRequestSnykApiRequestVersion defines model for io.snyk.api.request.SnykApiRequest.version.
type IoSnykApiV1testdepgraphRequestDepGraph ¶
type IoSnykApiV1testdepgraphRequestDepGraph struct {
Graph IoSnykApiV1testdepgraphRequestGraph `json:"graph"`
PkgManager IoSnykApiV1testdepgraphRequestPackageManager `json:"pkgManager"`
Pkgs []IoSnykApiV1testdepgraphRequestPackage `json:"pkgs"`
SchemaVersion string `json:"schemaVersion"`
AdditionalProperties map[string]interface{} `json:"-"`
}
IoSnykApiV1testdepgraphRequestDepGraph defines model for io.snyk.api.v1testdepgraph.request.DepGraph.
func (IoSnykApiV1testdepgraphRequestDepGraph) Get ¶
func (a IoSnykApiV1testdepgraphRequestDepGraph) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for IoSnykApiV1testdepgraphRequestDepGraph. Returns the specified element and whether it was found
func (IoSnykApiV1testdepgraphRequestDepGraph) MarshalJSON ¶
func (a IoSnykApiV1testdepgraphRequestDepGraph) MarshalJSON() ([]byte, error)
Override default JSON handling for IoSnykApiV1testdepgraphRequestDepGraph to handle AdditionalProperties
func (*IoSnykApiV1testdepgraphRequestDepGraph) Set ¶
func (a *IoSnykApiV1testdepgraphRequestDepGraph) Set(fieldName string, value interface{})
Setter for additional properties for IoSnykApiV1testdepgraphRequestDepGraph
func (*IoSnykApiV1testdepgraphRequestDepGraph) UnmarshalJSON ¶
func (a *IoSnykApiV1testdepgraphRequestDepGraph) UnmarshalJSON(b []byte) error
Override default JSON handling for IoSnykApiV1testdepgraphRequestDepGraph to handle AdditionalProperties
type IoSnykApiV1testdepgraphRequestGraph ¶
type IoSnykApiV1testdepgraphRequestGraph struct {
Nodes []IoSnykApiV1testdepgraphRequestNode `json:"nodes"`
RootNodeId string `json:"rootNodeId"`
AdditionalProperties map[string]interface{} `json:"-"`
}
IoSnykApiV1testdepgraphRequestGraph defines model for io.snyk.api.v1testdepgraph.request.Graph.
func (IoSnykApiV1testdepgraphRequestGraph) Get ¶
func (a IoSnykApiV1testdepgraphRequestGraph) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for IoSnykApiV1testdepgraphRequestGraph. Returns the specified element and whether it was found
func (IoSnykApiV1testdepgraphRequestGraph) MarshalJSON ¶
func (a IoSnykApiV1testdepgraphRequestGraph) MarshalJSON() ([]byte, error)
Override default JSON handling for IoSnykApiV1testdepgraphRequestGraph to handle AdditionalProperties
func (*IoSnykApiV1testdepgraphRequestGraph) Set ¶
func (a *IoSnykApiV1testdepgraphRequestGraph) Set(fieldName string, value interface{})
Setter for additional properties for IoSnykApiV1testdepgraphRequestGraph
func (*IoSnykApiV1testdepgraphRequestGraph) UnmarshalJSON ¶
func (a *IoSnykApiV1testdepgraphRequestGraph) UnmarshalJSON(b []byte) error
Override default JSON handling for IoSnykApiV1testdepgraphRequestGraph to handle AdditionalProperties
type IoSnykApiV1testdepgraphRequestNode ¶
type IoSnykApiV1testdepgraphRequestNode struct {
Deps []IoSnykApiV1testdepgraphRequestNodeRef `json:"deps"`
NodeId string `json:"nodeId"`
PkgId string `json:"pkgId"`
AdditionalProperties map[string]interface{} `json:"-"`
}
IoSnykApiV1testdepgraphRequestNode defines model for io.snyk.api.v1testdepgraph.request.Node.
func (IoSnykApiV1testdepgraphRequestNode) Get ¶
func (a IoSnykApiV1testdepgraphRequestNode) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for IoSnykApiV1testdepgraphRequestNode. Returns the specified element and whether it was found
func (IoSnykApiV1testdepgraphRequestNode) MarshalJSON ¶
func (a IoSnykApiV1testdepgraphRequestNode) MarshalJSON() ([]byte, error)
Override default JSON handling for IoSnykApiV1testdepgraphRequestNode to handle AdditionalProperties
func (*IoSnykApiV1testdepgraphRequestNode) Set ¶
func (a *IoSnykApiV1testdepgraphRequestNode) Set(fieldName string, value interface{})
Setter for additional properties for IoSnykApiV1testdepgraphRequestNode
func (*IoSnykApiV1testdepgraphRequestNode) UnmarshalJSON ¶
func (a *IoSnykApiV1testdepgraphRequestNode) UnmarshalJSON(b []byte) error
Override default JSON handling for IoSnykApiV1testdepgraphRequestNode to handle AdditionalProperties
type IoSnykApiV1testdepgraphRequestNodeRef ¶
type IoSnykApiV1testdepgraphRequestNodeRef struct {
NodeId string `json:"nodeId"`
AdditionalProperties map[string]interface{} `json:"-"`
}
IoSnykApiV1testdepgraphRequestNodeRef defines model for io.snyk.api.v1testdepgraph.request.NodeRef.
func (IoSnykApiV1testdepgraphRequestNodeRef) Get ¶
func (a IoSnykApiV1testdepgraphRequestNodeRef) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for IoSnykApiV1testdepgraphRequestNodeRef. Returns the specified element and whether it was found
func (IoSnykApiV1testdepgraphRequestNodeRef) MarshalJSON ¶
func (a IoSnykApiV1testdepgraphRequestNodeRef) MarshalJSON() ([]byte, error)
Override default JSON handling for IoSnykApiV1testdepgraphRequestNodeRef to handle AdditionalProperties
func (*IoSnykApiV1testdepgraphRequestNodeRef) Set ¶
func (a *IoSnykApiV1testdepgraphRequestNodeRef) Set(fieldName string, value interface{})
Setter for additional properties for IoSnykApiV1testdepgraphRequestNodeRef
func (*IoSnykApiV1testdepgraphRequestNodeRef) UnmarshalJSON ¶
func (a *IoSnykApiV1testdepgraphRequestNodeRef) UnmarshalJSON(b []byte) error
Override default JSON handling for IoSnykApiV1testdepgraphRequestNodeRef to handle AdditionalProperties
type IoSnykApiV1testdepgraphRequestPackage ¶
type IoSnykApiV1testdepgraphRequestPackage struct {
Id string `json:"id"`
Info IoSnykApiV1testdepgraphRequestPackageInfo `json:"info"`
AdditionalProperties map[string]interface{} `json:"-"`
}
IoSnykApiV1testdepgraphRequestPackage defines model for io.snyk.api.v1testdepgraph.request.Package.
func (IoSnykApiV1testdepgraphRequestPackage) Get ¶
func (a IoSnykApiV1testdepgraphRequestPackage) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for IoSnykApiV1testdepgraphRequestPackage. Returns the specified element and whether it was found
func (IoSnykApiV1testdepgraphRequestPackage) MarshalJSON ¶
func (a IoSnykApiV1testdepgraphRequestPackage) MarshalJSON() ([]byte, error)
Override default JSON handling for IoSnykApiV1testdepgraphRequestPackage to handle AdditionalProperties
func (*IoSnykApiV1testdepgraphRequestPackage) Set ¶
func (a *IoSnykApiV1testdepgraphRequestPackage) Set(fieldName string, value interface{})
Setter for additional properties for IoSnykApiV1testdepgraphRequestPackage
func (*IoSnykApiV1testdepgraphRequestPackage) UnmarshalJSON ¶
func (a *IoSnykApiV1testdepgraphRequestPackage) UnmarshalJSON(b []byte) error
Override default JSON handling for IoSnykApiV1testdepgraphRequestPackage to handle AdditionalProperties
type IoSnykApiV1testdepgraphRequestPackageInfo ¶
type IoSnykApiV1testdepgraphRequestPackageInfo struct {
Name string `json:"name"`
Version string `json:"version"`
AdditionalProperties map[string]interface{} `json:"-"`
}
IoSnykApiV1testdepgraphRequestPackageInfo defines model for io.snyk.api.v1testdepgraph.request.PackageInfo.
func (IoSnykApiV1testdepgraphRequestPackageInfo) Get ¶
func (a IoSnykApiV1testdepgraphRequestPackageInfo) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for IoSnykApiV1testdepgraphRequestPackageInfo. Returns the specified element and whether it was found
func (IoSnykApiV1testdepgraphRequestPackageInfo) MarshalJSON ¶
func (a IoSnykApiV1testdepgraphRequestPackageInfo) MarshalJSON() ([]byte, error)
Override default JSON handling for IoSnykApiV1testdepgraphRequestPackageInfo to handle AdditionalProperties
func (*IoSnykApiV1testdepgraphRequestPackageInfo) Set ¶
func (a *IoSnykApiV1testdepgraphRequestPackageInfo) Set(fieldName string, value interface{})
Setter for additional properties for IoSnykApiV1testdepgraphRequestPackageInfo
func (*IoSnykApiV1testdepgraphRequestPackageInfo) UnmarshalJSON ¶
func (a *IoSnykApiV1testdepgraphRequestPackageInfo) UnmarshalJSON(b []byte) error
Override default JSON handling for IoSnykApiV1testdepgraphRequestPackageInfo to handle AdditionalProperties
type IoSnykApiV1testdepgraphRequestPackageManager ¶
type IoSnykApiV1testdepgraphRequestPackageManager struct {
Name string `json:"name"`
AdditionalProperties map[string]interface{} `json:"-"`
}
IoSnykApiV1testdepgraphRequestPackageManager defines model for io.snyk.api.v1testdepgraph.request.PackageManager.
func (IoSnykApiV1testdepgraphRequestPackageManager) Get ¶
func (a IoSnykApiV1testdepgraphRequestPackageManager) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for IoSnykApiV1testdepgraphRequestPackageManager. Returns the specified element and whether it was found
func (IoSnykApiV1testdepgraphRequestPackageManager) MarshalJSON ¶
func (a IoSnykApiV1testdepgraphRequestPackageManager) MarshalJSON() ([]byte, error)
Override default JSON handling for IoSnykApiV1testdepgraphRequestPackageManager to handle AdditionalProperties
func (*IoSnykApiV1testdepgraphRequestPackageManager) Set ¶
func (a *IoSnykApiV1testdepgraphRequestPackageManager) Set(fieldName string, value interface{})
Setter for additional properties for IoSnykApiV1testdepgraphRequestPackageManager
func (*IoSnykApiV1testdepgraphRequestPackageManager) UnmarshalJSON ¶
func (a *IoSnykApiV1testdepgraphRequestPackageManager) UnmarshalJSON(b []byte) error
Override default JSON handling for IoSnykApiV1testdepgraphRequestPackageManager to handle AdditionalProperties
type Issue ¶
type Issue interface {
// GetFindings returns all findings that are part of this issue.
GetFindings() []*FindingData
// GetFindingType returns the finding type of this issue.
// All findings in an issue should have the same finding type.
GetFindingType() FindingType
// GetProblems returns all problems from all findings in this issue.
GetProblems() []*Problem
// GetPrimaryProblem returns the primary problem for this issue.
// For SCA findings, this would be the SnykVulnProblem.
// For other finding types, this may be a CWE, CVE, or rule-based problem.
// Returns nil if no primary problem can be determined.
GetPrimaryProblem() *Problem
// GetID returns the unique identifier for this issue.
// For SCA findings, this is typically the vulnerability ID.
// For SAST findings, this may be the rule ID or finding key.
// For other finding types, this may be derived from the finding key.
GetID() string
// GetSeverity returns the severity of this issue.
// For SCA findings, this comes from the SnykVulnProblem.
// For other finding types, this comes from the Rating attribute.
// Returns empty string if severity cannot be determined.
GetSeverity() string
// GetTitle returns the title of this issue.
// Typically comes from the first finding's title attribute.
GetTitle() string
// GetDescription returns the description of this issue.
// Typically comes from the first finding's description attribute.
GetDescription() string
// GetCWEs returns the CWE identifiers associated with this issue.
// Extracted from CWE problems across all findings.
GetCWEs() []string
// GetCVEs returns the CVE identifiers associated with this issue.
// Extracted from CVE problems across all findings.
GetCVEs() []string
// GetSourceLocations returns all source file locations for this issue.
// For SAST findings, this contains file paths and line numbers.
// For SCA findings, this may contain manifest file locations.
// Returns empty slice if no source locations are found.
GetSourceLocations() []SourceLocation
// GetRiskScore returns the risk score (0-100) for this issue.
// Risk score is calculated based on severity, exploitability, and asset criticality.
// Extracted from the Risk attribute of findings.
// Returns 0 if not available.
GetRiskScore() uint16
// GetEffectiveSeverity returns the effective severity, which may be overwritten by policy.
// This is the severity that should be used for prioritization and display.
// For SCA findings, this comes from the SnykVulnProblem or policy modifications.
// For other finding types, this comes from Rating or policy modifications.
// Returns empty string if not available.
GetEffectiveSeverity() string
// GetReachability returns the reachability assessment for this issue.
// Indicates whether vulnerable code is reachable in the application.
// Returns nil if reachability information is not available.
GetReachability() *ReachabilityEvidence
// GetIgnoreDetails returns the ignore/suppression details for this issue.
// This combines suppression information with linked policy data.
// Returns nil if the issue is not ignored/suppressed.
GetIgnoreDetails() IssueIgnoreDetails
// GetData returns metadata value for the given key (case-insensitive).
// Returns the value and true if found, nil and false otherwise.
// Use the DataKey* constants for well-known keys.
// Callers should perform type assertions on the returned interface{}.
GetData(key string) (interface{}, bool)
// GetProblemID returns the problem ID for this issue.
// For SCA findings, this is the vulnerability or license ID (e.g., SNYK-JS-LODASH-590103).
// For secret findings, this is the secret rule ID.
// Returns empty string if no problem ID is available.
GetProblemID() string
}
Issue defines the interface for accessing a single aggregated security issue. An issue represents a cohesive security problem derived from one or more related findings. This interface is designed to be easily convertible to snyk-ls Issue format. It supports all finding types (SCA, SAST, DAST, Other) with both general and type-specific methods.
func GetIssuesFromTestResult ¶
func GetIssuesFromTestResult(testResults TestResult, findingType []FindingType) ([]Issue, error)
GetIssuesFromTestResult converts test results to Issues and filters by finding type
func NewIssueFromFindings ¶
func NewIssueFromFindings(findings []*FindingData) (Issue, error)
NewIssueFromFindings creates a single Issue instance from a group of related findings. This is a helper function for creating issues from pre-grouped findings.
func NewIssuesFromTestResult ¶
func NewIssuesFromTestResult(ctx context.Context, testResult TestResult) ([]Issue, error)
NewIssuesFromTestResult creates a list of Issues from a TestResult. Findings are automatically grouped into cohesive security issues based on their type and characteristics. For SCA findings, issues are grouped by vulnerability ID. For other finding types, issues are grouped by finding key.
type IssueError ¶
IssueError represents an error that occurred during issue extraction or creation.
func (*IssueError) Error ¶
func (e *IssueError) Error() string
func (*IssueError) Unwrap ¶
func (e *IssueError) Unwrap() error
type IssueIgnoreDetails ¶
type IssueIgnoreDetails interface {
// GetStatus returns the suppression status (ignored, pending_ignore_approval, etc.).
GetStatus() SuppressionStatus
// GetCreatedAt returns when the suppression was first created.
GetCreatedAt() *time.Time
// GetExpiresAt returns when the suppression will expire.
GetExpiresAt() *time.Time
// GetJustification returns the reason given for the suppression.
GetJustification() *string
// GetPath returns the dependency path to the vulnerable package.
GetPath() *[]string
// GetSkipIfFixable returns whether to skip the suppression if a fix is available.
SkipIfFixable() *bool
// GetPolicyID returns the managed policy ID if this is a managed policy.
// Returns nil for local policies or if no policy is associated.
GetPolicyID() *string
// GetIgnoreReasonType returns the type/category of the ignore reason.
GetIgnoreReasonType() string
// GetIgnoredBy returns the user who created the ignore action.
GetIgnoredBy() *IgnoredBy
IsActive() bool
}
IssueIgnoreDetails provides combined information about issue suppression/ignore status, including both suppression data and linked policy information. This interface uses accessor methods to hide implementation details.
type IssueSummary ¶
type IssueSummary struct {
FindingSummary
Issues []Issue
}
IssueSummary extends FindingSummary with the actual issues for better performance. This allows callers to: - Get issues from test results once - Calculate counts once - Sort issues once - Reuse the same data structure across multiple template sections Instead of repeatedly calling conversion and sorting functions.
func (*IssueSummary) GetSortedIssues ¶
func (s *IssueSummary) GetSortedIssues(severityOrder []string) []Issue
GetSortedIssues returns issues sorted by severity (high to low) and ID
type JobAttributes ¶
type JobAttributes struct {
// CreatedAt Creation time of the job resource
CreatedAt time.Time `json:"created_at"`
// Status State of the test, whether it is pending, running, complete or errored.
Status TestExecutionStates `json:"status"`
}
JobAttributes JobAttributes represents the attributes of a Job resource
type JobData ¶
type JobData struct {
// Attributes JobAttributes represents the attributes of a Job resource
Attributes JobAttributes `json:"attributes"`
Id openapi_types.UUID `json:"id"`
Relationships *JobRelationships `json:"relationships,omitempty"`
Type JobDataType `json:"type"`
}
JobData JobData represents a Job resource object.
type JobDataType ¶
type JobDataType string
JobDataType defines model for JobData.Type.
const (
TestJobs JobDataType = "test_jobs"
)
Defines values for JobDataType.
type JobRelationshipField ¶
type JobRelationshipField struct {
Data struct {
Id openapi_types.UUID `json:"id"`
Type JobRelationshipFieldDataType `json:"type"`
} `json:"data"`
}
JobRelationshipField defines model for JobRelationshipField.
type JobRelationshipFieldDataType ¶
type JobRelationshipFieldDataType string
JobRelationshipFieldDataType defines model for JobRelationshipField.Data.Type.
const (
JobRelationshipFieldDataTypeTests JobRelationshipFieldDataType = "tests"
)
Defines values for JobRelationshipFieldDataType.
type JobRelationships ¶
type JobRelationships struct {
// Test Test resource associated with the finished Job.
Test JobRelationshipField `json:"test"`
}
JobRelationships defines model for JobRelationships.
type JsonApi ¶
type JsonApi struct {
// Version Version of the JSON API specification this server supports.
Version string `json:"version"`
}
JsonApi defines model for JsonApi.
type LinkProperty ¶
type LinkProperty struct {
// contains filtered or unexported fields
}
LinkProperty defines model for LinkProperty.
func (LinkProperty) AsLinkProperty0 ¶
func (t LinkProperty) AsLinkProperty0() (LinkProperty0, error)
AsLinkProperty0 returns the union data inside the LinkProperty as a LinkProperty0
func (LinkProperty) AsLinkProperty1 ¶
func (t LinkProperty) AsLinkProperty1() (LinkProperty1, error)
AsLinkProperty1 returns the union data inside the LinkProperty as a LinkProperty1
func (*LinkProperty) FromLinkProperty0 ¶
func (t *LinkProperty) FromLinkProperty0(v LinkProperty0) error
FromLinkProperty0 overwrites any union data inside the LinkProperty as the provided LinkProperty0
func (*LinkProperty) FromLinkProperty1 ¶
func (t *LinkProperty) FromLinkProperty1(v LinkProperty1) error
FromLinkProperty1 overwrites any union data inside the LinkProperty as the provided LinkProperty1
func (LinkProperty) MarshalJSON ¶
func (t LinkProperty) MarshalJSON() ([]byte, error)
func (*LinkProperty) MergeLinkProperty0 ¶
func (t *LinkProperty) MergeLinkProperty0(v LinkProperty0) error
MergeLinkProperty0 performs a merge with any union data inside the LinkProperty, using the provided LinkProperty0
func (*LinkProperty) MergeLinkProperty1 ¶
func (t *LinkProperty) MergeLinkProperty1(v LinkProperty1) error
MergeLinkProperty1 performs a merge with any union data inside the LinkProperty, using the provided LinkProperty1
func (*LinkProperty) UnmarshalJSON ¶
func (t *LinkProperty) UnmarshalJSON(b []byte) error
type LinkProperty1 ¶
type LinkProperty1 struct {
// Href A string containing the link’s URL.
Href string `json:"href"`
// Meta Free-form object that may contain non-standard information.
Meta *Meta `json:"meta,omitempty"`
}
LinkProperty1 defines model for .
type ListAPIVersionsResponse ¶
type ListAPIVersionsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]string
ApplicationvndApiJSON400 *N400
ApplicationvndApiJSON401 *N401
ApplicationvndApiJSON404 *N404
ApplicationvndApiJSON500 *N500
}
func ParseListAPIVersionsResponse ¶
func ParseListAPIVersionsResponse(rsp *http.Response) (*ListAPIVersionsResponse, error)
ParseListAPIVersionsResponse parses an HTTP response from a ListAPIVersionsWithResponse call
func (ListAPIVersionsResponse) Status ¶
func (r ListAPIVersionsResponse) Status() string
Status returns HTTPResponse.Status
func (ListAPIVersionsResponse) StatusCode ¶
func (r ListAPIVersionsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListFindingsParams ¶
type ListFindingsParams struct {
// Version The API version requested.
Version IoSnykApiRequestSnykApiRequestVersion `form:"version" json:"version"`
// StartingAfter Opaque pagination cursor for forward traversal.
StartingAfter *IoSnykApiRequestPaginatedRequestStartingAfter `form:"starting_after,omitempty" json:"starting_after,omitempty"`
// EndingBefore Opaque pagination cursor for reverse traversal.
EndingBefore *IoSnykApiRequestPaginatedRequestEndingBefore `form:"ending_before,omitempty" json:"ending_before,omitempty"`
// Limit The number of items to return.
Limit *IoSnykApiRequestPaginatedRequestLimit `form:"limit,omitempty" json:"limit,omitempty"`
// SnykRequestId A unique ID assigned to each API request, for tracing and troubleshooting.
//
// Snyk clients can optionally provide this ID.
SnykRequestId *IoSnykApiRequestSnykApiRequestRequestId `json:"snyk-request-id,omitempty"`
// SnykInteractionId Identifies the Snyk client interaction in which this API request occurs.
//
// The identifier is an opaque string. though at the time of writing it may either be a
// uuid or a urn containing a uuid and some metadata.
SnykInteractionId *IoSnykApiRequestSnykApiRequestInteractionId `json:"snyk-interaction-id,omitempty"`
}
ListFindingsParams defines parameters for ListFindings.
type ListFindingsResponse ¶
type ListFindingsResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationvndApiJSON200 *struct {
Data []FindingData `json:"data"`
Jsonapi IoSnykApiCommonJsonApi `json:"jsonapi"`
Links IoSnykApiCommonPaginatedLinks `json:"links"`
// Meta Free-form object that may contain non-standard information.
Meta *IoSnykApiCommonMeta `json:"meta,omitempty"`
}
ApplicationvndApiJSON400 *IoSnykApiCommonErrorDocument
}
func ParseListFindingsResponse ¶
func ParseListFindingsResponse(rsp *http.Response) (*ListFindingsResponse, error)
ParseListFindingsResponse parses an HTTP response from a ListFindingsWithResponse call
func (ListFindingsResponse) Status ¶
func (r ListFindingsResponse) Status() string
Status returns HTTPResponse.Status
func (ListFindingsResponse) StatusCode ¶
func (r ListFindingsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type LocalIgnore ¶
type LocalIgnore struct {
// CreatedAt When the ignore was first created.
CreatedAt *time.Time `json:"created_at,omitempty"`
// ExpiresAt When the ignore will expire.
ExpiresAt *time.Time `json:"expires_at,omitempty"`
// Path Dependency path to the vulnerable package to be ignored.
//
// If not provided, the ignore will apply to all packages with the given
// vulnerability ID.
Path *[]string `json:"path,omitempty"`
// Reason Reason for the ignore.
Reason *string `json:"reason,omitempty"`
// SkipIfFixable Skips the ignore rule if an actual fix is available.
SkipIfFixable *bool `json:"skip_if_fixable,omitempty"`
// VulnId The vulnerability ID of the finding to be ignored.
//
// This typically matches SnykVulnProblem.id for open source vulnerabilities.
VulnId string `json:"vuln_id"`
}
LocalIgnore defines model for LocalIgnore.
type LocalPathLocator ¶
type LocalPathLocator struct {
// Paths Local file paths. Limited to 256 characters.
Paths []String256 `json:"paths"`
Type LocalPathLocatorType `json:"type"`
}
LocalPathLocator LocalPathLocator locates a test subject by local file paths, relative to the working copy top-level directory of the source code.
type LocalPathLocatorType ¶
type LocalPathLocatorType string
LocalPathLocatorType defines model for LocalPathLocator.Type.
const (
LocalPath LocalPathLocatorType = "local_path"
)
Defines values for LocalPathLocatorType.
type LocalPolicy ¶
type LocalPolicy struct {
// FailOnUpgradable Use to fail a test when there is at least one vulnerable finding that can be fixed by upgrading the version of the related
// dependency. E.g. bumping lodash from 1.1.1 to 1.1.2.
FailOnUpgradable *bool `json:"fail_on_upgradable,omitempty"`
// Ignores Defines ignore rules for known issues.
Ignores *[]LocalIgnore `json:"ignores,omitempty"`
// ReachabilityFilter Represent various reachability filters available for findings.
ReachabilityFilter *ReachabilityFilter `json:"reachability_filter,omitempty"`
// RiskScoreThreshold Findings of equal or greater risk score will fail the test.
RiskScoreThreshold *uint16 `json:"risk_score_threshold,omitempty"`
// SeverityThreshold Findings of equal or greater severity will fail the test.
SeverityThreshold *Severity `json:"severity_threshold,omitempty"`
// SuppressPendingIgnores Suppress ignores pending approval, so that they do not fail the test. If
// allowed by administrators, this might be set in developer workflows in
// order to unblock local development while an ignore is pending approval.
SuppressPendingIgnores bool `json:"suppress_pending_ignores"`
}
LocalPolicy Locally configured policy options for determining outcome of this specific test.
type ManagedPolicyRef ¶
type ManagedPolicyRef struct {
Id Uuid `json:"id"`
}
ManagedPolicyRef Reference to a managed policy.
type Meta ¶
type Meta map[string]interface{}
Meta Free-form object that may contain non-standard information.
type OtherEvidence ¶
type OtherEvidence struct {
Source OtherEvidenceSource `json:"source"`
}
OtherEvidence Evidence which this API version is not capable of expressing.
More information may be available in a newer version of this API.
type OtherEvidenceSource ¶
type OtherEvidenceSource string
OtherEvidenceSource defines model for OtherEvidence.Source.
const (
OtherEvidenceSourceOther OtherEvidenceSource = "other"
)
Defines values for OtherEvidenceSource.
type OtherLocation ¶
type OtherLocation struct {
Type OtherLocationType `json:"type"`
}
OtherLocation Finding locations which this API version is not capable of expressing.
This location may be available in a newer version of this API.
type OtherLocationType ¶
type OtherLocationType string
OtherLocationType defines model for OtherLocation.Type.
const (
OtherLocationTypeOther OtherLocationType = "other"
)
Defines values for OtherLocationType.
type OtherLocator ¶
type OtherLocator struct {
Type OtherLocatorType `json:"type"`
}
OtherLocator OtherLocator represents any locator that this version of the API is not capable of expressing.
type OtherLocatorType ¶
type OtherLocatorType string
OtherLocatorType defines model for OtherLocator.Type.
const (
OtherLocatorTypeOther OtherLocatorType = "other"
)
Defines values for OtherLocatorType.
type OtherProblem ¶
type OtherProblem struct {
Source OtherProblemSource `json:"source"`
}
OtherProblem Problem which this API version is not capable of expressing.
This problem may be available in a newer version of this API.
type OtherProblemSource ¶
type OtherProblemSource string
OtherProblemSource defines model for OtherProblem.Source.
const (
OtherProblemSourceOther OtherProblemSource = "other"
)
Defines values for OtherProblemSource.
type OtherSubject ¶
type OtherSubject struct {
Type OtherSubjectType `json:"type"`
}
OtherSubject OtherSubject represents any subject that this version of the API is not capable of expressing.
type OtherSubjectType ¶
type OtherSubjectType string
OtherSubjectType defines model for OtherSubject.Type.
const (
OtherSubjectTypeOther OtherSubjectType = "other"
)
Defines values for OtherSubjectType.
type Package ¶
type Package struct {
// Name Name is the name of the package.
Name string `json:"name"`
// Version Version is the version of the named package.
Version string `json:"version"`
}
Package Dependency models a package dependency.
type PackageLocation ¶
type PackageLocation struct {
// Package Dependency models a package dependency.
Package Package `json:"package"`
Type PackageLocationType `json:"type"`
}
PackageLocation Package dependency version.
Finding type: SCA
type PackageLocationType ¶
type PackageLocationType string
PackageLocationType defines model for PackageLocation.Type.
const (
PackageLocationTypePackage PackageLocationType = "package"
)
Defines values for PackageLocationType.
type PinPackageAdvice ¶
type PinPackageAdvice struct {
Format PinPackageAdviceFormat `json:"format"`
PackageName string `json:"package_name"`
PinVersion string `json:"pin_version"`
}
PinPackageAdvice Pin a package at a specific version. Pinning is a capability not supported by all ecosystems, which causes a transitive dependency to be pinned at a specific version with an override.
For example, the `replace` go.mod directive can override package dependency constraints, forcing a specific version to be used in the application.
Pinning could break an application.
Note: In practice pin actions today are solely used in python pip's packages as pip does not calculate upgrade paths
type PinPackageAdviceFormat ¶
type PinPackageAdviceFormat string
PinPackageAdviceFormat defines model for PinPackageAdvice.Format.
const (
PinPackageAdviceFormatPinPackageAdvice PinPackageAdviceFormat = "pin_package_advice"
)
Defines values for PinPackageAdviceFormat.
type Policy ¶
type Policy struct {
AppliedPolicy AppliedPolicy `json:"applied_policy"`
Id openapi_types.UUID `json:"id"`
Type PolicyType `json:"type"`
}
Policy defines model for Policy.
type PolicyAttributes ¶
type PolicyAttributes struct {
Policies []Policy `json:"policies"`
}
PolicyAttributes defines model for PolicyAttributes.
type PolicyModification ¶
type PolicyModification struct {
// Pointer A JSON Pointer (RFC 6901) reference to the modified value, relative to
// the top-level attributes of the same Finding.
Pointer string `json:"pointer"`
// Policy Policy which modified the finding, if available.
Policy *PolicyRef `json:"policy,omitempty"`
// Prior The prior value at the referenced pointer.
Prior *interface{} `json:"prior,omitempty"`
// Reason A human-readable explanation for why the value was modified.
Reason string `json:"reason"`
}
PolicyModification Prior attribute values and the reason they were modified.
type PolicyRef ¶
type PolicyRef struct {
// contains filtered or unexported fields
}
PolicyRef Reference to a single policy.
func (PolicyRef) AsManagedPolicyRef ¶
func (t PolicyRef) AsManagedPolicyRef() (ManagedPolicyRef, error)
AsManagedPolicyRef returns the union data inside the PolicyRef as a ManagedPolicyRef
func (PolicyRef) AsPolicyRef0 ¶
func (t PolicyRef) AsPolicyRef0() (PolicyRef0, error)
AsPolicyRef0 returns the union data inside the PolicyRef as a PolicyRef0
func (*PolicyRef) FromManagedPolicyRef ¶
func (t *PolicyRef) FromManagedPolicyRef(v ManagedPolicyRef) error
FromManagedPolicyRef overwrites any union data inside the PolicyRef as the provided ManagedPolicyRef
func (*PolicyRef) FromPolicyRef0 ¶
func (t *PolicyRef) FromPolicyRef0(v PolicyRef0) error
FromPolicyRef0 overwrites any union data inside the PolicyRef as the provided PolicyRef0
func (PolicyRef) MarshalJSON ¶
func (*PolicyRef) MergeManagedPolicyRef ¶
func (t *PolicyRef) MergeManagedPolicyRef(v ManagedPolicyRef) error
MergeManagedPolicyRef performs a merge with any union data inside the PolicyRef, using the provided ManagedPolicyRef
func (*PolicyRef) MergePolicyRef0 ¶
func (t *PolicyRef) MergePolicyRef0(v PolicyRef0) error
MergePolicyRef0 performs a merge with any union data inside the PolicyRef, using the provided PolicyRef0
func (*PolicyRef) UnmarshalJSON ¶
type PolicyRef0 ¶
type PolicyRef0 string
PolicyRef0 defines model for PolicyRef.0.
const (
PolicyRef0LocalPolicy PolicyRef0 = "local_policy"
)
Defines values for PolicyRef0.
type PolicyRefSet ¶
type PolicyRefSet struct {
Ids []Uuid `json:"ids"`
LocalPolicy *bool `json:"local_policy,omitempty"`
}
PolicyRefSet A set of local and/or managed policies.
type PolicyRule ¶
type PolicyRule struct {
Created time.Time `json:"created"`
Id openapi_types.UUID `json:"id"`
Modified time.Time `json:"modified"`
Name string `json:"name"`
Review PolicyRuleReview `json:"review"`
}
PolicyRule A policy rule is the central entity of a policy, including an action as well as conditions when this policy applies. Only a subset of fields are included, for more details see the API documentation https://apidocs.snyk.io/?version=2024-10-15#get-/orgs/-org_id-/policies/-policy_id-
type PolicyRuleReview ¶
type PolicyRuleReview string
PolicyRuleReview defines model for PolicyRule.Review.
const ( PolicyRuleReviewApproved PolicyRuleReview = "approved" PolicyRuleReviewCancelled PolicyRuleReview = "cancelled" PolicyRuleReviewNotRequired PolicyRuleReview = "not-required" PolicyRuleReviewPending PolicyRuleReview = "pending" PolicyRuleReviewRejected PolicyRuleReview = "rejected" PolicyRuleReviewUnknown PolicyRuleReview = "unknown" )
Defines values for PolicyRuleReview.
type PolicyType ¶
type PolicyType string
PolicyType defines model for Policy.Type.
const (
LegacyPolicySnapshot PolicyType = "legacy_policy_snapshot"
)
Defines values for PolicyType.
type Problem ¶
type Problem struct {
// contains filtered or unexported fields
}
Problem Problems are representative of the finding in other security domains and systems with a well-known identifier.
More detailed attributes for the problem may be included, especially when this information is not yet readily available in a relatable public API.
Problems are defined in industry standard taxonomies such as: - MITRE's Common Weakness Enumeration (CWE) - Common Vulnerability Exposures (CVE)
Snyk systems also define problems, such as: - Code SAST rules - VulnDB vulnerabilities - Software licenses - Secret leaks
func (Problem) AsCveProblem ¶
func (t Problem) AsCveProblem() (CveProblem, error)
AsCveProblem returns the union data inside the Problem as a CveProblem
func (Problem) AsCweProblem ¶
func (t Problem) AsCweProblem() (CweProblem, error)
AsCweProblem returns the union data inside the Problem as a CweProblem
func (Problem) AsGithubSecurityAdvisoryProblem ¶
func (t Problem) AsGithubSecurityAdvisoryProblem() (GithubSecurityAdvisoryProblem, error)
AsGithubSecurityAdvisoryProblem returns the union data inside the Problem as a GithubSecurityAdvisoryProblem
func (Problem) AsOtherProblem ¶
func (t Problem) AsOtherProblem() (OtherProblem, error)
AsOtherProblem returns the union data inside the Problem as a OtherProblem
func (Problem) AsSecretsRuleProblem ¶
func (t Problem) AsSecretsRuleProblem() (SecretsRuleProblem, error)
AsSecretsRuleProblem returns the union data inside the Problem as a SecretsRuleProblem
func (Problem) AsSnykCloudRuleProblem ¶
func (t Problem) AsSnykCloudRuleProblem() (SnykCloudRuleProblem, error)
AsSnykCloudRuleProblem returns the union data inside the Problem as a SnykCloudRuleProblem
func (Problem) AsSnykCodeRuleProblem ¶
func (t Problem) AsSnykCodeRuleProblem() (SnykCodeRuleProblem, error)
AsSnykCodeRuleProblem returns the union data inside the Problem as a SnykCodeRuleProblem
func (Problem) AsSnykLicenseProblem ¶
func (t Problem) AsSnykLicenseProblem() (SnykLicenseProblem, error)
AsSnykLicenseProblem returns the union data inside the Problem as a SnykLicenseProblem
func (Problem) AsSnykVulnProblem ¶
func (t Problem) AsSnykVulnProblem() (SnykVulnProblem, error)
AsSnykVulnProblem returns the union data inside the Problem as a SnykVulnProblem
func (Problem) Discriminator ¶
func (*Problem) FromCveProblem ¶
func (t *Problem) FromCveProblem(v CveProblem) error
FromCveProblem overwrites any union data inside the Problem as the provided CveProblem
func (*Problem) FromCweProblem ¶
func (t *Problem) FromCweProblem(v CweProblem) error
FromCweProblem overwrites any union data inside the Problem as the provided CweProblem
func (*Problem) FromGithubSecurityAdvisoryProblem ¶
func (t *Problem) FromGithubSecurityAdvisoryProblem(v GithubSecurityAdvisoryProblem) error
FromGithubSecurityAdvisoryProblem overwrites any union data inside the Problem as the provided GithubSecurityAdvisoryProblem
func (*Problem) FromOtherProblem ¶
func (t *Problem) FromOtherProblem(v OtherProblem) error
FromOtherProblem overwrites any union data inside the Problem as the provided OtherProblem
func (*Problem) FromSecretsRuleProblem ¶
func (t *Problem) FromSecretsRuleProblem(v SecretsRuleProblem) error
FromSecretsRuleProblem overwrites any union data inside the Problem as the provided SecretsRuleProblem
func (*Problem) FromSnykCloudRuleProblem ¶
func (t *Problem) FromSnykCloudRuleProblem(v SnykCloudRuleProblem) error
FromSnykCloudRuleProblem overwrites any union data inside the Problem as the provided SnykCloudRuleProblem
func (*Problem) FromSnykCodeRuleProblem ¶
func (t *Problem) FromSnykCodeRuleProblem(v SnykCodeRuleProblem) error
FromSnykCodeRuleProblem overwrites any union data inside the Problem as the provided SnykCodeRuleProblem
func (*Problem) FromSnykLicenseProblem ¶
func (t *Problem) FromSnykLicenseProblem(v SnykLicenseProblem) error
FromSnykLicenseProblem overwrites any union data inside the Problem as the provided SnykLicenseProblem
func (*Problem) FromSnykVulnProblem ¶
func (t *Problem) FromSnykVulnProblem(v SnykVulnProblem) error
FromSnykVulnProblem overwrites any union data inside the Problem as the provided SnykVulnProblem
func (Problem) GetID ¶
GetID extracts the ID field from a Problem without full unmarshaling. Returns empty string if the Problem variant doesn't have an ID field (e.g., "other" type). This uses fast byte scanning instead of json.Unmarshal for better performance.
func (Problem) HasID ¶
HasID returns true if this Problem variant has an ID field. Most Problem types have an ID except for "other".
func (Problem) MarshalJSON ¶
func (*Problem) MergeCveProblem ¶
func (t *Problem) MergeCveProblem(v CveProblem) error
MergeCveProblem performs a merge with any union data inside the Problem, using the provided CveProblem
func (*Problem) MergeCweProblem ¶
func (t *Problem) MergeCweProblem(v CweProblem) error
MergeCweProblem performs a merge with any union data inside the Problem, using the provided CweProblem
func (*Problem) MergeGithubSecurityAdvisoryProblem ¶
func (t *Problem) MergeGithubSecurityAdvisoryProblem(v GithubSecurityAdvisoryProblem) error
MergeGithubSecurityAdvisoryProblem performs a merge with any union data inside the Problem, using the provided GithubSecurityAdvisoryProblem
func (*Problem) MergeOtherProblem ¶
func (t *Problem) MergeOtherProblem(v OtherProblem) error
MergeOtherProblem performs a merge with any union data inside the Problem, using the provided OtherProblem
func (*Problem) MergeSecretsRuleProblem ¶
func (t *Problem) MergeSecretsRuleProblem(v SecretsRuleProblem) error
MergeSecretsRuleProblem performs a merge with any union data inside the Problem, using the provided SecretsRuleProblem
func (*Problem) MergeSnykCloudRuleProblem ¶
func (t *Problem) MergeSnykCloudRuleProblem(v SnykCloudRuleProblem) error
MergeSnykCloudRuleProblem performs a merge with any union data inside the Problem, using the provided SnykCloudRuleProblem
func (*Problem) MergeSnykCodeRuleProblem ¶
func (t *Problem) MergeSnykCodeRuleProblem(v SnykCodeRuleProblem) error
MergeSnykCodeRuleProblem performs a merge with any union data inside the Problem, using the provided SnykCodeRuleProblem
func (*Problem) MergeSnykLicenseProblem ¶
func (t *Problem) MergeSnykLicenseProblem(v SnykLicenseProblem) error
MergeSnykLicenseProblem performs a merge with any union data inside the Problem, using the provided SnykLicenseProblem
func (*Problem) MergeSnykVulnProblem ¶
func (t *Problem) MergeSnykVulnProblem(v SnykVulnProblem) error
MergeSnykVulnProblem performs a merge with any union data inside the Problem, using the provided SnykVulnProblem
func (*Problem) UnmarshalJSON ¶
func (Problem) ValueByDiscriminator ¶
type ProjectEntityLocator ¶
type ProjectEntityLocator struct {
// ProjectId Public ID of the Snyk Project.
ProjectId openapi_types.UUID `json:"project_id"`
Type ProjectEntityLocatorType `json:"type"`
}
ProjectEntityLocator ProjectEntityLocator locates a Snyk Project by its public ID.
type ProjectEntityLocatorType ¶
type ProjectEntityLocatorType string
ProjectEntityLocatorType defines model for ProjectEntityLocator.Type.
const (
ProjectEntity ProjectEntityLocatorType = "project_entity"
)
Defines values for ProjectEntityLocatorType.
type ProjectNameLocator ¶
type ProjectNameLocator struct {
// ProjectName Name of the Snyk Project.
ProjectName string `json:"project_name"`
// TargetReference Target reference which differentiates this project, for example, with a
// branch name or version. Projects having the same reference can be grouped
// based on that reference.
TargetReference *string `json:"target_reference,omitempty"`
Type ProjectNameLocatorType `json:"type"`
}
ProjectNameLocator ProjectNameLocator locates a Snyk Project by its name.
type ProjectNameLocatorType ¶
type ProjectNameLocatorType string
ProjectNameLocatorType defines model for ProjectNameLocator.Type.
const (
ProjectName ProjectNameLocatorType = "project_name"
)
Defines values for ProjectNameLocatorType.
type Rating ¶
type Rating struct {
// Severity Severity level of the finding.
Severity Severity `json:"severity"`
}
Rating Rating represents qualitative metrics on a finding.
type ReachabilityEvidence ¶
type ReachabilityEvidence struct {
// Paths Paths by which the vulnerable code can be reached.
//
// Includes the name of the function, the path through the
// source code that reaches the function, and the location
// at which the vulnerable function is called.
Paths *[]ReachablePath `json:"paths,omitempty"`
// Reachability Reachability enum for reachability signal.
Reachability ReachabilityType `json:"reachability"`
Source ReachabilityEvidenceSource `json:"source"`
}
ReachabilityEvidence Indicate the reachability signals as additional evidence for the finding.
type ReachabilityEvidenceSource ¶
type ReachabilityEvidenceSource string
ReachabilityEvidenceSource defines model for ReachabilityEvidence.Source.
const (
Reachability ReachabilityEvidenceSource = "reachability"
)
Defines values for ReachabilityEvidenceSource.
type ReachabilityFilter ¶
type ReachabilityFilter string
ReachabilityFilter Represent various reachability filters available for findings.
const ( ReachabilityFilterNoInfo ReachabilityFilter = "no_info" ReachabilityFilterNoPathFound ReachabilityFilter = "no_path_found" ReachabilityFilterReachable ReachabilityFilter = "reachable" )
Defines values for ReachabilityFilter.
type ReachabilityType ¶
type ReachabilityType string
ReachabilityType Reachability enum for reachability signal.
const ( ReachabilityTypeFunction ReachabilityType = "function" ReachabilityTypeNoInfo ReachabilityType = "no_info" ReachabilityTypeNone ReachabilityType = "none" ReachabilityTypeNotApplicable ReachabilityType = "not_applicable" )
Defines values for ReachabilityType.
type ReachablePath ¶
type ReachablePath struct {
// CallPaths Paths in code bundle that call the vulnerable function.
CallPaths []string `json:"call_paths"`
// FunctionName Vulnerable function name.
FunctionName string `json:"function_name"`
// Location Location in a file where the vulnerability can be found.
Location *FileRegion `json:"location,omitempty"`
}
ReachablePath ReachablePath represents the paths to a vulnerable function.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type Risk ¶
type Risk struct {
// RiskScore Risk score assessment for the finding.
RiskScore *RiskScore `json:"risk_score,omitempty"`
}
Risk Risk represents Snyk's risk assessment of a finding.
type RiskScore ¶
type RiskScore struct {
Value uint16 `json:"value"`
}
RiskScore Risk score assigns a numeric metric based on various attributes of the finding and the risk context in which it was discovered.
type SastScanConfiguration ¶
type SastScanConfiguration = map[string]interface{}
SastScanConfiguration Scan configuration parameters for the SAST scanner.
type SbomReachabilitySubject ¶
type SbomReachabilitySubject struct {
// CodeBundleId Source code to inspect for the reach of the vulnerable dependencies.
CodeBundleId string `json:"code_bundle_id"`
// Locator Locate the local paths from which the SBOM and source code were derived.
Locator LocalPathLocator `json:"locator"`
// SbomBundleId The SBOM to test for vulnerable dependencies.
SbomBundleId string `json:"sbom_bundle_id"`
Type SbomReachabilitySubjectType `json:"type"`
}
SbomReachabilitySubject **Deprecated**
Provide a BundleResource with SBOM Bundle ID, a BundleResource with Source Bundle ID, and include SCA Scan Configuration instead.
SBOM Reachability tests can also be initiated using UploadResources if using the File Upload API.
Test subject for SBOM test with reachability analysis.
type SbomReachabilitySubjectType ¶
type SbomReachabilitySubjectType string
SbomReachabilitySubjectType defines model for SbomReachabilitySubject.Type.
const (
SbomReachability SbomReachabilitySubjectType = "sbom_reachability"
)
Defines values for SbomReachabilitySubjectType.
type SbomSubject ¶
type SbomSubject struct {
// Locator Locate the local paths from which the SBOM and source code were derived.
Locator LocalPathLocator `json:"locator"`
// SbomBundleId The SBOM to test for vulnerable dependencies.
SbomBundleId string `json:"sbom_bundle_id"`
Type SbomSubjectType `json:"type"`
}
SbomSubject **Deprecated**
Provide a BundleResource with SBOM Bundle ID and include SCA Scan Configuration instead.
SBOM tests can also be initiated using an UploadResource if using the File Upload API.
Test subject for SBOM test without reachability analysis.
type SbomSubjectType ¶
type SbomSubjectType string
SbomSubjectType defines model for SbomSubject.Type.
const (
SbomSubjectTypeSbom SbomSubjectType = "sbom"
)
Defines values for SbomSubjectType.
type ScaScanConfiguration ¶
type ScaScanConfiguration = map[string]interface{}
ScaScanConfiguration Scan configuration parameters for the SCA scanner.
type ScanConfiguration ¶
type ScanConfiguration struct {
// Container Scan configuration parameters for the Container scanner.
Container *ContainerScanConfiguration `json:"container,omitempty"`
// Iac Scan configuration parameters for the IAC scanner.
Iac *IacScanConfiguration `json:"iac,omitempty"`
// Sast Scan configuration parameters for the SAST scanner.
Sast *SastScanConfiguration `json:"sast,omitempty"`
// Sca Scan configuration parameters for the SCA scanner.
Sca *ScaScanConfiguration `json:"sca,omitempty"`
// Secrets Scan configuration parameters for the Secrets scanner.
Secrets *SecretsScanConfiguration `json:"secrets,omitempty"`
}
ScanConfiguration A map of scanner types to their specific set of configuration parameters.
The presence of a scanner's configuration in the provided ScanConfiguration is used to determine what scans to run on the list of Resources provided.
Note that an empty config object is different than omitting the field. An omitted scanner config results in that scanner not being run. A provided empty scan config will run the scanner if it is possible.
func (*ScanConfiguration) GetDefaultFindingTypes ¶
func (s *ScanConfiguration) GetDefaultFindingTypes() []FindingType
GetDefaultFindingTypes returns the FindingTypes based on which scan configuration fields are set. Returns nil if no configuration is set or if the configuration cannot be determined. This method provides a way to determine the expected finding types even when no findings exist.
type ScmContext ¶
type ScmContext struct {
Branch *string `json:"branch,omitempty"`
CommitRef *string `json:"commit_ref,omitempty"`
RepoUrl *string `json:"repo_url,omitempty"`
}
ScmContext Additional SCM information about a resource. Provides context about where the content came from; the resource itself is the testable item. ScmResource does not use this; it identifies SCM via its own fields.
type ScmRepoLocator ¶
type ScmRepoLocator struct {
// BranchName Branch name, if known and applicable to locating the test subject.
//
// If not specified, the branch name can be assumed to be the "default
// integration branch" of the repository.
BranchName *string `json:"branch_name,omitempty"`
Type ScmRepoLocatorType `json:"type"`
// Url URL of the SCM repository.
Url string `json:"url"`
}
ScmRepoLocator ScmRepoLocator locates a test subject by SCM repository coordinates.
type ScmRepoLocatorType ¶
type ScmRepoLocatorType string
ScmRepoLocatorType defines model for ScmRepoLocator.Type.
const (
ScmRepo ScmRepoLocatorType = "scm_repo"
)
Defines values for ScmRepoLocatorType.
type ScmResource ¶
type ScmResource struct {
// Commit Commit hash to reference specifically.
Commit *string `json:"commit,omitempty"`
// FilePatterns File Patterns to include in the scan. Elements must be less than 256 characters.
//
// Currently unsupported. Provide an empty list.
FilePatterns *[]String256 `json:"file_patterns,omitempty"`
// IntegrationId Integration ID assigned to the specific SCM.
// This ID can be found in the Snyk UI by navigating to
// "Settings" > "Integrations" > "<Your SCM>"
//
// The ID will be displayed under "General" > "Integration ID"
IntegrationId openapi_types.UUID `json:"integration_id"`
// Ref Ref contains a branch name or other non-commit hash reference
// to a version of the content.
Ref *string `json:"ref,omitempty"`
// RepoUrl URL at which the repository can be found in the SCM.
RepoUrl string `json:"repo_url"`
Type ScmResourceType `json:"type"`
}
ScmResource Resource representing a repository of source files located in a Source Code Management tool (e.g. GitHub).
ScmResources provide Snyk with the requisite information to locate and scan the source files located in the repository.
Currently supported scans utilizing ScmResources are: - SAST scans on (1) ScmResource that references a repo already imported into Snyk - Secrets scans on (1) ScmResource that references a repo already imported into Snyk
type ScmResourceType ¶
type ScmResourceType string
ScmResourceType defines model for ScmResource.Type.
const (
Scm ScmResourceType = "scm"
)
Defines values for ScmResourceType.
type SecretsRuleProblem ¶
type SecretsRuleProblem struct {
// Categories Categories applied to the rule.
Categories []string `json:"categories"`
// Help Assistance on resolving the finding.
Help string `json:"help"`
Id string `json:"id"`
// Name Name for the kind of finding uncovered.
Name string `json:"name"`
// Precision A qualitative description of the rule's precision.
Precision string `json:"precision"`
// Severity Severity level of the finding.
Severity Severity `json:"severity"`
// ShortDescription Short description of the found Secret's type.
ShortDescription string `json:"short_description"`
Source SecretsRuleProblemSource `json:"source"`
// Tags Tags applied to the rule.
Tags []string `json:"tags"`
}
SecretsRuleProblem Secret rule that produces a Secret finding.
type SecretsRuleProblemSource ¶
type SecretsRuleProblemSource string
SecretsRuleProblemSource defines model for SecretsRuleProblem.Source.
const (
Secret SecretsRuleProblemSource = "secret"
)
Defines values for SecretsRuleProblemSource.
type SecretsScanConfiguration ¶
type SecretsScanConfiguration = map[string]interface{}
SecretsScanConfiguration Scan configuration parameters for the Secrets scanner.
type Severity ¶
type Severity string
Severity Indicate the severity of a finding discovered by a Test.
type SeverityChange ¶
type SeverityChange struct {
ActionType SeverityChangeActionType `json:"action_type"`
// PolicyRef Reference to a policy, serving as a container for a set of policy-rules and can be owned by the group or the org.
PolicyRef SnykPolicyRef `json:"policy_ref"`
// Rule A policy rule is the central entity of a policy, including an action as well as conditions
// when this policy applies.
// Only a subset of fields are included, for more details see the API documentation
// https://apidocs.snyk.io/?version=2024-10-15#get-/orgs/-org_id-/policies/-policy_id-
Rule PolicyRule `json:"rule"`
SeverityChange SeverityChangeDetails `json:"severity_change"`
}
SeverityChange defines model for SeverityChange.
type SeverityChangeActionType ¶
type SeverityChangeActionType string
SeverityChangeActionType defines model for SeverityChange.ActionType.
const (
SeverityChangeActionTypeSeverityChange SeverityChangeActionType = "severity-change"
)
Defines values for SeverityChangeActionType.
type SeverityChangeDetails ¶
type SeverityChangeDetails struct {
// NewSeverity Indicate the severity of a finding discovered by a Test.
NewSeverity Severity `json:"new_severity"`
// OriginalSeverity Indicate the severity of a finding discovered by a Test.
OriginalSeverity Severity `json:"original_severity"`
}
SeverityChangeDetails defines model for SeverityChangeDetails.
type SnykCloudRuleProblem ¶
type SnykCloudRuleProblem struct {
Id string `json:"id"`
Source SnykCloudRuleProblemSource `json:"source"`
}
SnykCloudRuleProblem Configuration policy violation from Snyk's Cloud Rules Database.
type SnykCloudRuleProblemSource ¶
type SnykCloudRuleProblemSource string
SnykCloudRuleProblemSource defines model for SnykCloudRuleProblem.Source.
const (
SnykCloudRule SnykCloudRuleProblemSource = "snyk_cloud_rule"
)
Defines values for SnykCloudRuleProblemSource.
type SnykCodeRuleProblem ¶
type SnykCodeRuleProblem struct {
// DefaultConfiguration Snyk Code rule configuration options.
DefaultConfiguration SnykcoderuleConfiguration `json:"default_configuration"`
// Help Represent a message string in multiple formats: plain text or markdown.
Help SnykcoderuleMultiformatMessageString `json:"help"`
Id string `json:"id"`
Name string `json:"name"`
// Properties Additional properties of a Snyk Code rule. Represented in SARIF as free-form
// metadata, but Snyk Code scanner outputs prescribe a specific structure for
// this content.
Properties SnykcoderuleProperties `json:"properties"`
// ShortDescription Represent a message string in multiple formats: plain text or markdown.
ShortDescription SnykcoderuleMultiformatMessageString `json:"short_description"`
Source SnykCodeRuleProblemSource `json:"source"`
}
SnykCodeRuleProblem Static code analysis rule, from the standard Snyk Code rule set.
type SnykCodeRuleProblemSource ¶
type SnykCodeRuleProblemSource string
SnykCodeRuleProblemSource defines model for SnykCodeRuleProblem.Source.
const (
SnykCodeRule SnykCodeRuleProblemSource = "snyk_code_rule"
)
Defines values for SnykCodeRuleProblemSource.
type SnykLicenseProblem ¶
type SnykLicenseProblem struct {
// AffectedHashRanges Range of commit hashes known to be affected by this problem.
//
// Generally used with package ecosystems which use Git SCM repositories for
// distribution.
AffectedHashRanges *[]string `json:"affected_hash_ranges,omitempty"`
// AffectedHashes List of specific commit hashes known to be affected by this problem.
AffectedHashes *[]string `json:"affected_hashes,omitempty"`
// AffectedVersions All the package versions which are affected by this problem. Expect this to
// be smaller than 0 ([,0] or <0.0.0 ) for vulnerabilities that have been
// revoked. Per ecosystem, the official package version guidelines are
// being used.
AffectedVersions *[]string `json:"affected_versions,omitempty"`
// CreatedAt Timestamp indicating when the problem was orginally created.
CreatedAt time.Time `json:"created_at"`
// Ecosystem Package ecosystem in which the package is distributed.
//
// This applies to private packages distributed with ecosystem tooling as well
// as those publicly distributed.
Ecosystem SnykvulndbPackageEcosystem `json:"ecosystem"`
Id string `json:"id"`
// Instructions License policy instructions. Legal instructions for the user on what to do
// when met with the license policy violation.
Instructions []SnykvulndbLicenseInstructions `json:"instructions"`
// License Software license identifier.
License string `json:"license"`
// PackageFullName The full name of the vulnerable software package.
// It's achieved by combining the packageName and packageNamespace
// with the ecosystem specific delimiter.
PackageFullName *string `json:"package_full_name,omitempty"`
// PackageName Package name.
PackageName string `json:"package_name"`
// PackageNamespace Vulnerable software package namespace, if applicable.
PackageNamespace *string `json:"package_namespace,omitempty"`
// PackageVersion Package version.
PackageVersion string `json:"package_version"`
// PublishedAt Timestamp indicating when the problem was published.
PublishedAt time.Time `json:"published_at"`
// Severity The Snyk curated or recommended vulnerability severity for the problem.
Severity Severity `json:"severity"`
Source SnykLicenseProblemSource `json:"source"`
}
SnykLicenseProblem License from Snyk's Vulnerability Database.
A software license can be considered a problem when policy designates it as a business risk.
type SnykLicenseProblemSource ¶
type SnykLicenseProblemSource string
SnykLicenseProblemSource defines model for SnykLicenseProblem.Source.
const (
SnykLicense SnykLicenseProblemSource = "snyk_license"
)
Defines values for SnykLicenseProblemSource.
type SnykPolicyRef ¶
type SnykPolicyRef struct {
Id openapi_types.UUID `json:"id"`
Owner SnykPolicyRefOwner `json:"owner"`
}
SnykPolicyRef Reference to a policy, serving as a container for a set of policy-rules and can be owned by the group or the org.
type SnykPolicyRefOwner ¶
type SnykPolicyRefOwner string
SnykPolicyRefOwner defines model for SnykPolicyRef.Owner.
const ( Group SnykPolicyRefOwner = "group" Org SnykPolicyRefOwner = "org" )
Defines values for SnykPolicyRefOwner.
type SnykReferenceResource ¶
type SnykReferenceResource struct {
// RefId ID referring the contents already known by Snyk.
RefId openapi_types.UUID `json:"ref_id"`
// ReferenceType Kind of Snyk reference contained in Ref ID.
//
// Targets and Projects exist in Snyk currently.
//
// Assets are a feature in-development, and are listed
// here for future-forward compatibility.
ReferenceType SnykReferenceResourceReferenceType `json:"reference_type"`
// ScmContext Additional SCM information about a resource.
// Provides context about where the content came from; the resource itself is the testable item.
// ScmResource does not use this; it identifies SCM via its own fields.
ScmContext *ScmContext `json:"scm_context,omitempty"`
Type SnykReferenceResourceType `json:"type"`
}
SnykReferenceResource SnykReferenceResources contain references to source code, containers, SBOMs, and other testable content that has already been provided to Snyk to create a Project or Target.
If the intended content to test is already known to Snyk as a Project, Target, or otherwise, this SnykReferenceResource can be used to initiate a Test with the appropriate ID.
Currently no scans are supported through the Test API for SnykReferenceResources.
type SnykReferenceResourceReferenceType ¶
type SnykReferenceResourceReferenceType string
SnykReferenceResourceReferenceType Kind of Snyk reference contained in Ref ID.
Targets and Projects exist in Snyk currently.
Assets are a feature in-development, and are listed here for future-forward compatibility.
const ( Asset SnykReferenceResourceReferenceType = "asset" Project SnykReferenceResourceReferenceType = "project" Target SnykReferenceResourceReferenceType = "target" )
Defines values for SnykReferenceResourceReferenceType.
type SnykReferenceResourceType ¶
type SnykReferenceResourceType string
SnykReferenceResourceType defines model for SnykReferenceResource.Type.
const (
SnykRef SnykReferenceResourceType = "snyk_ref"
)
Defines values for SnykReferenceResourceType.
type SnykVulnProblem ¶
type SnykVulnProblem struct {
// AffectedHashRanges Range of commit hashes known to be affected by this problem.
//
// Generally used with package ecosystems which use Git SCM repositories for
// distribution.
AffectedHashRanges *[]string `json:"affected_hash_ranges,omitempty"`
// AffectedHashes List of specific commit hashes known to be affected by this problem.
AffectedHashes *[]string `json:"affected_hashes,omitempty"`
// AffectedVersions All the package versions which are affected by this problem. Expect this to
// be smaller than 0 ([,0] or <0.0.0 ) for vulnerabilities that have been
// revoked. Per ecosystem, the official package version guidelines are
// being used.
AffectedVersions *[]string `json:"affected_versions,omitempty"`
// AlternativeIds This is the list of alternative IDs Snyk gives for a certain vulnerability.
// It's usually present in older vulnerabilities, in which Snyk used to use a different identifier format.
// e.g a vuln with the ID "npm:foo:bar", will likely have an alternative ID of "SNYK-JS-FOO-BAR".
AlternativeIds *[]string `json:"alternative_ids,omitempty"`
// CreatedAt Timestamp indicating when the problem was orginally created.
CreatedAt time.Time `json:"created_at"`
// Credits Discoverer / Reporter of the vulnerability.
Credits []string `json:"credits"`
// CvssBaseScore The Snyk curated or recommended CVSS score, in the highest CVSS version
// supported and available for the issue, computed based on the Base Score
// of the cvss_vector field.
CvssBaseScore SnykvulndbCvssScore `json:"cvss_base_score"`
// CvssSources All CVSS vector information (Base), with corresponding sources, scores
// and severities applying to the same vulnerability. The data is sourced
// from external security vendors (e.g. NVD), as well as assigned by Snyk.
//
// The “type” key indicates whether this is the “primary” (recommended) CVSS
// to use, or “secondary” (provided as additional information).
//
// Information might be partial and will be updated upon evaluation by
// external sources.
CvssSources []SnykvulndbCvssSource `json:"cvss_sources"`
// CvssVector The primary CVSS Base vector, either Snyk curated or from the recommended
// source, in v3.0, v3.1 or v4.0 CVSS versions. Might include exploit
// values where applicable.
CvssVector string `json:"cvss_vector"`
// DisclosedAt Timestamp of when the vulnerability was first made publicly available
// (either known to us or as appears in the vulnerability source)
DisclosedAt time.Time `json:"disclosed_at"`
// Ecosystem Package ecosystem in which the package is distributed.
//
// This applies to private packages distributed with ecosystem tooling as well
// as those publicly distributed.
Ecosystem SnykvulndbPackageEcosystem `json:"ecosystem"`
// EpssDetails EPSS details - see note on model definition.
EpssDetails *SnykvulndbEpssDetails `json:"epss_details,omitempty"`
// ExploitDetails Details about the maturity of exploits for this vulnerability.
ExploitDetails SnykvulndbExploitDetails `json:"exploit_details"`
Id string `json:"id"`
// InitiallyFixedInVersions This indicates the earliest version that is vulnerability-free. As this
// might be a backported fix, this does not mean that newer versions aren’t
// vulnerable. vulnerable_versions should also be used to determine whether
// a given version is vulnerable.
InitiallyFixedInVersions []string `json:"initially_fixed_in_versions"`
// IsDisputed Indicates if the vulnerability is formally disputed.
// A vulnerability's claim (e.g., that it's a security flaw, or the scope/impact) is
// **disputed** when one party, often the vendor or a security professional, formally
// challenges the assertion.
// Most cybersecurity public listings, such as CVE, have a defined process
// allowing vendors or researchers to officially challenge the validity
// of a reported issue, leading to this 'DISPUTED' status being formally annotated.
IsDisputed *bool `json:"is_disputed,omitempty"`
// IsFixable Is there a fixed version published to the relevant package manager
// repository- i.e., a newer version without this specific vulnerability
IsFixable bool `json:"is_fixable"`
// IsMalicious Indicate if the vulnerability is known to mark a malicious package.
IsMalicious bool `json:"is_malicious"`
// IsProprietary This field indicates if the vulnerability was first published in the Snyk DB.
// This happens when either of the following is true:
// - Snyk was responsilbe for coordinating the disclosure
// - Snyk researchers discovered the vulnerability/malicious package
// - Snyk gave the first or best indication about the vulnerability based on unofficial sources.
// The only exceptions are when:
// - The vulnerability is a Linux container
// - The vulnerable package is written in C/C++ and not hosted on conan center
// - The vulnerable package is a `webjar`
IsProprietary *bool `json:"is_proprietary,omitempty"`
// IsSocialMediaTrending This boolean field is true when increased activity is detected related to
// this vulnerability. The "trending" determination is based on social media
// activity, using Snyk models which are tuned to detect an increased chance
// of near-future exploitation.
IsSocialMediaTrending bool `json:"is_social_media_trending"`
// ModifiedAt Timestamp indicating when the vulnerability was last modified (anything
// from typo to version change). When the vulnerability is first added, this
// field and published will be (almost) identical.
ModifiedAt time.Time `json:"modified_at"`
// PackageFullName The full name of the vulnerable software package.
// It's achieved by combining the packageName and packageNamespace
// with the ecosystem specific delimiter.
PackageFullName *string `json:"package_full_name,omitempty"`
// PackageName Package name.
PackageName string `json:"package_name"`
// PackageNamespace Vulnerable software package namespace, if applicable.
PackageNamespace *string `json:"package_namespace,omitempty"`
// PackagePopularityRank Percentile rank indicating the package's prevalence across Snyk-monitored projects.
// A higher rank signifies the package is used in a larger percentage of projects.
PackagePopularityRank *float32 `json:"package_popularity_rank,omitempty"`
// PackageRepositoryUrl Link to the package repository containing the vulnerable package.
PackageRepositoryUrl *string `json:"package_repository_url,omitempty"`
// PackageVersion Package version.
PackageVersion string `json:"package_version"`
// PublishedAt Timestamp indicating when the problem was published.
PublishedAt time.Time `json:"published_at"`
// References Links to external websites related to the vulnerability. Links also
// include a user-facing curated title.
References []SnykvulndbReferenceLinks `json:"references"`
// Severity The Snyk curated or recommended vulnerability severity for the problem.
Severity Severity `json:"severity"`
// SeverityBasedOn Indicates how the vulnerability severity was determined.
SeverityBasedOn *string `json:"severity_based_on,omitempty"`
Source SnykVulnProblemSource `json:"source"`
// VendorSeverity The assigned severity/impact/urgency rating by the distros teams for the
// specific vulnerability package and release of the operating system (if available).
VendorSeverity *string `json:"vendor_severity,omitempty"`
// VulnerableFunctions Known vulnerable functions in software packages.
VulnerableFunctions *map[string]SnykvulndbVulnerableFunction `json:"vulnerable_functions,omitempty"`
}
SnykVulnProblem Vulnerability from Snyk's Vulnerability Database.
type SnykVulnProblemSource ¶
type SnykVulnProblemSource string
SnykVulnProblemSource defines model for SnykVulnProblem.Source.
const (
SnykVuln SnykVulnProblemSource = "snyk_vuln"
)
Defines values for SnykVulnProblemSource.
type SnykcoderuleConfiguration ¶
type SnykcoderuleConfiguration struct {
// Severity Severity to apply when the rule matches.
Severity Severity `json:"severity"`
}
SnykcoderuleConfiguration Snyk Code rule configuration options.
type SnykcoderuleExampleCommitChange ¶
type SnykcoderuleExampleCommitChange struct {
Line string `json:"line"`
LineChange string `json:"line_change"`
LineNumber uint32 `json:"line_number"`
}
SnykcoderuleExampleCommitChange Source line content, line number, and unified diff indicating the changes in the fix.
type SnykcoderuleExampleCommitFix ¶
type SnykcoderuleExampleCommitFix struct {
// CommitUrl Commit URL identifying a specific commit within a public open-source SCM repo.
CommitUrl string `json:"commit_url"`
// Lines Lines containing an example of the Snyk Code rule with an example fix.
Lines []SnykcoderuleExampleCommitChange `json:"lines"`
}
SnykcoderuleExampleCommitFix An example of fixing this rule in a public open-source code.
type SnykcoderuleMultiformatMessageString ¶
type SnykcoderuleMultiformatMessageString struct {
Markdown *string `json:"markdown,omitempty"`
Text *string `json:"text,omitempty"`
}
SnykcoderuleMultiformatMessageString Represent a message string in multiple formats: plain text or markdown.
type SnykcoderuleProperties ¶
type SnykcoderuleProperties struct {
// Categories Categories applied to the rule.
Categories []string `json:"categories"`
// Cwe List of CWE (Common Weakness Enumeration) identifiers corresponding to this rule.
Cwe []string `json:"cwe"`
// ExampleCommitDescriptions Descriptions of the fix examples.
ExampleCommitDescriptions []string `json:"example_commit_descriptions"`
// ExampleCommitFixes Examples of fixing this rule in public open-source code.
ExampleCommitFixes []SnykcoderuleExampleCommitFix `json:"example_commit_fixes"`
// Precision A qualitative description of the rule's precision.
Precision string `json:"precision"`
RepoDatasetSize uint32 `json:"repo_dataset_size"`
// Tags Tags applied to the rule.
Tags []string `json:"tags"`
}
SnykcoderuleProperties Additional properties of a Snyk Code rule. Represented in SARIF as free-form metadata, but Snyk Code scanner outputs prescribe a specific structure for this content.
type SnykvulndbBuildPackageEcosystem ¶
type SnykvulndbBuildPackageEcosystem struct {
// Client Ecosystem client is the tool the consumer used to manage the dependencies.
// In managed ecosystems, this is commonly refered to as the package manager,
// while in the case of C++, this would be "unmanaged".
Client *string `json:"client,omitempty"`
// Deprecated:
Language string `json:"language"`
// Deprecated:
PackageManager string `json:"package_manager"`
Type SnykvulndbBuildPackageEcosystemType `json:"type"`
}
SnykvulndbBuildPackageEcosystem Software packages supporting the application build process.
These are generally development libraries, which may be distributed in source or compiled form, used during the application build process by various programming language toolchains.
Examples include, but are not limited to: Javascript NPM, Java Maven, Python pip, etc.
type SnykvulndbBuildPackageEcosystemType ¶
type SnykvulndbBuildPackageEcosystemType string
SnykvulndbBuildPackageEcosystemType defines model for SnykvulndbBuildPackageEcosystem.Type.
const (
Build SnykvulndbBuildPackageEcosystemType = "build"
)
Defines values for SnykvulndbBuildPackageEcosystemType.
type SnykvulndbCvssScore ¶
type SnykvulndbCvssScore = float32
SnykvulndbCvssScore defines model for snykvulndb.CvssScore.
type SnykvulndbCvssSource ¶
type SnykvulndbCvssSource struct {
// Assigner Entity providing the CVSS information.
Assigner string `json:"assigner"`
// BaseScore Base CVSS score.
BaseScore SnykvulndbCvssScore `json:"base_score"`
// CvssVersion CVSS version.
CvssVersion string `json:"cvss_version"`
// ModifiedAt When the CVSS scoring was last modified.
ModifiedAt time.Time `json:"modified_at"`
// Severity Severity based on the CVSS rating scale (see SnykVulnAttributes.severity).
Severity Severity `json:"severity"`
// Type Designation of whether the CVSS score is primary (recommended assessment)
// or secondary (supplemental information).
Type SnykvulndbCvssSourceType `json:"type"`
// Vector The CVSS vector string.
Vector string `json:"vector"`
}
SnykvulndbCvssSource CVSS vector information with provenance indicating the source of the scoring.
type SnykvulndbCvssSourceType ¶
type SnykvulndbCvssSourceType string
SnykvulndbCvssSourceType Indicate whether the CVSS source is primary (recommended) or secondary (provided as supplemental information).
const ( SnykvulndbCvssSourceTypeOther SnykvulndbCvssSourceType = "other" SnykvulndbCvssSourceTypePrimary SnykvulndbCvssSourceType = "primary" SnykvulndbCvssSourceTypeSecondary SnykvulndbCvssSourceType = "secondary" )
Defines values for SnykvulndbCvssSourceType.
type SnykvulndbEpssDetails ¶
type SnykvulndbEpssDetails struct {
// ModelVersion The version of the EPSS model we use.
ModelVersion string `json:"model_version"`
// Percentile The percentile of the EPSS of a vulnerability relative to all other vulnerabilities.
// In value range 0 - 1 with 5 fixed digits.
Percentile string `json:"percentile"`
// Probability The probability of the vulnerability to be exploited.
// In value range 0 - 1 with 5 fixed digits.
Probability string `json:"probability"`
}
SnykvulndbEpssDetails Exploit Prediction Scoring System (EPSS), which predicts the likelihood (probability) of the vulnerability to be exploited, and the percentile of the EPSS of a vulnerability relative to all other vulnerabilities. We are using the latest model. https://www.first.org/epss/model
type SnykvulndbExploitDetails ¶
type SnykvulndbExploitDetails struct {
// MaturityLevels Exploit maturity representation in CVSS version formats.
MaturityLevels []SnykvulndbExploitMaturityLevel `json:"maturity_levels"`
// Sources Sources of the exploitation maturity assessment.
Sources []string `json:"sources"`
}
SnykvulndbExploitDetails Details about the exploitability of a vulnerability.
type SnykvulndbExploitMaturityLevel ¶
type SnykvulndbExploitMaturityLevel struct {
// Format Format of the maturity level.
Format string `json:"format"`
// Level Maturity level in the given format.
Level string `json:"level"`
// Type Designation of whether the maturity information is primary (recommended
// assessment) or secondary (supplemental information) in nature.
Type SnykvulndbCvssSourceType `json:"type"`
}
SnykvulndbExploitMaturityLevel Represents exploit maturity.
type SnykvulndbLicenseInstructions ¶
type SnykvulndbLicenseInstructions struct {
// Content License policy instructions. Legal instructions for the user on what to do
// when met with the license policy violation.
Content string `json:"content"`
// License Software license identifier.
License string `json:"license"`
}
SnykvulndbLicenseInstructions License instructions are free-form, customer defined messages typically provided by application security or legal teams. They appear in the CLI alongside detected license violations to guide developers on how to handle specific licenses in their dependencies.
type SnykvulndbOsPackageEcosystem ¶
type SnykvulndbOsPackageEcosystem struct {
// Distribution Distribution name providing the package.
Distribution string `json:"distribution"`
// OsName Name of the operating system.
OsName string `json:"os_name"`
// Release Release version of the operating system distribution.
//
// Note that for Linux distributions this is the release version (typically a
// semver or date-derived number), rather than the codename for the release.
Release string `json:"release"`
Type SnykvulndbOsPackageEcosystemType `json:"type"`
}
SnykvulndbOsPackageEcosystem Software packages supporting operating system software installation and upgrades.
These are generally software packages containing runtime libraries and applications which are installed as part of an operating system software distribution.
type SnykvulndbOsPackageEcosystemType ¶
type SnykvulndbOsPackageEcosystemType string
SnykvulndbOsPackageEcosystemType defines model for SnykvulndbOsPackageEcosystem.Type.
const (
Os SnykvulndbOsPackageEcosystemType = "os"
)
Defines values for SnykvulndbOsPackageEcosystemType.
type SnykvulndbOtherPackageEcosystem ¶
type SnykvulndbOtherPackageEcosystem struct {
Type SnykvulndbOtherPackageEcosystemType `json:"type"`
}
SnykvulndbOtherPackageEcosystem Package ecosystem which this API version is not capable of expressing.
More information may be available in a newer version of this API.
type SnykvulndbOtherPackageEcosystemType ¶
type SnykvulndbOtherPackageEcosystemType string
SnykvulndbOtherPackageEcosystemType defines model for SnykvulndbOtherPackageEcosystem.Type.
const (
SnykvulndbOtherPackageEcosystemTypeOther SnykvulndbOtherPackageEcosystemType = "other"
)
Defines values for SnykvulndbOtherPackageEcosystemType.
type SnykvulndbPackageEcosystem ¶
type SnykvulndbPackageEcosystem struct {
// contains filtered or unexported fields
}
SnykvulndbPackageEcosystem Describe a software package ecosystem.
func (SnykvulndbPackageEcosystem) AsSnykvulndbBuildPackageEcosystem ¶
func (t SnykvulndbPackageEcosystem) AsSnykvulndbBuildPackageEcosystem() (SnykvulndbBuildPackageEcosystem, error)
AsSnykvulndbBuildPackageEcosystem returns the union data inside the SnykvulndbPackageEcosystem as a SnykvulndbBuildPackageEcosystem
func (SnykvulndbPackageEcosystem) AsSnykvulndbOsPackageEcosystem ¶
func (t SnykvulndbPackageEcosystem) AsSnykvulndbOsPackageEcosystem() (SnykvulndbOsPackageEcosystem, error)
AsSnykvulndbOsPackageEcosystem returns the union data inside the SnykvulndbPackageEcosystem as a SnykvulndbOsPackageEcosystem
func (SnykvulndbPackageEcosystem) AsSnykvulndbOtherPackageEcosystem ¶
func (t SnykvulndbPackageEcosystem) AsSnykvulndbOtherPackageEcosystem() (SnykvulndbOtherPackageEcosystem, error)
AsSnykvulndbOtherPackageEcosystem returns the union data inside the SnykvulndbPackageEcosystem as a SnykvulndbOtherPackageEcosystem
func (SnykvulndbPackageEcosystem) Discriminator ¶
func (t SnykvulndbPackageEcosystem) Discriminator() (string, error)
func (*SnykvulndbPackageEcosystem) FromSnykvulndbBuildPackageEcosystem ¶
func (t *SnykvulndbPackageEcosystem) FromSnykvulndbBuildPackageEcosystem(v SnykvulndbBuildPackageEcosystem) error
FromSnykvulndbBuildPackageEcosystem overwrites any union data inside the SnykvulndbPackageEcosystem as the provided SnykvulndbBuildPackageEcosystem
func (*SnykvulndbPackageEcosystem) FromSnykvulndbOsPackageEcosystem ¶
func (t *SnykvulndbPackageEcosystem) FromSnykvulndbOsPackageEcosystem(v SnykvulndbOsPackageEcosystem) error
FromSnykvulndbOsPackageEcosystem overwrites any union data inside the SnykvulndbPackageEcosystem as the provided SnykvulndbOsPackageEcosystem
func (*SnykvulndbPackageEcosystem) FromSnykvulndbOtherPackageEcosystem ¶
func (t *SnykvulndbPackageEcosystem) FromSnykvulndbOtherPackageEcosystem(v SnykvulndbOtherPackageEcosystem) error
FromSnykvulndbOtherPackageEcosystem overwrites any union data inside the SnykvulndbPackageEcosystem as the provided SnykvulndbOtherPackageEcosystem
func (SnykvulndbPackageEcosystem) MarshalJSON ¶
func (t SnykvulndbPackageEcosystem) MarshalJSON() ([]byte, error)
func (*SnykvulndbPackageEcosystem) MergeSnykvulndbBuildPackageEcosystem ¶
func (t *SnykvulndbPackageEcosystem) MergeSnykvulndbBuildPackageEcosystem(v SnykvulndbBuildPackageEcosystem) error
MergeSnykvulndbBuildPackageEcosystem performs a merge with any union data inside the SnykvulndbPackageEcosystem, using the provided SnykvulndbBuildPackageEcosystem
func (*SnykvulndbPackageEcosystem) MergeSnykvulndbOsPackageEcosystem ¶
func (t *SnykvulndbPackageEcosystem) MergeSnykvulndbOsPackageEcosystem(v SnykvulndbOsPackageEcosystem) error
MergeSnykvulndbOsPackageEcosystem performs a merge with any union data inside the SnykvulndbPackageEcosystem, using the provided SnykvulndbOsPackageEcosystem
func (*SnykvulndbPackageEcosystem) MergeSnykvulndbOtherPackageEcosystem ¶
func (t *SnykvulndbPackageEcosystem) MergeSnykvulndbOtherPackageEcosystem(v SnykvulndbOtherPackageEcosystem) error
MergeSnykvulndbOtherPackageEcosystem performs a merge with any union data inside the SnykvulndbPackageEcosystem, using the provided SnykvulndbOtherPackageEcosystem
func (*SnykvulndbPackageEcosystem) UnmarshalJSON ¶
func (t *SnykvulndbPackageEcosystem) UnmarshalJSON(b []byte) error
func (SnykvulndbPackageEcosystem) ValueByDiscriminator ¶
func (t SnykvulndbPackageEcosystem) ValueByDiscriminator() (interface{}, error)
type SnykvulndbReferenceLinks ¶
type SnykvulndbReferenceLinks struct {
// Title User-facing title of the link.
Title string `json:"title"`
// Url External link where more information about the vulnerability can be found.
Url string `json:"url"`
}
SnykvulndbReferenceLinks Represent links to external sources of vulnerability information.
type SnykvulndbVulnerableFunction ¶
type SnykvulndbVulnerableFunction struct {
// FunctionId Vulnerable function.
FunctionId SnykvulndbVulnerableFunctionId `json:"function_id"`
// Versions Package versions in which the function is vulnerable.
Versions []string `json:"versions"`
}
SnykvulndbVulnerableFunction Information about a function known to be vulnerable in a software package.
type SnykvulndbVulnerableFunctionId ¶
type SnykvulndbVulnerableFunctionId struct {
// ClassName Class containing the function.
ClassName *string `json:"class_name,omitempty"`
// FunctionName Vulnerable function name.
FunctionName string `json:"function_name"`
}
SnykvulndbVulnerableFunctionId Identify a vulnerable function in a software package.
type SourceLocation ¶
type SourceLocation struct {
// FilePath File path for the code snippet.
FilePath string `json:"file_path"`
// FromColumn Column on which the snippet starts.
FromColumn *int `json:"from_column,omitempty"`
// FromLine Line in the file where the code snippet starts.
FromLine int `json:"from_line"`
// ToColumn Column at which the code snippet ends.
ToColumn *int `json:"to_column,omitempty"`
// ToLine Line on which the code snippet ends.
ToLine *int `json:"to_line,omitempty"`
Type SourceLocationType `json:"type"`
}
SourceLocation Source file location.
Finding types: SCA, SAST
type SourceLocationType ¶
type SourceLocationType string
SourceLocationType defines model for SourceLocation.Type.
const (
SourceLocationTypeSource SourceLocationType = "source"
)
Defines values for SourceLocationType.
type StartTestParams ¶
type StartTestParams struct {
// contains filtered or unexported fields
}
StartTestParams defines parameters for the high-level StartTest function.
func NewStartTestParamsFromResources ¶
func NewStartTestParamsFromResources(orgID string, resources *[]TestResourceCreateItem, config *TestConfiguration) StartTestParams
NewStartTestParamsFromResources creates params for a resources-based test.
func NewStartTestParamsFromSubject ¶
func NewStartTestParamsFromSubject(orgID string, subject *TestSubjectCreate, config *TestConfiguration) StartTestParams
NewStartTestParamsFromSubject creates params for a subject-based test. ScanConfig within TestConfiguration is not supported for subject-based tests.
func (StartTestParams) OrgID ¶
func (p StartTestParams) OrgID() string
func (StartTestParams) Resources ¶
func (p StartTestParams) Resources() *[]TestResourceCreateItem
func (StartTestParams) Subject ¶
func (p StartTestParams) Subject() *TestSubjectCreate
func (StartTestParams) TestConfig ¶
func (p StartTestParams) TestConfig() *TestConfiguration
type Suppression ¶
type Suppression struct {
// CreatedAt When the suppression was first created.
CreatedAt *time.Time `json:"created_at,omitempty"`
// ExpiresAt When the suppression will expire.
ExpiresAt *time.Time `json:"expires_at,omitempty"`
// Justification Reason given for an ignore pending approval.
Justification *string `json:"justification,omitempty"`
// Path Dependency path to the vulnerable package to be suppressed.
//
// If not provided, the suppression will apply to all packages with the given
// vulnerability ID.
Path *[]string `json:"path,omitempty"`
// Policy Policy responsible for the state of suppression represented here, if available.
Policy *PolicyRef `json:"policy,omitempty"`
// SkipIfFixable Skip the suppression if an actual fix is available.
SkipIfFixable *bool `json:"skipIfFixable,omitempty"`
// Status Status of the suppression.
Status SuppressionStatus `json:"status"`
}
Suppression Details about a finding's suppression in test results.
Suppressed findings do not contribute to the test outcome, but they are still provided in the results.
type SuppressionStatus ¶
type SuppressionStatus string
SuppressionStatus Status of a suppression on a finding.
const ( SuppressionStatusIgnored SuppressionStatus = "ignored" SuppressionStatusOther SuppressionStatus = "other" SuppressionStatusPendingIgnoreApproval SuppressionStatus = "pending_ignore_approval" )
Defines values for SuppressionStatus.
type TestAttributes ¶
type TestAttributes struct {
// Components Scanned Components of the tested content.
//
// Unique on a per-test basis, originating from a single Scan type
// though a single Scan may identify multiple Components.
Components *[]TestComponent `json:"components,omitempty"`
// Config The test configuration. If not specified, caller accepts test configuration
// defaults within the calling scope (org, group or tenant settings, etc).
Config *TestConfiguration `json:"config,omitempty"`
// CreatedAt Creation time of the test resource.
CreatedAt *time.Time `json:"created_at,omitempty"`
// EffectiveSummary Summary of findings discovered by the test, effective to the outcome
// decision. This summary excludes findings suppressed by policy.
//
// This attribute is set when the test execution
// completes (state.execution == 'finished') successfully (without fatal errors
// blocking an outcome).
EffectiveSummary *FindingSummary `json:"effective_summary,omitempty"`
// Outcome The outcome of the test.
//
// This attribute is set when the test execution
// completes (state.execution == 'completed') successfully (without fatal errors
// blocking an outcome).
Outcome *TestOutcome `json:"outcome,omitempty"`
// RawSummary Summary of findings regardless of whether they are effective or not. This
// summary includes all findings, even those suppressed by policy.
//
// This attribute is set when the test execution
// completes (state.execution == 'finished') successfully (without fatal errors
// blocking an outcome).
RawSummary *FindingSummary `json:"raw_summary,omitempty"`
// Resources The units of testable content to be scanned by Snyk.
//
// Resources are provided in conjunction with the ScanConfiguration,
// and appropriate scans to run are determined from that combination.
//
// There is a "best-fit" approach taken, and not all Resources will be
// scanned by all requested scanners. E.g. Container resources cannot be
// scanned by the SAST scanner.
Resources *[]TestResource `json:"resources,omitempty"`
// SdlcStage SDLC stage where the test was initiated.
SdlcStage *SdlcStage `json:"sdlc_stage,omitempty"`
// State The state of the test's execution.
State *TestState `json:"state,omitempty"`
// Subject **Deprecated**
//
// Use an equivalent combination of Resources and
// Scan Configurations instead. See Subject descriptions
// for appropriate replacements.
//
// The subject of a test.
Subject *TestSubject `json:"subject,omitempty"`
// SubjectLocators **Deprecated**
//
// Metadata about testable content is located on
// Resources directly.
//
// Additional locators which may help locate the test subject across test workflows.
//
// Test subjects generally will have a primary locator. Additional locators
// may be provided to help link the test to existing projects and/or assets in
// the Snyk platform.
SubjectLocators *[]TestSubjectLocator `json:"subject_locators,omitempty"`
// TestFacts Facts about the test that were computed during test execution.
TestFacts *[]TestFact `json:"test_facts,omitempty"`
// UserPublicId Public identifier of the user who initiated the test.
UserPublicId *string `json:"user_public_id,omitempty"`
}
TestAttributes TestAttributes represents the attributes of a Test resource.
type TestAttributesCreate ¶
type TestAttributesCreate struct {
// Config The test configuration. If not specified, caller accepts test configuration
// defaults within the calling scope (org, group or tenant settings, etc).
Config *TestConfiguration `json:"config,omitempty"`
// Resources The units of testable content to be scanned by Snyk.
//
// Resources are provided in conjunction with the ScanConfiguration,
// and appropriate scans to run are determined from that combination.
//
// There is a "best-fit" approach taken, and not all Resources will be
// scanned by all requested scanners. E.g. Container resources cannot be
// scanned by the SAST scanner.
Resources *[]TestResourceCreateItem `json:"resources,omitempty"`
// SdlcStage SDLC stage where the test was initiated.
SdlcStage *SdlcStage `json:"sdlc_stage,omitempty"`
// Subject **Deprecated**
//
// Use an equivalent combination of Resources and
// Scan Configurations instead. See Subject descriptions
// for appropriate replacements.
//
// The subject of a test.
Subject *TestSubjectCreate `json:"subject,omitempty"`
// SubjectLocators **Deprecated**
//
// Metadata about testable content is located on
// Resources directly.
//
// Additional locators which may help locate the test subject across test workflows.
//
// Test subjects generally will have a primary locator. Additional locators
// may be provided to help link the test to existing projects and/or assets in
// the Snyk platform.
SubjectLocators *[]TestSubjectLocator `json:"subject_locators,omitempty"`
// UserPublicId Public identifier of the user who initiated the test.
UserPublicId *string `json:"user_public_id,omitempty"`
}
TestAttributesCreate TestAttributes represents the attributes of a Test resource.
type TestClient ¶
type TestClient interface {
StartTest(ctx context.Context, params StartTestParams) (TestHandle, error)
}
func NewTestClient ¶
func NewTestClient(serverBaseUrl string, options ...ConfigOption) (TestClient, error)
NewTestClient returns a new instance of the test client, configured with the provided options.
type TestComponent ¶
type TestComponent struct {
// AssetId ID of Asset associated with Component.
AssetId *Uuid `json:"asset_id,omitempty"`
// Key Key identifying the component within the Test.
Key String256 `json:"key"`
// ProjectId ID of Project associated with Component.
ProjectId *Uuid `json:"project_id,omitempty"`
// ScanType Type of Scanner producing Findings associated with this
// Component.
ScanType FindingType `json:"scan_type"`
}
TestComponent TestComponent represents a Test Component.
type TestConfiguration ¶
type TestConfiguration struct {
// LocalPolicy Inline configured policy options for determining outcome of this specific test.
//
// If centrally managed policies are in scope, inline policies are overridden
// by managed policies. Policy references explain which policies were
// effective for test evaluation.
LocalPolicy *LocalPolicy `json:"local_policy,omitempty"`
ProjectBusinessCriticality *string `json:"project_business_criticality,omitempty"`
ProjectEnvironment *[]string `json:"project_environment,omitempty"`
ProjectLifecycle *[]string `json:"project_lifecycle,omitempty"`
ProjectTags *[]string `json:"project_tags,omitempty"`
// PublishReport Publish findings into a report, viewable in the Snyk web UI.
PublishReport *bool `json:"publish_report,omitempty"`
// ScanConfig A map of scanner types to their specific set of
// configuration parameters.
//
// The presence of a scanner's configuration in the
// provided ScanConfiguration is used to determine what scans
// to run on the list of Resources provided.
//
// Note that an empty config object is different than
// omitting the field. An omitted scanner config results in
// that scanner not being run. A provided empty scan config
// will run the scanner if it is possible.
ScanConfig *ScanConfiguration `json:"scan_config,omitempty"`
TargetName *string `json:"target_name,omitempty"`
// TargetReference Fields from CLI.
TargetReference *string `json:"target_reference,omitempty"`
// Timeout Maximum test time in seconds, after which execution will be cancelled and
// the test will fail with reason "timeout".
Timeout *TimeoutSpec `json:"timeout,omitempty"`
}
TestConfiguration Test configuration.
type TestData ¶
type TestData struct {
// Attributes TestAttributes represents the attributes of a Test resource.
Attributes TestAttributes `json:"attributes"`
Id *openapi_types.UUID `json:"id,omitempty"`
Links *struct {
// Findings Link to the findings discovered by the test, when it completes.
Findings *IoSnykApiCommonLinkProperty `json:"findings,omitempty"`
} `json:"links,omitempty"`
Type TestDataType `json:"type"`
}
TestData TestData represents a Test resource object.
type TestDataCreate ¶
type TestDataCreate struct {
// Attributes TestAttributes represents the attributes of a Test resource.
Attributes TestAttributesCreate `json:"attributes"`
Type TestDataCreateType `json:"type"`
}
TestDataCreate TestData represents a Test resource object.
type TestDataCreateType ¶
type TestDataCreateType string
TestDataCreateType defines model for TestDataCreate.Type.
const (
Tests TestDataCreateType = "tests"
)
Defines values for TestDataCreateType.
type TestDataType ¶
type TestDataType string
TestDataType defines model for TestData.Type.
const (
TestDataTypeTests TestDataType = "tests"
)
Defines values for TestDataType.
type TestExecutionStates ¶
type TestExecutionStates string
TestExecutionStates defines model for TestExecutionStates.
const ( TestExecutionStatesErrored TestExecutionStates = "errored" TestExecutionStatesFinished TestExecutionStates = "finished" TestExecutionStatesPending TestExecutionStates = "pending" TestExecutionStatesStarted TestExecutionStates = "started" )
Defines values for TestExecutionStates.
type TestFact ¶
type TestFact = DependencyCountFact
TestFact DependencyCountFact represents a dependency count fact.
type TestHandle ¶
type TestHandle interface {
Wait(ctx context.Context) error
Done() <-chan struct{}
Result() TestResult
}
TestHandle allows for starting a test and waiting on its response
type TestOutcome ¶
type TestOutcome struct {
// BreachedPolicies Test-level policies which were breached in a failing outcome.
//
// This array may be truncated for a large number of policies.
BreachedPolicies *PolicyRefSet `json:"breached_policies,omitempty"`
// Reason Reason for the outcome, if applicable.
Reason *TestOutcomeReason `json:"reason,omitempty"`
// Result Whether the test passed or failed.
Result PassFail `json:"result"`
}
TestOutcome Outcome of a test; pass or fail.
type TestOutcomeReason ¶
type TestOutcomeReason string
TestOutcomeReason Reasons for the outcome.
const ( TestOutcomeReasonOther TestOutcomeReason = "other" TestOutcomeReasonPolicyBreach TestOutcomeReason = "policy_breach" TestOutcomeReasonTimeout TestOutcomeReason = "timeout" )
Defines values for TestOutcomeReason.
type TestRequestBody ¶
type TestRequestBody struct {
// Data TestData represents a Test resource object.
Data TestDataCreate `json:"data"`
}
TestRequestBody TestRequestBody represents the request body used when creating an Test.
type TestResource ¶
type TestResource struct {
// contains filtered or unexported fields
}
TestResource TestResources contain single instances of testable content to be provided to Snyk scanners.
func (TestResource) AsBaseResource ¶
func (t TestResource) AsBaseResource() (BaseResource, error)
AsBaseResource returns the union data inside the TestResource as a BaseResource
func (TestResource) AsDiffResource ¶
func (t TestResource) AsDiffResource() (DiffResource, error)
AsDiffResource returns the union data inside the TestResource as a DiffResource
func (TestResource) Discriminator ¶
func (t TestResource) Discriminator() (string, error)
func (*TestResource) FromBaseResource ¶
func (t *TestResource) FromBaseResource(v BaseResource) error
FromBaseResource overwrites any union data inside the TestResource as the provided BaseResource
func (*TestResource) FromDiffResource ¶
func (t *TestResource) FromDiffResource(v DiffResource) error
FromDiffResource overwrites any union data inside the TestResource as the provided DiffResource
func (TestResource) MarshalJSON ¶
func (t TestResource) MarshalJSON() ([]byte, error)
func (*TestResource) MergeBaseResource ¶
func (t *TestResource) MergeBaseResource(v BaseResource) error
MergeBaseResource performs a merge with any union data inside the TestResource, using the provided BaseResource
func (*TestResource) MergeDiffResource ¶
func (t *TestResource) MergeDiffResource(v DiffResource) error
MergeDiffResource performs a merge with any union data inside the TestResource, using the provided DiffResource
func (*TestResource) UnmarshalJSON ¶
func (t *TestResource) UnmarshalJSON(b []byte) error
func (TestResource) ValueByDiscriminator ¶
func (t TestResource) ValueByDiscriminator() (interface{}, error)
type TestResourceCreateItem ¶
type TestResourceCreateItem struct {
// contains filtered or unexported fields
}
TestResourceCreateItem TestResources contain single instances of testable content to be provided to Snyk scanners.
func (TestResourceCreateItem) AsBaseResourceCreateItem ¶
func (t TestResourceCreateItem) AsBaseResourceCreateItem() (BaseResourceCreateItem, error)
AsBaseResourceCreateItem returns the union data inside the TestResourceCreateItem as a BaseResourceCreateItem
func (TestResourceCreateItem) AsDiffResourceCreateItem ¶
func (t TestResourceCreateItem) AsDiffResourceCreateItem() (DiffResourceCreateItem, error)
AsDiffResourceCreateItem returns the union data inside the TestResourceCreateItem as a DiffResourceCreateItem
func (TestResourceCreateItem) Discriminator ¶
func (t TestResourceCreateItem) Discriminator() (string, error)
func (*TestResourceCreateItem) FromBaseResourceCreateItem ¶
func (t *TestResourceCreateItem) FromBaseResourceCreateItem(v BaseResourceCreateItem) error
FromBaseResourceCreateItem overwrites any union data inside the TestResourceCreateItem as the provided BaseResourceCreateItem
func (*TestResourceCreateItem) FromDiffResourceCreateItem ¶
func (t *TestResourceCreateItem) FromDiffResourceCreateItem(v DiffResourceCreateItem) error
FromDiffResourceCreateItem overwrites any union data inside the TestResourceCreateItem as the provided DiffResourceCreateItem
func (TestResourceCreateItem) MarshalJSON ¶
func (t TestResourceCreateItem) MarshalJSON() ([]byte, error)
func (*TestResourceCreateItem) MergeBaseResourceCreateItem ¶
func (t *TestResourceCreateItem) MergeBaseResourceCreateItem(v BaseResourceCreateItem) error
MergeBaseResourceCreateItem performs a merge with any union data inside the TestResourceCreateItem, using the provided BaseResourceCreateItem
func (*TestResourceCreateItem) MergeDiffResourceCreateItem ¶
func (t *TestResourceCreateItem) MergeDiffResourceCreateItem(v DiffResourceCreateItem) error
MergeDiffResourceCreateItem performs a merge with any union data inside the TestResourceCreateItem, using the provided DiffResourceCreateItem
func (*TestResourceCreateItem) UnmarshalJSON ¶
func (t *TestResourceCreateItem) UnmarshalJSON(b []byte) error
func (TestResourceCreateItem) ValueByDiscriminator ¶
func (t TestResourceCreateItem) ValueByDiscriminator() (interface{}, error)
type TestResult ¶
type TestResult interface {
GetTestID() *uuid.UUID
GetTestConfiguration() *TestConfiguration
GetCreatedAt() *time.Time
Get(key TestResultKeys) interface{}
// Deprecated: Use Get(testapi.TestResultTestSubject) instead.
GetTestSubject() *TestSubject
// Deprecated: Use Get(testapi.TestResultSubjectLocators) instead.
GetSubjectLocators() *[]TestSubjectLocator
// Deprecated: Use Get(testapi.TestResultTestResources) instead.
GetTestResources() *[]TestResource
GetExecutionState() TestExecutionStates
GetErrors() *[]IoSnykApiCommonError
GetWarnings() *[]IoSnykApiCommonError
GetPassFail() *PassFail
GetOutcomeReason() *TestOutcomeReason
// Deprecated: Use Get(testapi.TestResultBreachedPolicies) instead.
GetBreachedPolicies() *PolicyRefSet
GetEffectiveSummary() *FindingSummary
// Deprecated: Use Get(testapi.TestResultRawSummary) instead.
GetRawSummary() *FindingSummary
// Deprecated: Use Get(testapi.TestResultTestFacts) instead.
GetTestFacts() *[]TestFact
SetMetadata(key string, value interface{})
GetMetadataValue(key string) interface{}
// Deprecated: Use Get(testapi.TestResultMetadata) instead.
GetMetadata() map[string]interface{}
Findings(ctx context.Context) (resultFindings []FindingData, complete bool, err error)
}
TestResult defines the contract for accessing test result information.
type TestResultKeys ¶
type TestResultKeys string
TestResultKeys represents the keys for accessing test result data.
const ( TestResultTestSubject TestResultKeys = "subject" TestResultSubjectLocators TestResultKeys = "subject_locators" TestResultTestResources TestResultKeys = "resources" TestResultRawSummary TestResultKeys = "raw_summary" TestResultTestFacts TestResultKeys = "test_facts" TestResultBreachedPolicies TestResultKeys = "breached_policies" TestResultMetadata TestResultKeys = "metadata" TestResultComponents TestResultKeys = "components" )
type TestState ¶
type TestState struct {
// Errors Errors which occurred during the execution of a test.
//
// If execution state is errored, at least one error will be
// indicated here.
Errors *[]IoSnykApiCommonError `json:"errors,omitempty"`
// Execution Current execution state of the test. This should be polled to completion
// ("completed" or "errored") when waiting for a test result.
//
// Completion is no guarantee of an outcome in the event of fatal errors.
Execution TestExecutionStates `json:"execution"`
// Warnings Non-fatal errors which occurred during the execution of a test.
//
// Execution state and warnings are not linked; any of passed/failed/
// errored tests can have warnings.
Warnings *[]IoSnykApiCommonError `json:"warnings,omitempty"`
}
TestState Test execution state information.
type TestSubject ¶
type TestSubject struct {
// contains filtered or unexported fields
}
TestSubject The subject of a test, which identifies the asset/project and content references necessary to conduct a security test.
func (TestSubject) AsDeepcodeBundleSubject ¶
func (t TestSubject) AsDeepcodeBundleSubject() (DeepcodeBundleSubject, error)
AsDeepcodeBundleSubject returns the union data inside the TestSubject as a DeepcodeBundleSubject
func (TestSubject) AsDepGraphSubject ¶
func (t TestSubject) AsDepGraphSubject() (DepGraphSubject, error)
AsDepGraphSubject returns the union data inside the TestSubject as a DepGraphSubject
func (TestSubject) AsGitUrlCoordinatesSubject ¶
func (t TestSubject) AsGitUrlCoordinatesSubject() (GitUrlCoordinatesSubject, error)
AsGitUrlCoordinatesSubject returns the union data inside the TestSubject as a GitUrlCoordinatesSubject
func (TestSubject) AsOtherSubject ¶
func (t TestSubject) AsOtherSubject() (OtherSubject, error)
AsOtherSubject returns the union data inside the TestSubject as a OtherSubject
func (TestSubject) AsSbomReachabilitySubject ¶
func (t TestSubject) AsSbomReachabilitySubject() (SbomReachabilitySubject, error)
AsSbomReachabilitySubject returns the union data inside the TestSubject as a SbomReachabilitySubject
func (TestSubject) AsSbomSubject ¶
func (t TestSubject) AsSbomSubject() (SbomSubject, error)
AsSbomSubject returns the union data inside the TestSubject as a SbomSubject
func (TestSubject) Discriminator ¶
func (t TestSubject) Discriminator() (string, error)
func (*TestSubject) FromDeepcodeBundleSubject ¶
func (t *TestSubject) FromDeepcodeBundleSubject(v DeepcodeBundleSubject) error
FromDeepcodeBundleSubject overwrites any union data inside the TestSubject as the provided DeepcodeBundleSubject
func (*TestSubject) FromDepGraphSubject ¶
func (t *TestSubject) FromDepGraphSubject(v DepGraphSubject) error
FromDepGraphSubject overwrites any union data inside the TestSubject as the provided DepGraphSubject
func (*TestSubject) FromGitUrlCoordinatesSubject ¶
func (t *TestSubject) FromGitUrlCoordinatesSubject(v GitUrlCoordinatesSubject) error
FromGitUrlCoordinatesSubject overwrites any union data inside the TestSubject as the provided GitUrlCoordinatesSubject
func (*TestSubject) FromOtherSubject ¶
func (t *TestSubject) FromOtherSubject(v OtherSubject) error
FromOtherSubject overwrites any union data inside the TestSubject as the provided OtherSubject
func (*TestSubject) FromSbomReachabilitySubject ¶
func (t *TestSubject) FromSbomReachabilitySubject(v SbomReachabilitySubject) error
FromSbomReachabilitySubject overwrites any union data inside the TestSubject as the provided SbomReachabilitySubject
func (*TestSubject) FromSbomSubject ¶
func (t *TestSubject) FromSbomSubject(v SbomSubject) error
FromSbomSubject overwrites any union data inside the TestSubject as the provided SbomSubject
func (TestSubject) MarshalJSON ¶
func (t TestSubject) MarshalJSON() ([]byte, error)
func (*TestSubject) MergeDeepcodeBundleSubject ¶
func (t *TestSubject) MergeDeepcodeBundleSubject(v DeepcodeBundleSubject) error
MergeDeepcodeBundleSubject performs a merge with any union data inside the TestSubject, using the provided DeepcodeBundleSubject
func (*TestSubject) MergeDepGraphSubject ¶
func (t *TestSubject) MergeDepGraphSubject(v DepGraphSubject) error
MergeDepGraphSubject performs a merge with any union data inside the TestSubject, using the provided DepGraphSubject
func (*TestSubject) MergeGitUrlCoordinatesSubject ¶
func (t *TestSubject) MergeGitUrlCoordinatesSubject(v GitUrlCoordinatesSubject) error
MergeGitUrlCoordinatesSubject performs a merge with any union data inside the TestSubject, using the provided GitUrlCoordinatesSubject
func (*TestSubject) MergeOtherSubject ¶
func (t *TestSubject) MergeOtherSubject(v OtherSubject) error
MergeOtherSubject performs a merge with any union data inside the TestSubject, using the provided OtherSubject
func (*TestSubject) MergeSbomReachabilitySubject ¶
func (t *TestSubject) MergeSbomReachabilitySubject(v SbomReachabilitySubject) error
MergeSbomReachabilitySubject performs a merge with any union data inside the TestSubject, using the provided SbomReachabilitySubject
func (*TestSubject) MergeSbomSubject ¶
func (t *TestSubject) MergeSbomSubject(v SbomSubject) error
MergeSbomSubject performs a merge with any union data inside the TestSubject, using the provided SbomSubject
func (*TestSubject) UnmarshalJSON ¶
func (t *TestSubject) UnmarshalJSON(b []byte) error
func (TestSubject) ValueByDiscriminator ¶
func (t TestSubject) ValueByDiscriminator() (interface{}, error)
type TestSubjectCreate ¶
type TestSubjectCreate struct {
// contains filtered or unexported fields
}
TestSubjectCreate The subject of a test, which identifies the asset/project and content references necessary to conduct a security test.
func (TestSubjectCreate) AsDeepcodeBundleSubject ¶
func (t TestSubjectCreate) AsDeepcodeBundleSubject() (DeepcodeBundleSubject, error)
AsDeepcodeBundleSubject returns the union data inside the TestSubjectCreate as a DeepcodeBundleSubject
func (TestSubjectCreate) AsDepGraphSubjectCreate ¶
func (t TestSubjectCreate) AsDepGraphSubjectCreate() (DepGraphSubjectCreate, error)
AsDepGraphSubjectCreate returns the union data inside the TestSubjectCreate as a DepGraphSubjectCreate
func (TestSubjectCreate) AsGitUrlCoordinatesSubject ¶
func (t TestSubjectCreate) AsGitUrlCoordinatesSubject() (GitUrlCoordinatesSubject, error)
AsGitUrlCoordinatesSubject returns the union data inside the TestSubjectCreate as a GitUrlCoordinatesSubject
func (TestSubjectCreate) AsOtherSubject ¶
func (t TestSubjectCreate) AsOtherSubject() (OtherSubject, error)
AsOtherSubject returns the union data inside the TestSubjectCreate as a OtherSubject
func (TestSubjectCreate) AsSbomReachabilitySubject ¶
func (t TestSubjectCreate) AsSbomReachabilitySubject() (SbomReachabilitySubject, error)
AsSbomReachabilitySubject returns the union data inside the TestSubjectCreate as a SbomReachabilitySubject
func (TestSubjectCreate) AsSbomSubject ¶
func (t TestSubjectCreate) AsSbomSubject() (SbomSubject, error)
AsSbomSubject returns the union data inside the TestSubjectCreate as a SbomSubject
func (TestSubjectCreate) Discriminator ¶
func (t TestSubjectCreate) Discriminator() (string, error)
func (*TestSubjectCreate) FromDeepcodeBundleSubject ¶
func (t *TestSubjectCreate) FromDeepcodeBundleSubject(v DeepcodeBundleSubject) error
FromDeepcodeBundleSubject overwrites any union data inside the TestSubjectCreate as the provided DeepcodeBundleSubject
func (*TestSubjectCreate) FromDepGraphSubjectCreate ¶
func (t *TestSubjectCreate) FromDepGraphSubjectCreate(v DepGraphSubjectCreate) error
FromDepGraphSubjectCreate overwrites any union data inside the TestSubjectCreate as the provided DepGraphSubjectCreate
func (*TestSubjectCreate) FromGitUrlCoordinatesSubject ¶
func (t *TestSubjectCreate) FromGitUrlCoordinatesSubject(v GitUrlCoordinatesSubject) error
FromGitUrlCoordinatesSubject overwrites any union data inside the TestSubjectCreate as the provided GitUrlCoordinatesSubject
func (*TestSubjectCreate) FromOtherSubject ¶
func (t *TestSubjectCreate) FromOtherSubject(v OtherSubject) error
FromOtherSubject overwrites any union data inside the TestSubjectCreate as the provided OtherSubject
func (*TestSubjectCreate) FromSbomReachabilitySubject ¶
func (t *TestSubjectCreate) FromSbomReachabilitySubject(v SbomReachabilitySubject) error
FromSbomReachabilitySubject overwrites any union data inside the TestSubjectCreate as the provided SbomReachabilitySubject
func (*TestSubjectCreate) FromSbomSubject ¶
func (t *TestSubjectCreate) FromSbomSubject(v SbomSubject) error
FromSbomSubject overwrites any union data inside the TestSubjectCreate as the provided SbomSubject
func (TestSubjectCreate) MarshalJSON ¶
func (t TestSubjectCreate) MarshalJSON() ([]byte, error)
func (*TestSubjectCreate) MergeDeepcodeBundleSubject ¶
func (t *TestSubjectCreate) MergeDeepcodeBundleSubject(v DeepcodeBundleSubject) error
MergeDeepcodeBundleSubject performs a merge with any union data inside the TestSubjectCreate, using the provided DeepcodeBundleSubject
func (*TestSubjectCreate) MergeDepGraphSubjectCreate ¶
func (t *TestSubjectCreate) MergeDepGraphSubjectCreate(v DepGraphSubjectCreate) error
MergeDepGraphSubjectCreate performs a merge with any union data inside the TestSubjectCreate, using the provided DepGraphSubjectCreate
func (*TestSubjectCreate) MergeGitUrlCoordinatesSubject ¶
func (t *TestSubjectCreate) MergeGitUrlCoordinatesSubject(v GitUrlCoordinatesSubject) error
MergeGitUrlCoordinatesSubject performs a merge with any union data inside the TestSubjectCreate, using the provided GitUrlCoordinatesSubject
func (*TestSubjectCreate) MergeOtherSubject ¶
func (t *TestSubjectCreate) MergeOtherSubject(v OtherSubject) error
MergeOtherSubject performs a merge with any union data inside the TestSubjectCreate, using the provided OtherSubject
func (*TestSubjectCreate) MergeSbomReachabilitySubject ¶
func (t *TestSubjectCreate) MergeSbomReachabilitySubject(v SbomReachabilitySubject) error
MergeSbomReachabilitySubject performs a merge with any union data inside the TestSubjectCreate, using the provided SbomReachabilitySubject
func (*TestSubjectCreate) MergeSbomSubject ¶
func (t *TestSubjectCreate) MergeSbomSubject(v SbomSubject) error
MergeSbomSubject performs a merge with any union data inside the TestSubjectCreate, using the provided SbomSubject
func (*TestSubjectCreate) UnmarshalJSON ¶
func (t *TestSubjectCreate) UnmarshalJSON(b []byte) error
func (TestSubjectCreate) ValueByDiscriminator ¶
func (t TestSubjectCreate) ValueByDiscriminator() (interface{}, error)
type TestSubjectLocator ¶
type TestSubjectLocator struct {
// contains filtered or unexported fields
}
TestSubjectLocator defines model for TestSubjectLocator.
func (TestSubjectLocator) AsLocalPathLocator ¶
func (t TestSubjectLocator) AsLocalPathLocator() (LocalPathLocator, error)
AsLocalPathLocator returns the union data inside the TestSubjectLocator as a LocalPathLocator
func (TestSubjectLocator) AsOtherLocator ¶
func (t TestSubjectLocator) AsOtherLocator() (OtherLocator, error)
AsOtherLocator returns the union data inside the TestSubjectLocator as a OtherLocator
func (TestSubjectLocator) AsProjectEntityLocator ¶
func (t TestSubjectLocator) AsProjectEntityLocator() (ProjectEntityLocator, error)
AsProjectEntityLocator returns the union data inside the TestSubjectLocator as a ProjectEntityLocator
func (TestSubjectLocator) AsProjectNameLocator ¶
func (t TestSubjectLocator) AsProjectNameLocator() (ProjectNameLocator, error)
AsProjectNameLocator returns the union data inside the TestSubjectLocator as a ProjectNameLocator
func (TestSubjectLocator) AsScmRepoLocator ¶
func (t TestSubjectLocator) AsScmRepoLocator() (ScmRepoLocator, error)
AsScmRepoLocator returns the union data inside the TestSubjectLocator as a ScmRepoLocator
func (TestSubjectLocator) Discriminator ¶
func (t TestSubjectLocator) Discriminator() (string, error)
func (*TestSubjectLocator) FromLocalPathLocator ¶
func (t *TestSubjectLocator) FromLocalPathLocator(v LocalPathLocator) error
FromLocalPathLocator overwrites any union data inside the TestSubjectLocator as the provided LocalPathLocator
func (*TestSubjectLocator) FromOtherLocator ¶
func (t *TestSubjectLocator) FromOtherLocator(v OtherLocator) error
FromOtherLocator overwrites any union data inside the TestSubjectLocator as the provided OtherLocator
func (*TestSubjectLocator) FromProjectEntityLocator ¶
func (t *TestSubjectLocator) FromProjectEntityLocator(v ProjectEntityLocator) error
FromProjectEntityLocator overwrites any union data inside the TestSubjectLocator as the provided ProjectEntityLocator
func (*TestSubjectLocator) FromProjectNameLocator ¶
func (t *TestSubjectLocator) FromProjectNameLocator(v ProjectNameLocator) error
FromProjectNameLocator overwrites any union data inside the TestSubjectLocator as the provided ProjectNameLocator
func (*TestSubjectLocator) FromScmRepoLocator ¶
func (t *TestSubjectLocator) FromScmRepoLocator(v ScmRepoLocator) error
FromScmRepoLocator overwrites any union data inside the TestSubjectLocator as the provided ScmRepoLocator
func (TestSubjectLocator) MarshalJSON ¶
func (t TestSubjectLocator) MarshalJSON() ([]byte, error)
func (*TestSubjectLocator) MergeLocalPathLocator ¶
func (t *TestSubjectLocator) MergeLocalPathLocator(v LocalPathLocator) error
MergeLocalPathLocator performs a merge with any union data inside the TestSubjectLocator, using the provided LocalPathLocator
func (*TestSubjectLocator) MergeOtherLocator ¶
func (t *TestSubjectLocator) MergeOtherLocator(v OtherLocator) error
MergeOtherLocator performs a merge with any union data inside the TestSubjectLocator, using the provided OtherLocator
func (*TestSubjectLocator) MergeProjectEntityLocator ¶
func (t *TestSubjectLocator) MergeProjectEntityLocator(v ProjectEntityLocator) error
MergeProjectEntityLocator performs a merge with any union data inside the TestSubjectLocator, using the provided ProjectEntityLocator
func (*TestSubjectLocator) MergeProjectNameLocator ¶
func (t *TestSubjectLocator) MergeProjectNameLocator(v ProjectNameLocator) error
MergeProjectNameLocator performs a merge with any union data inside the TestSubjectLocator, using the provided ProjectNameLocator
func (*TestSubjectLocator) MergeScmRepoLocator ¶
func (t *TestSubjectLocator) MergeScmRepoLocator(v ScmRepoLocator) error
MergeScmRepoLocator performs a merge with any union data inside the TestSubjectLocator, using the provided ScmRepoLocator
func (*TestSubjectLocator) UnmarshalJSON ¶
func (t *TestSubjectLocator) UnmarshalJSON(b []byte) error
func (TestSubjectLocator) ValueByDiscriminator ¶
func (t TestSubjectLocator) ValueByDiscriminator() (interface{}, error)
type TimeoutSpec ¶
type TimeoutSpec struct {
// Outcome Indicate whether a Test passes or fails.
Outcome PassFail `json:"outcome"`
Seconds uint32 `json:"seconds"`
}
TimeoutSpec Specification for a test timeout policy. If the test does not complete within the seconds specified, the test will instantly complete with the given outcome.
type UpgradePackageAdvice ¶
type UpgradePackageAdvice struct {
Format UpgradePackageAdviceFormat `json:"format"`
// PackageName The package that's receiving an upgrade to fix this vulnerability
PackageName string `json:"package_name"`
// UpgradePaths Upgrading a package may lead to one or more paths to change. These paths are modelled as evidence
// in DependencyPathEvidence.
//
// Ultimately upgradePaths illustrates the minimum version upgrades that need to happen to apply this action.
UpgradePaths []UpgradePath `json:"upgrade_paths"`
}
UpgradePackageAdvice Upgrade a package from one version to another.
type UpgradePackageAdviceFormat ¶
type UpgradePackageAdviceFormat string
UpgradePackageAdviceFormat defines model for UpgradePackageAdvice.Format.
const (
UpgradePackageAdviceFormatUpgradePackageAdvice UpgradePackageAdviceFormat = "upgrade_package_advice"
)
Defines values for UpgradePackageAdviceFormat.
type UpgradePath ¶
type UpgradePath struct {
DependencyPath []Package `json:"dependency_path"`
// IsDrop A drop describes an upgrade path, where the vulnerability gets addressed by removing the vulnerable dependency.
// This typically happens when a package somewhere mid-way drops this library in newer versions.
//
// Note: For drops, the length of the upgradePath will be smaller than the length of the original dependencyPath.
IsDrop bool `json:"is_drop"`
}
UpgradePath Upgrade path model all known dependency paths that will change when applying an upgrade action.
type UploadResource ¶
type UploadResource struct {
// ContentType Content present in the Upload Revision.
//
// Currently only SBOMs and Source files are accepted
// content types.
ContentType UploadResourceContentType `json:"content_type"`
// FilePatterns File Patterns to include in the scan. Elements must be less than 256 characters.
//
// Currently unsupported. Provide an empty list.
FilePatterns []String256 `json:"file_patterns"`
// Name A name to assign to the SBOM contained in the UploadRevision.
//
// Overrides the filename in the UploadRevision.
Name *string `json:"name,omitempty"`
// RepositoryUrl Repository URL at which the Source files are stored.
RepositoryUrl *string `json:"repository_url,omitempty"`
// RevisionId The ID returned from the File Upload API for a given Revision.
// The File Upload API is released in Closed Beta.
// Customers with access may view the preview documentation for
// information on its usage.
RevisionId string `json:"revision_id"`
// RootFolderId Folder inside the UploadRevision at which the Source files are located.
RootFolderId *string `json:"root_folder_id,omitempty"`
// ScmContext Additional SCM information about a resource.
// Provides context about where the content came from; the resource itself is the testable item.
// ScmResource does not use this; it identifies SCM via its own fields.
ScmContext *ScmContext `json:"scm_context,omitempty"`
Type UploadResourceType `json:"type"`
}
UploadResource Resource referring to an Upload Revision created through the File Upload API (currently in Closed Beta).
Revisions contain collections of files uploaded by clients to Snyk for testing.
UploadResources can be marked either as SBOM or Source to indicate the contents of the Revision.
SBOM UploadResources should provide the following fields: - type - revision_id - name - file_patterns (may be empty)
Source UploadResources should provide the following fields: - type - revision_id - repository_url - root_folder_id - file_patterns (may be empty)
Currently supported scans utilizing UploadResources are: - SBOM (SCA): (1) UploadResource containing an SBOM - SBOM + Reachability Analysis (SCA): (1) UploadResource containing an SBOM, (1) UploadResource containing Source files. - Secrets: (1) UploadResource containing Source files
type UploadResourceContentType ¶
type UploadResourceContentType string
UploadResourceContentType Content present in the Upload Revision.
Currently only SBOMs and Source files are accepted content types.
const ( UploadResourceContentTypeSbom UploadResourceContentType = "sbom" UploadResourceContentTypeSource UploadResourceContentType = "source" )
Defines values for UploadResourceContentType.
type UploadResourceType ¶
type UploadResourceType string
UploadResourceType defines model for UploadResource.Type.
const (
Upload UploadResourceType = "upload"
)
Defines values for UploadResourceType.