Documentation ¶
Index ¶
- Variables
- func ComposeAMQPDelivery(a AnalysisRequest) (*amqp.Delivery, error)
- func ComposeAMQPPublishing(a AnalysisRequest) (*amqp.Publishing, error)
- func GetResultFilesByEcosystem(eco ecosystem.Ecosystem) map[Type]string
- func NewBuilder(ctx context.Context) (*builder, error)
- func NewNoOpBuilder() *noOpBuilder
- type Analyser
- type AnalysisRequest
- type BasicAnalysisRequest
- type Builder
- type Collector
- type Deliverer
- type Framework
- type NOP
- func (a NOP) Delivery() (*amqp.Delivery, error)
- func (arb NOP) HasEcosystem() bool
- func (arb NOP) ID() string
- func (arb NOP) MustProcess() bool
- func (a NOP) PackageDigest() string
- func (a NOP) PackageName() string
- func (a NOP) PackageVersion() string
- func (arb NOP) Prio() uint8
- func (a NOP) Publishing() (*amqp.Publishing, error)
- func (a NOP) ResultsPath() ResultUploadPath
- func (arb *NOP) SetForce(force bool)
- func (arb *NOP) SetPrio(p uint8)
- func (a NOP) String() string
- func (arb NOP) Type() Type
- func (a *NOP) UnmarshalJSON(data []byte) error
- func (a NOP) Validate() error
- type NPM
- func (arn NPM) Delivery() (*amqp.Delivery, error)
- func (arb NPM) HasEcosystem() bool
- func (arb NPM) ID() string
- func (arb NPM) MustProcess() bool
- func (arn NPM) PackageDigest() string
- func (arn NPM) PackageName() string
- func (arn NPM) PackageVersion() string
- func (arb NPM) Prio() uint8
- func (arn NPM) Publishing() (*amqp.Publishing, error)
- func (arn NPM) ResultsPath() ResultUploadPath
- func (arb *NPM) SetForce(force bool)
- func (arb *NPM) SetPrio(p uint8)
- func (arn NPM) String() string
- func (arn NPM) Switch(t Type) (AnalysisRequest, error)
- func (arb NPM) Type() Type
- func (arn *NPM) UnmarshalJSON(data []byte) error
- func (arn NPM) Validate() error
- type NPMFillError
- type Publisher
- type PyPi
- func (arp PyPi) Delivery() (*amqp.Delivery, error)
- func (arb PyPi) HasEcosystem() bool
- func (arb PyPi) ID() string
- func (arb PyPi) MustProcess() bool
- func (arp PyPi) PackageDigest() string
- func (arp PyPi) PackageName() string
- func (arp PyPi) PackageVersion() string
- func (arb PyPi) Prio() uint8
- func (arp PyPi) Publishing() (*amqp.Publishing, error)
- func (arp PyPi) ResultsPath() ResultUploadPath
- func (arb *PyPi) SetForce(force bool)
- func (arb *PyPi) SetPrio(p uint8)
- func (arp PyPi) String() string
- func (arb PyPi) Type() Type
- func (arp *PyPi) UnmarshalJSON(data []byte) error
- func (arp PyPi) Validate() error
- type PyPiFillError
- type ResultUploadPath
- type Results
- type Type
- type TypeComponents
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMalfunctioningNPMRegistryClient = errors.New("malfunctioning (no-op or similar) NPM registry client") // NPMFillError instances. ErrGivenVersionNotFoundOnNPM = NPMFillError{errors.New("given npm package version not found on npm")} ErrGivenShasumDoesntMatchGivenVersionOnNPM = NPMFillError{errors.New("given npm version does not exist on npm with the given shasum")} )
View Source
var ( ErrMalfunctioningPyPiRegistryClient = errors.New("malfunctioning (no-op or similar) PyPi registry client") // PyPiFillError instances. ErrGivenVersionNotFoundOnPyPi = PyPiFillError{errors.New("given PyPi package version not found on PyPi")} ErrGivenSha256DoesNotMatchOnPyPi = PyPiFillError{errors.New("given PyPi version does not exist on PyPi with the given sha256 digest")} ErrGivenBlake2b256DoesNotMatchOnPyPi = PyPiFillError{errors.New("given PyPi version does not exist on PyPi with the given blake2b256 digest")} )
Functions ¶
func ComposeAMQPDelivery ¶
func ComposeAMQPDelivery(a AnalysisRequest) (*amqp.Delivery, error)
func ComposeAMQPPublishing ¶
func ComposeAMQPPublishing(a AnalysisRequest) (*amqp.Publishing, error)
func NewBuilder ¶
func NewNoOpBuilder ¶
func NewNoOpBuilder() *noOpBuilder
Types ¶
type AnalysisRequest ¶
type AnalysisRequest interface { BasicAnalysisRequest fmt.Stringer Publisher Deliverer Results Analyser }
type BasicAnalysisRequest ¶
type BasicAnalysisRequest interface { // Type returns the type of the analysis request Type() Type // ID returns the snowflake ID of the analysis request ID() string // Priority returns the priority of the analysis request Prio() uint8 // SetPrio lets the user change the priority of the analysis request SetPrio(uint8) // MustProcess returns whether the analysis request must be forcibly processed or not MustProcess() bool // SetForce lets the user change the force attribute of the analysis request SetForce(bool) // Validate tells whether the analysis request is ok or not Validate() error }
type Builder ¶
type Builder interface {
FromJSON([]byte) (AnalysisRequest, error)
}
type NOP ¶
type NOP struct {
// contains filtered or unexported fields
}
func (NOP) HasEcosystem ¶
func (arb NOP) HasEcosystem() bool
func (NOP) MustProcess ¶
func (arb NOP) MustProcess() bool
func (NOP) PackageDigest ¶
func (NOP) PackageName ¶
func (NOP) PackageVersion ¶
func (NOP) Publishing ¶
func (a NOP) Publishing() (*amqp.Publishing, error)
func (NOP) ResultsPath ¶
func (a NOP) ResultsPath() ResultUploadPath
func (*NOP) UnmarshalJSON ¶
type NPM ¶
type NPM struct {
// contains filtered or unexported fields
}
func (NPM) HasEcosystem ¶
func (arb NPM) HasEcosystem() bool
func (NPM) MustProcess ¶
func (arb NPM) MustProcess() bool
func (NPM) PackageDigest ¶
func (NPM) PackageName ¶
func (NPM) PackageVersion ¶
func (NPM) Publishing ¶
func (arn NPM) Publishing() (*amqp.Publishing, error)
func (NPM) ResultsPath ¶
func (arn NPM) ResultsPath() ResultUploadPath
func (*NPM) UnmarshalJSON ¶
type NPMFillError ¶
type NPMFillError struct {
Err error
}
func (NPMFillError) Error ¶
func (e NPMFillError) Error() string
type Publisher ¶
type Publisher interface {
Publishing() (*amqp.Publishing, error)
}
type PyPi ¶
type PyPi struct {
// contains filtered or unexported fields
}
func (PyPi) HasEcosystem ¶
func (arb PyPi) HasEcosystem() bool
func (PyPi) MustProcess ¶
func (arb PyPi) MustProcess() bool
func (PyPi) PackageDigest ¶
func (PyPi) PackageName ¶
func (PyPi) PackageVersion ¶
func (PyPi) Publishing ¶
func (arp PyPi) Publishing() (*amqp.Publishing, error)
func (PyPi) ResultsPath ¶
func (arp PyPi) ResultsPath() ResultUploadPath
func (*PyPi) UnmarshalJSON ¶
type PyPiFillError ¶
type PyPiFillError struct {
Err error
}
func (PyPiFillError) Error ¶
func (e PyPiFillError) Error() string
type ResultUploadPath ¶
type ResultUploadPath []string
func ComposeResultUploadPath ¶
func ComposeResultUploadPath(a AnalysisRequest) ResultUploadPath
type Results ¶
type Results interface { // ResultsPath returns the upload path of the analysis request result ResultsPath() ResultUploadPath }
type Type ¶
type Type int
const ( Nop Type = iota + 1 NPMInstallWhileDynamicInstrumentation NPMAdvisory NPMInstallWhileDynamicInstrumentationAIEnriched NPMTyposquat NPMMetadataEmptyDescription NPMMetadataVersion NPMMetadataMaintainersEmailCheck NPMMetadataMismatches NPMStaticAnalysisEnvExfiltration Type = iota + 9 // 18 // Do not forget to specify the type Type when using iota to reserve space for previous types NPMStaticAnalysisDetachedProcessExecution NPMStaticAnalysisShadyLinks NPMStaticAnalysisEvalBase64 NPMStaticAnalysisInstallScript NPMStaticNonRegistryDependency PypiTyposquat Type = iota + 990 // 1005 PypiMetadataMaintainersEmailCheck Type = iota + 992 // 1008 PypiStaticAnalysisEnvExfiltration Type = iota + 1001 // 1018 PypiStaticAnalysisDetachedProcessExecution PypiStaticAnalysisShadyLinks PypiStaticAnalysisEvalBase64 PypiStaticAnalysisCodeExecutionAtSetup PypiStaticNonRegistryDependency )
Those are the constants representing the analysis request types.
When adding a new one append it after the existing ones (before the _maxType constant).
func GetTypesFromResultFile ¶
func (Type) Components ¶
func (t Type) Components() TypeComponents
func (Type) HasEcosystem ¶
func (Type) MarshalJSON ¶
func (*Type) UnmarshalJSON ¶
type TypeComponents ¶
type TypeComponents struct { Framework Framework Collector Collector CollectorAction string Ecosystem ecosystem.Ecosystem EcosystemAction string Format string Parent *TypeComponents }
func (TypeComponents) HasCollectorAction ¶
func (c TypeComponents) HasCollectorAction() bool
func (TypeComponents) HasEcosystem ¶
func (c TypeComponents) HasEcosystem() bool
func (TypeComponents) HasEcosystemAction ¶
func (c TypeComponents) HasEcosystemAction() bool
func (TypeComponents) HasFormat ¶
func (c TypeComponents) HasFormat() bool
func (TypeComponents) ResultFile ¶
func (c TypeComponents) ResultFile() string
ResultFile returns the filename of the result file for the current Components.
Note it tries to always use characters safe for S3 keys (see https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html).
func (TypeComponents) ToURN ¶
func (c TypeComponents) ToURN() *urn.URN
Source Files ¶
Click to show internal directories.
Click to hide internal directories.