Documentation ¶
Index ¶
- Constants
- Variables
- func NewArtefactRequestEvent(a Artefact, src string) *gen.TapArtefactRequestEvent
- func NewSpecEventHeader(tp event_api.EventType, source string) *event_api.EventHeader
- func NewSpecHeaderWithContext(tp event_api.EventType, source string, ctx *event_api.EventContext) *event_api.EventHeader
- type Artefact
- type ArtefactLicense
- type ArtefactRepository
- type ArtefactRepositoryAuthentication
- type ArtefactRoutingRule
- type ArtefactSource
- type ArtefactUpStream
- type ArtefactUpstreamAuthentication
- type ArtefactVulnerability
- type ArtefactVulnerabilityId
- type ArtefactVulnerabilityScore
- type DomainEvent
- type DomainEventBuilder
- type MetaAttributes
- type MetaEvent
- type MetaEventWithAttributes
Constants ¶
View Source
const ( EventSchemaVersion = "1.0.0" EventTypeDomainEvent = "event.domain" EventTypeArtefactRequestSubject = "event.artefact.request" EventTypeArtefactResponseSubject = "event.artefact.response" DomainEventTypeCreated = "event.type.created" DomainEventTypeUpdated = "event.type.updated" DomainEventTypeDeleted = "event.type.deleted" )
Variables ¶
View Source
var ( ArtefactSourceTypeMaven2 = config_api.GatewayUpstreamType_Maven.String() ArtefactSourceTypeNpm = config_api.GatewayUpstreamType_Npm.String() ArtefactSourceTypePypi = config_api.GatewayUpstreamType_PyPI.String() ArtefactSourceTypeRubyGems = config_api.GatewayUpstreamType_RubyGems.String() ArtefactLicenseTypeSpdx = "SPDX" ArtefactLicenseTypeCycloneDx = "CycloneDX" ArtefactVulnerabilitySeverityCritical = "CRITICAL" ArtefactVulnerabilitySeverityHigh = "HIGH" ArtefactVulnerabilitySeverityMedium = "MEDIUM" ArtefactVulnerabilitySeverityLow = "LOW" ArtefactVulnerabilitySeverityInfo = "INFO" ArtefactVulnerabilityScoreTypeCVSSv3 = "CVSSv3" )
Functions ¶
func NewArtefactRequestEvent ¶
func NewArtefactRequestEvent(a Artefact, src string) *gen.TapArtefactRequestEvent
func NewSpecEventHeader ¶
func NewSpecEventHeader(tp event_api.EventType, source string) *event_api.EventHeader
func NewSpecHeaderWithContext ¶
func NewSpecHeaderWithContext(tp event_api.EventType, source string, ctx *event_api.EventContext) *event_api.EventHeader
Types ¶
type Artefact ¶
type Artefact struct { Source ArtefactSource `json:"source"` Group string `json:"group"` Name string `json:"name"` Version string `json:"version"` }
func NewArtefact ¶
func NewArtefact(src ArtefactSource, name, group, version string) Artefact
func (Artefact) OpenSsfEcosystem ¶
func (Artefact) OpenSsfPackageName ¶
func (Artefact) OpenSsfPackageVersion ¶
type ArtefactLicense ¶
type ArtefactLicense struct { Type string `json:"type"` // SPDX | CyloneDX Id string `json:"id"` // SPDX or CycloneDX ID Name string `json:"name"` // Human Readable Name }
Align with SPDX / CycloneDX
type ArtefactRepository ¶
type ArtefactRepository struct { Host string `yaml:"host"` Port int16 `yaml:"port"` Tls bool `yaml:"tls"` Sni string `yaml:"sni"` Authentication ArtefactRepositoryAuthentication `yaml:"authentication"` }
type ArtefactRepositoryAuthentication ¶
type ArtefactRepositoryAuthentication struct {
Type string `yaml:"type"`
}
type ArtefactRoutingRule ¶
type ArtefactSource ¶
type ArtefactSource struct {
Type string `json:"type"`
}
type ArtefactUpStream ¶
type ArtefactUpStream struct { Name string `yaml:"name"` Type string `yaml:"type"` RoutingRule ArtefactRoutingRule `yaml:"route"` Repository ArtefactRepository `yaml:"repository"` Authentication ArtefactUpstreamAuthentication `yaml:"authentication"` }
func GetUpstreamByHostAndPath ¶
func GetUpstreamByHostAndPath(host, path string) (ArtefactUpStream, error)
func ToUpstream ¶
func ToUpstream(us *config_api.GatewayUpstream) ArtefactUpStream
Stop gap method to map a spec based upstream into legacy upstream
func (ArtefactUpStream) MatchHost ¶
func (s ArtefactUpStream) MatchHost(host string) bool
func (ArtefactUpStream) MatchPath ¶
func (s ArtefactUpStream) MatchPath(path string) bool
func (ArtefactUpStream) NeedAuthentication ¶
func (s ArtefactUpStream) NeedAuthentication() bool
func (ArtefactUpStream) NeedUpstreamAuthentication ¶
func (s ArtefactUpStream) NeedUpstreamAuthentication() bool
func (ArtefactUpStream) Path2Artefact ¶
func (s ArtefactUpStream) Path2Artefact(path string) (Artefact, error)
Resolve an HTTP request path for this artefact into an Artefact model
type ArtefactUpstreamAuthentication ¶
type ArtefactUpstreamAuthentication struct { Type string `yaml:"type"` Provider string `yaml:"provider"` }
func (ArtefactUpstreamAuthentication) IsBasic ¶
func (s ArtefactUpstreamAuthentication) IsBasic() bool
func (ArtefactUpstreamAuthentication) IsNoAuth ¶
func (s ArtefactUpstreamAuthentication) IsNoAuth() bool
type ArtefactVulnerability ¶
type ArtefactVulnerability struct { Name string `json:"name"` Id ArtefactVulnerabilityId `json:"id"` Severity string `json:"severity"` Scores []ArtefactVulnerabilityScore `json:"scores"` }
type ArtefactVulnerabilityId ¶
Align with CVE but keep room for enhancement
type ArtefactVulnerabilityScore ¶
Align with CVSS v3 but keep room
type DomainEvent ¶
type DomainEvent[T any] struct { MetaEventWithAttributes `json:"meta"` Data T `json:"data"` }
type DomainEventBuilder ¶
type DomainEventBuilder[T any] interface { Created(v T) DomainEvent[T] Updated(v T) DomainEvent[T] Deleted(v T) DomainEvent[T] From(v interface{}) (DomainEvent[T], error) }
type MetaAttributes ¶
type MetaEventWithAttributes ¶
type MetaEventWithAttributes struct { MetaEvent MetaAttributes }
func (MetaEventWithAttributes) Serialize ¶
func (m MetaEventWithAttributes) Serialize() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.