api

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Package api holds the sealift HTTP contract's hand-written handlers, alongside the generated server types in api.gen.go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func HealthHandler

func HealthHandler(w http.ResponseWriter, _ *http.Request)

HealthHandler answers a liveness probe. It carries no dependency, so a probe never blocks on the store, the job queue or a subprocess.

func Routes

func Routes(h *Handlers, static fs.FS) http.Handler

Routes returns every route this backend serves: the health check outside the contract, every operation of api/openapi.yaml mounted at base URL /api through the generated strict server, and the frontend build in static for every other path. WatchJob (the event stream) is one of the contract's operations: Handlers embeds *EventsHandler, so the generated dispatch reaches it exactly like any JSON operation.

func SPA

func SPA(fsys fs.FS) http.Handler

SPA serves the frontend build from fsys, the "dist" directory stripped of its own name. An extensionless path outside assets/ that does not name a file in fsys falls back to index.html, so a client-side route survives a reload. Anything under assets/, or any other path that looks like it names a file, answers 404 instead: silently handing back the HTML shell for a missing script or a stale asset reference would hide the break behind a response that looks like it worked. The fallback reads index.html directly instead of routing the rewritten path back through http.FileServer, which special-cases that name and would 301-redirect the deep link away to "/".

func WriteProblem

func WriteProblem(w http.ResponseWriter, p Problem)

WriteProblem sends p as an application/problem+json response with p's own status code.

Types

type ActivateTrivy200JSONResponse

type ActivateTrivy200JSONResponse ToolsState

func (ActivateTrivy200JSONResponse) VisitActivateTrivyResponse

func (response ActivateTrivy200JSONResponse) VisitActivateTrivyResponse(w http.ResponseWriter) error

type ActivateTrivyJSONBody

type ActivateTrivyJSONBody struct {
	Version string `json:"version"`
}

ActivateTrivyJSONBody defines parameters for ActivateTrivy.

type ActivateTrivyJSONRequestBody

type ActivateTrivyJSONRequestBody ActivateTrivyJSONBody

ActivateTrivyJSONRequestBody defines body for ActivateTrivy for application/json ContentType.

type ActivateTrivyRequestObject

type ActivateTrivyRequestObject struct {
	Body *ActivateTrivyJSONRequestBody
}

type ActivateTrivyResponseObject

type ActivateTrivyResponseObject interface {
	VisitActivateTrivyResponse(w http.ResponseWriter) error
}

type ActivateTrivydefaultApplicationProblemPlusJSONResponse

type ActivateTrivydefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (ActivateTrivydefaultApplicationProblemPlusJSONResponse) VisitActivateTrivyResponse

type Analysis

type Analysis struct {
	CreatedAt time.Time `json:"createdAt"`

	// Failure Which step failed and why
	Failure *Failure `json:"failure,omitempty"`
	Id      string   `json:"id"`

	// PnpmVersion pnpm version the analysis used, absent when it did not record one
	PnpmVersion *string `json:"pnpmVersion,omitempty"`
	ProjectId   string  `json:"projectId"`

	// Result What an analysis writes to candidates.json and ranking.json
	Result *AnalysisResult `json:"result,omitempty"`

	// State State of a job and of the directory it writes
	State State `json:"state"`

	// TrivyDbDate Vulnerability database date the analysis used, absent when it did not record one
	TrivyDbDate *time.Time `json:"trivyDbDate,omitempty"`

	// TrivyVersion Trivy version the analysis used, absent when it did not record one
	TrivyVersion *string `json:"trivyVersion,omitempty"`
}

Analysis One analysis job and its state.

type AnalysisId

type AnalysisId = string

AnalysisId defines model for AnalysisId.

type AnalysisResult

type AnalysisResult struct {
	// After Null when the combined check (step 9) never measured it
	After *Vector `json:"after"`

	// Before CVE counts by severity, critical to unknown
	Before       Vector             `json:"before"`
	Dependencies []DependencyResult `json:"dependencies"`

	// Target The system a resolution or an export is prepared for
	Target   Target   `json:"target"`
	Warnings []string `json:"warnings"`
}

AnalysisResult What an analysis writes to candidates.json and ranking.json

type CancelAnalysis200JSONResponse

type CancelAnalysis200JSONResponse Analysis

func (CancelAnalysis200JSONResponse) VisitCancelAnalysisResponse

func (response CancelAnalysis200JSONResponse) VisitCancelAnalysisResponse(w http.ResponseWriter) error

type CancelAnalysisRequestObject

type CancelAnalysisRequestObject struct {
	ProjectId  ProjectId  `json:"projectId"`
	AnalysisId AnalysisId `json:"analysisId"`
}

type CancelAnalysisResponseObject

type CancelAnalysisResponseObject interface {
	VisitCancelAnalysisResponse(w http.ResponseWriter) error
}

type CancelAnalysisdefaultApplicationProblemPlusJSONResponse

type CancelAnalysisdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (CancelAnalysisdefaultApplicationProblemPlusJSONResponse) VisitCancelAnalysisResponse

func (response CancelAnalysisdefaultApplicationProblemPlusJSONResponse) VisitCancelAnalysisResponse(w http.ResponseWriter) error

type CancelExport200JSONResponse

type CancelExport200JSONResponse Export

func (CancelExport200JSONResponse) VisitCancelExportResponse

func (response CancelExport200JSONResponse) VisitCancelExportResponse(w http.ResponseWriter) error

type CancelExportRequestObject

type CancelExportRequestObject struct {
	ProjectId ProjectId `json:"projectId"`
	ExportId  ExportId  `json:"exportId"`
}

type CancelExportResponseObject

type CancelExportResponseObject interface {
	VisitCancelExportResponse(w http.ResponseWriter) error
}

type CancelExportdefaultApplicationProblemPlusJSONResponse

type CancelExportdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (CancelExportdefaultApplicationProblemPlusJSONResponse) VisitCancelExportResponse

type Candidate

type Candidate struct {
	// Cves The vulnerabilities behind vector, sorted by severity then id
	Cves []Cve `json:"cves"`

	// Key Whether this candidate was resolved and scanned before the rest
	Key bool `json:"key"`

	// Published Empty when the registry has no publication time
	Published *time.Time `json:"published,omitempty"`
	Resolved  bool       `json:"resolved"`
	Signals   []Signal   `json:"signals"`

	// Vector CVE counts by severity, critical to unknown
	Vector  Vector `json:"vector"`
	Version string `json:"version"`
}

Candidate One newer version of a dependency, ranked against the current one

type CandidateData

type CandidateData struct {
	Dependency string   `json:"dependency"`
	Signals    []string `json:"signals"`

	// Vector CVE counts by severity, critical to unknown
	Vector  []int  `json:"vector"`
	Version string `json:"version"`
}

CandidateData Payload of a candidate event

type CreateProject201JSONResponse

type CreateProject201JSONResponse Project

func (CreateProject201JSONResponse) VisitCreateProjectResponse

func (response CreateProject201JSONResponse) VisitCreateProjectResponse(w http.ResponseWriter) error

type CreateProjectMultipartBody

type CreateProjectMultipartBody struct {
	// Manifest package.json content
	Manifest openapi_types.File `json:"manifest"`

	// Name Project name; defaults to the manifest name field
	Name *string `json:"name,omitempty"`
}

CreateProjectMultipartBody defines parameters for CreateProject.

type CreateProjectMultipartRequestBody

type CreateProjectMultipartRequestBody CreateProjectMultipartBody

CreateProjectMultipartRequestBody defines body for CreateProject for multipart/form-data ContentType.

type CreateProjectRequestObject

type CreateProjectRequestObject struct {
	Body *multipart.Reader
}

type CreateProjectResponseObject

type CreateProjectResponseObject interface {
	VisitCreateProjectResponse(w http.ResponseWriter) error
}

type CreateProjectdefaultApplicationProblemPlusJSONResponse

type CreateProjectdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (CreateProjectdefaultApplicationProblemPlusJSONResponse) VisitCreateProjectResponse

type Cve added in v0.2.0

type Cve struct {
	Id string `json:"id"`

	// Severity As Trivy prints it, upper case
	Severity string `json:"severity"`
}

Cve One vulnerability behind a Vector count

type DeleteAnalysis204Response

type DeleteAnalysis204Response struct {
}

func (DeleteAnalysis204Response) VisitDeleteAnalysisResponse

func (response DeleteAnalysis204Response) VisitDeleteAnalysisResponse(w http.ResponseWriter) error

type DeleteAnalysisRequestObject

type DeleteAnalysisRequestObject struct {
	ProjectId  ProjectId  `json:"projectId"`
	AnalysisId AnalysisId `json:"analysisId"`
}

type DeleteAnalysisResponseObject

type DeleteAnalysisResponseObject interface {
	VisitDeleteAnalysisResponse(w http.ResponseWriter) error
}

type DeleteAnalysisdefaultApplicationProblemPlusJSONResponse

type DeleteAnalysisdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (DeleteAnalysisdefaultApplicationProblemPlusJSONResponse) VisitDeleteAnalysisResponse

func (response DeleteAnalysisdefaultApplicationProblemPlusJSONResponse) VisitDeleteAnalysisResponse(w http.ResponseWriter) error

type DeleteExport204Response

type DeleteExport204Response struct {
}

func (DeleteExport204Response) VisitDeleteExportResponse

func (response DeleteExport204Response) VisitDeleteExportResponse(w http.ResponseWriter) error

type DeleteExportRequestObject

type DeleteExportRequestObject struct {
	ProjectId ProjectId `json:"projectId"`
	ExportId  ExportId  `json:"exportId"`
}

type DeleteExportResponseObject

type DeleteExportResponseObject interface {
	VisitDeleteExportResponse(w http.ResponseWriter) error
}

type DeleteExportdefaultApplicationProblemPlusJSONResponse

type DeleteExportdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (DeleteExportdefaultApplicationProblemPlusJSONResponse) VisitDeleteExportResponse

type DeleteProject204Response

type DeleteProject204Response struct {
}

func (DeleteProject204Response) VisitDeleteProjectResponse

func (response DeleteProject204Response) VisitDeleteProjectResponse(w http.ResponseWriter) error

type DeleteProjectRequestObject

type DeleteProjectRequestObject struct {
	ProjectId ProjectId `json:"projectId"`
}

type DeleteProjectResponseObject

type DeleteProjectResponseObject interface {
	VisitDeleteProjectResponse(w http.ResponseWriter) error
}

type DeleteProjectdefaultApplicationProblemPlusJSONResponse

type DeleteProjectdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (DeleteProjectdefaultApplicationProblemPlusJSONResponse) VisitDeleteProjectResponse

type DependencyResult

type DependencyResult struct {
	// Best Empty when no candidate improves on the current version
	Best       *string     `json:"best,omitempty"`
	Candidates []Candidate `json:"candidates"`
	Current    string      `json:"current"`

	// Cves The vulnerabilities behind vector, sorted by severity then id
	Cves []Cve  `json:"cves"`
	Name string `json:"name"`

	// Vector CVE counts by severity, critical to unknown
	Vector Vector `json:"vector"`
}

DependencyResult One direct dependency's current CVEs and its ranked candidates

type DownloadExportFile200ApplicationoctetStreamResponse

type DownloadExportFile200ApplicationoctetStreamResponse struct {
	Body          io.Reader
	ContentLength int64
}

func (DownloadExportFile200ApplicationoctetStreamResponse) VisitDownloadExportFileResponse

func (response DownloadExportFile200ApplicationoctetStreamResponse) VisitDownloadExportFileResponse(w http.ResponseWriter) error

type DownloadExportFileRequestObject

type DownloadExportFileRequestObject struct {
	ProjectId ProjectId `json:"projectId"`
	ExportId  ExportId  `json:"exportId"`
	Name      string    `json:"name"`
}

type DownloadExportFileResponseObject

type DownloadExportFileResponseObject interface {
	VisitDownloadExportFileResponse(w http.ResponseWriter) error
}

type DownloadExportFiledefaultApplicationProblemPlusJSONResponse

type DownloadExportFiledefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (DownloadExportFiledefaultApplicationProblemPlusJSONResponse) VisitDownloadExportFileResponse

func (response DownloadExportFiledefaultApplicationProblemPlusJSONResponse) VisitDownloadExportFileResponse(w http.ResponseWriter) error

type EndData

type EndData struct {
	// State State of a job and of the directory it writes
	State State `json:"state"`
}

EndData Payload of the end event, always the last one of a job

type Event

type Event struct {
	// Data Payload matching the kind; see StepData, ProgressData, CandidateData, LogData, EndData
	Data Event_Data `json:"data"`

	// Job Job ID the event belongs to
	Job string `json:"job"`

	// Kind Discriminator for the data payload of an Event.
	Kind EventKind `json:"kind"`

	// StoreId Store id (the directory id) of the job the event belongs to, set once the queue has started it. Empty for an event about a job cancelled before it started.
	StoreId *string `json:"storeId,omitempty"`
}

Event One server-sent event of the running job

type EventKind

type EventKind string

EventKind Discriminator for the data payload of an Event.

const (
	EventKindCandidate EventKind = "candidate"
	EventKindEnd       EventKind = "end"
	EventKindLog       EventKind = "log"
	EventKindProgress  EventKind = "progress"
	EventKindStep      EventKind = "step"
)

Defines values for EventKind.

func (EventKind) Valid

func (e EventKind) Valid() bool

Valid indicates whether the value is a known member of the EventKind enum.

type Event_Data

type Event_Data struct {
	// contains filtered or unexported fields
}

Event_Data Payload matching the kind; see StepData, ProgressData, CandidateData, LogData, EndData

func (Event_Data) AsCandidateData

func (t Event_Data) AsCandidateData() (CandidateData, error)

AsCandidateData returns the union data inside the Event_Data as a CandidateData

func (Event_Data) AsEndData

func (t Event_Data) AsEndData() (EndData, error)

AsEndData returns the union data inside the Event_Data as a EndData

func (Event_Data) AsLogData

func (t Event_Data) AsLogData() (LogData, error)

AsLogData returns the union data inside the Event_Data as a LogData

func (Event_Data) AsProgressData

func (t Event_Data) AsProgressData() (ProgressData, error)

AsProgressData returns the union data inside the Event_Data as a ProgressData

func (Event_Data) AsStepData

func (t Event_Data) AsStepData() (StepData, error)

AsStepData returns the union data inside the Event_Data as a StepData

func (*Event_Data) FromCandidateData

func (t *Event_Data) FromCandidateData(v CandidateData) error

FromCandidateData overwrites any union data inside the Event_Data as the provided CandidateData

func (*Event_Data) FromEndData

func (t *Event_Data) FromEndData(v EndData) error

FromEndData overwrites any union data inside the Event_Data as the provided EndData

func (*Event_Data) FromLogData

func (t *Event_Data) FromLogData(v LogData) error

FromLogData overwrites any union data inside the Event_Data as the provided LogData

func (*Event_Data) FromProgressData

func (t *Event_Data) FromProgressData(v ProgressData) error

FromProgressData overwrites any union data inside the Event_Data as the provided ProgressData

func (*Event_Data) FromStepData

func (t *Event_Data) FromStepData(v StepData) error

FromStepData overwrites any union data inside the Event_Data as the provided StepData

func (Event_Data) MarshalJSON

func (t Event_Data) MarshalJSON() ([]byte, error)

func (*Event_Data) MergeCandidateData

func (t *Event_Data) MergeCandidateData(v CandidateData) error

MergeCandidateData performs a merge with any union data inside the Event_Data, using the provided CandidateData

func (*Event_Data) MergeEndData

func (t *Event_Data) MergeEndData(v EndData) error

MergeEndData performs a merge with any union data inside the Event_Data, using the provided EndData

func (*Event_Data) MergeLogData

func (t *Event_Data) MergeLogData(v LogData) error

MergeLogData performs a merge with any union data inside the Event_Data, using the provided LogData

func (*Event_Data) MergeProgressData

func (t *Event_Data) MergeProgressData(v ProgressData) error

MergeProgressData performs a merge with any union data inside the Event_Data, using the provided ProgressData

func (*Event_Data) MergeStepData

func (t *Event_Data) MergeStepData(v StepData) error

MergeStepData performs a merge with any union data inside the Event_Data, using the provided StepData

func (*Event_Data) UnmarshalJSON

func (t *Event_Data) UnmarshalJSON(b []byte) error

type EventsHandler

type EventsHandler struct {
	Jobs Subscriptions
}

EventsHandler serves the running job's event stream.

func (*EventsHandler) WatchJob

WatchJob implements the WatchJob operation of StrictServerInterface. It returns the strict response object as an open pipe: VisitWatchJobResponse reads from it and flushes after every read, so an unflushed write never sits buffered behind later ones, and the first event reaches the client without waiting for the job to end.

type Export

type Export struct {
	AnalysisId string    `json:"analysisId"`
	CreatedAt  time.Time `json:"createdAt"`

	// Failure Which step failed and why
	Failure *Failure `json:"failure,omitempty"`

	// Files File names available under files/{name} once the export is done
	Files     *[]string `json:"files,omitempty"`
	Id        string    `json:"id"`
	ProjectId string    `json:"projectId"`

	// State State of a job and of the directory it writes
	State State `json:"state"`
}

Export One export job, its state and its files.

type ExportId

type ExportId = string

ExportId defines model for ExportId.

type ExportRequest

type ExportRequest struct {
	// IncludeProject Add the current project tree to the export
	IncludeProject *bool `json:"includeProject,omitempty"`

	// Selection Dependency name to the list of its versions to include. An empty or absent list selects nothing for that dependency.
	Selection map[string][]string `json:"selection"`
}

ExportRequest A selection of versions per dependency, plus the project tree flag

type Failure added in v0.2.0

type Failure struct {
	Message string `json:"message"`
	Step    string `json:"step"`
}

Failure Which step failed and why

type GetAnalysis200JSONResponse

type GetAnalysis200JSONResponse Analysis

func (GetAnalysis200JSONResponse) VisitGetAnalysisResponse

func (response GetAnalysis200JSONResponse) VisitGetAnalysisResponse(w http.ResponseWriter) error

type GetAnalysisLog200TextResponse added in v0.2.0

type GetAnalysisLog200TextResponse string

func (GetAnalysisLog200TextResponse) VisitGetAnalysisLogResponse added in v0.2.0

func (response GetAnalysisLog200TextResponse) VisitGetAnalysisLogResponse(w http.ResponseWriter) error

type GetAnalysisLogRequestObject added in v0.2.0

type GetAnalysisLogRequestObject struct {
	ProjectId  ProjectId  `json:"projectId"`
	AnalysisId AnalysisId `json:"analysisId"`
}

type GetAnalysisLogResponseObject added in v0.2.0

type GetAnalysisLogResponseObject interface {
	VisitGetAnalysisLogResponse(w http.ResponseWriter) error
}

type GetAnalysisLogdefaultApplicationProblemPlusJSONResponse added in v0.2.0

type GetAnalysisLogdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetAnalysisLogdefaultApplicationProblemPlusJSONResponse) VisitGetAnalysisLogResponse added in v0.2.0

func (response GetAnalysisLogdefaultApplicationProblemPlusJSONResponse) VisitGetAnalysisLogResponse(w http.ResponseWriter) error

type GetAnalysisRequestObject

type GetAnalysisRequestObject struct {
	ProjectId  ProjectId  `json:"projectId"`
	AnalysisId AnalysisId `json:"analysisId"`
}

type GetAnalysisResponseObject

type GetAnalysisResponseObject interface {
	VisitGetAnalysisResponse(w http.ResponseWriter) error
}

type GetAnalysisdefaultApplicationProblemPlusJSONResponse

type GetAnalysisdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetAnalysisdefaultApplicationProblemPlusJSONResponse) VisitGetAnalysisResponse

type GetExport200JSONResponse

type GetExport200JSONResponse Export

func (GetExport200JSONResponse) VisitGetExportResponse

func (response GetExport200JSONResponse) VisitGetExportResponse(w http.ResponseWriter) error

type GetExportRequestObject

type GetExportRequestObject struct {
	ProjectId ProjectId `json:"projectId"`
	ExportId  ExportId  `json:"exportId"`
}

type GetExportResponseObject

type GetExportResponseObject interface {
	VisitGetExportResponse(w http.ResponseWriter) error
}

type GetExportdefaultApplicationProblemPlusJSONResponse

type GetExportdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetExportdefaultApplicationProblemPlusJSONResponse) VisitGetExportResponse

type GetProject200JSONResponse

type GetProject200JSONResponse Project

func (GetProject200JSONResponse) VisitGetProjectResponse

func (response GetProject200JSONResponse) VisitGetProjectResponse(w http.ResponseWriter) error

type GetProjectManifest200JSONResponse added in v0.2.1

type GetProjectManifest200JSONResponse map[string]interface{}

func (GetProjectManifest200JSONResponse) VisitGetProjectManifestResponse added in v0.2.1

func (response GetProjectManifest200JSONResponse) VisitGetProjectManifestResponse(w http.ResponseWriter) error

type GetProjectManifestRequestObject added in v0.2.1

type GetProjectManifestRequestObject struct {
	ProjectId ProjectId `json:"projectId"`
}

type GetProjectManifestResponseObject added in v0.2.1

type GetProjectManifestResponseObject interface {
	VisitGetProjectManifestResponse(w http.ResponseWriter) error
}

type GetProjectManifestdefaultApplicationProblemPlusJSONResponse added in v0.2.1

type GetProjectManifestdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetProjectManifestdefaultApplicationProblemPlusJSONResponse) VisitGetProjectManifestResponse added in v0.2.1

func (response GetProjectManifestdefaultApplicationProblemPlusJSONResponse) VisitGetProjectManifestResponse(w http.ResponseWriter) error

type GetProjectRequestObject

type GetProjectRequestObject struct {
	ProjectId ProjectId `json:"projectId"`
}

type GetProjectResponseObject

type GetProjectResponseObject interface {
	VisitGetProjectResponse(w http.ResponseWriter) error
}

type GetProjectdefaultApplicationProblemPlusJSONResponse

type GetProjectdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetProjectdefaultApplicationProblemPlusJSONResponse) VisitGetProjectResponse

type GetSettings200JSONResponse

type GetSettings200JSONResponse Settings

func (GetSettings200JSONResponse) VisitGetSettingsResponse

func (response GetSettings200JSONResponse) VisitGetSettingsResponse(w http.ResponseWriter) error

type GetSettingsRequestObject

type GetSettingsRequestObject struct {
}

type GetSettingsResponseObject

type GetSettingsResponseObject interface {
	VisitGetSettingsResponse(w http.ResponseWriter) error
}

type GetSettingsdefaultApplicationProblemPlusJSONResponse

type GetSettingsdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetSettingsdefaultApplicationProblemPlusJSONResponse) VisitGetSettingsResponse

type GetTools200JSONResponse

type GetTools200JSONResponse ToolsState

func (GetTools200JSONResponse) VisitGetToolsResponse

func (response GetTools200JSONResponse) VisitGetToolsResponse(w http.ResponseWriter) error

type GetToolsRequestObject

type GetToolsRequestObject struct {
}

type GetToolsResponseObject

type GetToolsResponseObject interface {
	VisitGetToolsResponse(w http.ResponseWriter) error
}

type GetToolsdefaultApplicationProblemPlusJSONResponse

type GetToolsdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetToolsdefaultApplicationProblemPlusJSONResponse) VisitGetToolsResponse

type Handlers

type Handlers struct {
	*EventsHandler
	Store   *store.Store
	Service *jobs.Service
	Tools   *tools.Manager
	Trivy   runner.Trivy
}

Handlers implements StrictServerInterface. It holds no state of its own: every operation reads or writes through Store, Service or Tools.

func NewHandlers

func NewHandlers(st *store.Store, svc *jobs.Service, tm *tools.Manager, trivy runner.Trivy) *Handlers

NewHandlers builds the Handlers every operation of the contract runs against.

func (*Handlers) ActivateTrivy

ActivateTrivy switches the active Trivy version to an installed one.

func (*Handlers) CancelAnalysis

CancelAnalysis cancels a running or queued analysis. Once Service is no longer tracking the id, either the job already ended or it never existed; the store, not Service, has the last word at that point.

func (*Handlers) CancelExport

CancelExport cancels a running or queued export. Once Service is no longer tracking the id, either the job already ended or it never existed; the store, not Service, has the last word at that point.

func (*Handlers) CreateProject

CreateProject reads the uploaded package.json from the multipart body, validates it, creates the project directory and queues its first analysis. An invalid manifest gets a 400 listing every offending entry instead of stopping at the first one.

func (*Handlers) DeleteAnalysis

DeleteAnalysis removes a committed analysis.

func (*Handlers) DeleteExport

DeleteExport removes a committed export.

func (*Handlers) DeleteProject

DeleteProject removes a project directory and everything under it.

func (*Handlers) DownloadExportFile

DownloadExportFile streams one file of a finished export.

func (*Handlers) GetAnalysis

GetAnalysis returns an analysis' status and results. A queued or running analysis has no committed directory yet, so this checks Service's live tracking before falling back to the store.

func (*Handlers) GetAnalysisLog added in v0.2.0

GetAnalysisLog returns an analysis' full log.txt: the cause of a failure the step timings alone do not carry.

func (*Handlers) GetExport

GetExport returns an export's status and files. A queued or running export has no committed directory yet, so this checks Service's live tracking before falling back to the store.

func (*Handlers) GetProject

GetProject returns a project, its target and its full analysis and export history. A live job in progress is prepended to the relevant history array: it has no committed directory yet, so it is otherwise invisible until it ends.

func (*Handlers) GetProjectManifest added in v0.2.1

GetProjectManifest returns the package.json a project was created from, byte for byte, so a session can show what was uploaded even when its analysis never produced a result.

func (*Handlers) GetSettings

GetSettings returns settings, with signatureKey masked.

func (*Handlers) GetTools

GetTools returns installed and available tool versions and the vulnerability database's date.

func (*Handlers) ListProjects

ListProjects lists every project with its last analysis and export, or, with manifestSha256 set, only the projects created from that exact manifest, newest first. A live job in progress takes precedence over the store's own last entry, which cannot see it yet. A store error reading one project's history is logged and skipped rather than failing the whole listing: a transient I/O error on one project must not look identical to "never analyzed".

func (*Handlers) QueueAnalysis

QueueAnalysis queues an analysis for the project.

func (*Handlers) QueueExport

QueueExport queues an export of one analysis with a version selection.

func (*Handlers) SetProjectTarget

SetProjectTarget changes a project's target platform and toolchain.

func (*Handlers) UpdateSettings

UpdateSettings updates settings. A signatureKey equal to the mask GetSettings returns is read as "keep the current value", so a client that only changed another field never has to know the real key to send a valid update.

func (*Handlers) UpdateTrivy

UpdateTrivy installs a new Trivy release, refusing one younger than the minimum release age unless the request forces it.

func (*Handlers) UpdateTrivyDB

UpdateTrivyDB forces a vulnerability database download.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type ListProjects200JSONResponse

type ListProjects200JSONResponse []ProjectSummary

func (ListProjects200JSONResponse) VisitListProjectsResponse

func (response ListProjects200JSONResponse) VisitListProjectsResponse(w http.ResponseWriter) error

type ListProjectsParams added in v0.2.0

type ListProjectsParams struct {
	// ManifestSha256 Filter to the projects created from this exact manifest hash (sha256 of the uploaded bytes, lowercase hex), newest first
	ManifestSha256 *string `form:"manifestSha256,omitempty" json:"manifestSha256,omitempty"`
}

ListProjectsParams defines parameters for ListProjects.

type ListProjectsRequestObject

type ListProjectsRequestObject struct {
	Params ListProjectsParams
}

type ListProjectsResponseObject

type ListProjectsResponseObject interface {
	VisitListProjectsResponse(w http.ResponseWriter) error
}

type ListProjectsdefaultApplicationProblemPlusJSONResponse

type ListProjectsdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (ListProjectsdefaultApplicationProblemPlusJSONResponse) VisitListProjectsResponse

type LogData

type LogData struct {
	Line string `json:"line"`
}

LogData Payload of a log event

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type Problem

type Problem struct {
	// Detail A human-readable explanation specific to this occurrence
	Detail *string `json:"detail,omitempty"`

	// Errors Every offending entry, for a validation failure
	Errors *[]ProblemDetail `json:"errors,omitempty"`

	// Instance A URI identifying this specific occurrence
	Instance *string `json:"instance,omitempty"`

	// Missing Names of what a tools-missing problem needs and does not have yet
	Missing *[]string `json:"missing,omitempty"`

	// Status The HTTP status code repeated for clients that read the body only
	Status int `json:"status"`

	// Title A short, human-readable summary of the problem type
	Title string `json:"title"`

	// Type A URI identifying the problem type
	Type *string `json:"type,omitempty"`
}

Problem RFC 9457 Problem Details for HTTP APIs

func NewProblem

func NewProblem(status int, title, detail string) Problem

NewProblem builds an RFC 9457 Problem Details body for status, with detail explaining this occurrence. Type is left as "about:blank" since the contract defines no per-error type URIs yet.

type ProblemApplicationProblemPlusJSONResponse

type ProblemApplicationProblemPlusJSONResponse Problem

type ProblemDetail

type ProblemDetail struct {
	// Field package.json field, such as dependencies or pnpm.overrides
	Field string `json:"field"`

	// Name Dependency name, empty for a field-level problem
	Name   *string `json:"name,omitempty"`
	Reason string  `json:"reason"`
	Value  *string `json:"value,omitempty"`
}

ProblemDetail One offending entry inside a validation failure's errors list

type ProgressData

type ProgressData struct {
	// CacheHits Tarballs served from the tarball cache instead of downloaded, a running count. Only an export sends this; an analysis never does.
	CacheHits            *int `json:"cacheHits,omitempty"`
	Done                 int  `json:"done"`
	EstimatedRemainingMs *int `json:"estimatedRemainingMs,omitempty"`

	// Step Name of the step this progress belongs to, matching a StepData "name" from the same run. A client keys progress by this field, not by how many step events it has seen so far: a subscriber that only replays the tail of a long run's history can still place this progress under the right step.
	Step  string `json:"step"`
	Total int    `json:"total"`
}

ProgressData Payload of a progress event

type Project

type Project struct {
	Analyses *[]Analysis `json:"analyses,omitempty"`
	Exports  *[]Export   `json:"exports,omitempty"`
	Id       string      `json:"id"`

	// ManifestSha256 sha256 of the uploaded package.json bytes, lowercase hex
	ManifestSha256 *string `json:"manifestSha256,omitempty"`
	Name           string  `json:"name"`

	// Target The system a resolution or an export is prepared for
	Target Target `json:"target"`
}

Project A project, its target and its analysis and export history.

type ProjectId

type ProjectId = string

ProjectId defines model for ProjectId.

type ProjectSummary

type ProjectSummary struct {
	Id string `json:"id"`

	// LastAnalysis One analysis job and its state.
	LastAnalysis *Analysis `json:"lastAnalysis,omitempty"`

	// LastExport One export job, its state and its files.
	LastExport *Export `json:"lastExport,omitempty"`
	Name       string  `json:"name"`

	// Target The system a resolution or an export is prepared for
	Target Target `json:"target"`
}

ProjectSummary One row of the projects list.

type QueueAnalysis202JSONResponse

type QueueAnalysis202JSONResponse Analysis

func (QueueAnalysis202JSONResponse) VisitQueueAnalysisResponse

func (response QueueAnalysis202JSONResponse) VisitQueueAnalysisResponse(w http.ResponseWriter) error

type QueueAnalysisRequestObject

type QueueAnalysisRequestObject struct {
	ProjectId ProjectId `json:"projectId"`
}

type QueueAnalysisResponseObject

type QueueAnalysisResponseObject interface {
	VisitQueueAnalysisResponse(w http.ResponseWriter) error
}

type QueueAnalysisdefaultApplicationProblemPlusJSONResponse

type QueueAnalysisdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (QueueAnalysisdefaultApplicationProblemPlusJSONResponse) VisitQueueAnalysisResponse

type QueueExport202JSONResponse

type QueueExport202JSONResponse Export

func (QueueExport202JSONResponse) VisitQueueExportResponse

func (response QueueExport202JSONResponse) VisitQueueExportResponse(w http.ResponseWriter) error

type QueueExportJSONRequestBody

type QueueExportJSONRequestBody = ExportRequest

QueueExportJSONRequestBody defines body for QueueExport for application/json ContentType.

type QueueExportRequestObject

type QueueExportRequestObject struct {
	ProjectId  ProjectId  `json:"projectId"`
	AnalysisId AnalysisId `json:"analysisId"`
	Body       *QueueExportJSONRequestBody
}

type QueueExportResponseObject

type QueueExportResponseObject interface {
	VisitQueueExportResponse(w http.ResponseWriter) error
}

type QueueExportdefaultApplicationProblemPlusJSONResponse

type QueueExportdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (QueueExportdefaultApplicationProblemPlusJSONResponse) VisitQueueExportResponse

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServeMux

type ServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	http.Handler
}

ServeMux is an abstraction of http.ServeMux.

type ServerInterface

type ServerInterface interface {
	// WatchJob Server-sent events of the running job
	// (GET /jobs/current/events)
	WatchJob(w http.ResponseWriter, r *http.Request)
	// ListProjects List projects with their last analysis and export
	// (GET /projects)
	ListProjects(w http.ResponseWriter, r *http.Request, params ListProjectsParams)
	// CreateProject Create a project from an uploaded package.json and start an analysis
	// (POST /projects)
	CreateProject(w http.ResponseWriter, r *http.Request)
	// DeleteProject Delete the project directory
	// (DELETE /projects/{projectId})
	DeleteProject(w http.ResponseWriter, r *http.Request, projectId ProjectId)
	// GetProject Get a project, its target and its history
	// (GET /projects/{projectId})
	GetProject(w http.ResponseWriter, r *http.Request, projectId ProjectId)
	// QueueAnalysis Queue an analysis for the project
	// (POST /projects/{projectId}/analyses)
	QueueAnalysis(w http.ResponseWriter, r *http.Request, projectId ProjectId)
	// DeleteAnalysis Delete an analysis
	// (DELETE /projects/{projectId}/analyses/{analysisId})
	DeleteAnalysis(w http.ResponseWriter, r *http.Request, projectId ProjectId, analysisId AnalysisId)
	// GetAnalysis Get an analysis' status and results
	// (GET /projects/{projectId}/analyses/{analysisId})
	GetAnalysis(w http.ResponseWriter, r *http.Request, projectId ProjectId, analysisId AnalysisId)
	// CancelAnalysis Cancel a running or queued analysis
	// (POST /projects/{projectId}/analyses/{analysisId}/cancel)
	CancelAnalysis(w http.ResponseWriter, r *http.Request, projectId ProjectId, analysisId AnalysisId)
	// QueueExport Queue an export with a version selection
	// (POST /projects/{projectId}/analyses/{analysisId}/exports)
	QueueExport(w http.ResponseWriter, r *http.Request, projectId ProjectId, analysisId AnalysisId)
	// GetAnalysisLog Get an analysis' full log
	// (GET /projects/{projectId}/analyses/{analysisId}/log)
	GetAnalysisLog(w http.ResponseWriter, r *http.Request, projectId ProjectId, analysisId AnalysisId)
	// DeleteExport Delete an export
	// (DELETE /projects/{projectId}/exports/{exportId})
	DeleteExport(w http.ResponseWriter, r *http.Request, projectId ProjectId, exportId ExportId)
	// GetExport Get an export's status and files
	// (GET /projects/{projectId}/exports/{exportId})
	GetExport(w http.ResponseWriter, r *http.Request, projectId ProjectId, exportId ExportId)
	// CancelExport Cancel a running or queued export
	// (POST /projects/{projectId}/exports/{exportId}/cancel)
	CancelExport(w http.ResponseWriter, r *http.Request, projectId ProjectId, exportId ExportId)
	// DownloadExportFile Download one file of a finished export
	// (GET /projects/{projectId}/exports/{exportId}/files/{name})
	DownloadExportFile(w http.ResponseWriter, r *http.Request, projectId ProjectId, exportId ExportId, name string)
	// GetProjectManifest Get the package.json a project was created from, byte for byte
	// (GET /projects/{projectId}/manifest)
	GetProjectManifest(w http.ResponseWriter, r *http.Request, projectId ProjectId)
	// SetProjectTarget Change the project's target platform and toolchain
	// (PUT /projects/{projectId}/target)
	SetProjectTarget(w http.ResponseWriter, r *http.Request, projectId ProjectId)
	// GetSettings Get settings, with signatureKey masked
	// (GET /settings)
	GetSettings(w http.ResponseWriter, r *http.Request)
	// UpdateSettings Update settings
	// (PUT /settings)
	UpdateSettings(w http.ResponseWriter, r *http.Request)
	// GetTools Installed and available tool versions, DB date
	// (GET /tools)
	GetTools(w http.ResponseWriter, r *http.Request)
	// ActivateTrivy Activate an installed Trivy version
	// (POST /tools/trivy/activate)
	ActivateTrivy(w http.ResponseWriter, r *http.Request)
	// UpdateTrivyDB Force a Trivy DB download
	// (POST /tools/trivy/db/update)
	UpdateTrivyDB(w http.ResponseWriter, r *http.Request)
	// UpdateTrivy Install a new Trivy release
	// (POST /tools/trivy/update)
	UpdateTrivy(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) ActivateTrivy

func (siw *ServerInterfaceWrapper) ActivateTrivy(w http.ResponseWriter, r *http.Request)

ActivateTrivy operation middleware

func (*ServerInterfaceWrapper) CancelAnalysis

func (siw *ServerInterfaceWrapper) CancelAnalysis(w http.ResponseWriter, r *http.Request)

CancelAnalysis operation middleware

func (*ServerInterfaceWrapper) CancelExport

func (siw *ServerInterfaceWrapper) CancelExport(w http.ResponseWriter, r *http.Request)

CancelExport operation middleware

func (*ServerInterfaceWrapper) CreateProject

func (siw *ServerInterfaceWrapper) CreateProject(w http.ResponseWriter, r *http.Request)

CreateProject operation middleware

func (*ServerInterfaceWrapper) DeleteAnalysis

func (siw *ServerInterfaceWrapper) DeleteAnalysis(w http.ResponseWriter, r *http.Request)

DeleteAnalysis operation middleware

func (*ServerInterfaceWrapper) DeleteExport

func (siw *ServerInterfaceWrapper) DeleteExport(w http.ResponseWriter, r *http.Request)

DeleteExport operation middleware

func (*ServerInterfaceWrapper) DeleteProject

func (siw *ServerInterfaceWrapper) DeleteProject(w http.ResponseWriter, r *http.Request)

DeleteProject operation middleware

func (*ServerInterfaceWrapper) DownloadExportFile

func (siw *ServerInterfaceWrapper) DownloadExportFile(w http.ResponseWriter, r *http.Request)

DownloadExportFile operation middleware

func (*ServerInterfaceWrapper) GetAnalysis

func (siw *ServerInterfaceWrapper) GetAnalysis(w http.ResponseWriter, r *http.Request)

GetAnalysis operation middleware

func (*ServerInterfaceWrapper) GetAnalysisLog added in v0.2.0

func (siw *ServerInterfaceWrapper) GetAnalysisLog(w http.ResponseWriter, r *http.Request)

GetAnalysisLog operation middleware

func (*ServerInterfaceWrapper) GetExport

func (siw *ServerInterfaceWrapper) GetExport(w http.ResponseWriter, r *http.Request)

GetExport operation middleware

func (*ServerInterfaceWrapper) GetProject

func (siw *ServerInterfaceWrapper) GetProject(w http.ResponseWriter, r *http.Request)

GetProject operation middleware

func (*ServerInterfaceWrapper) GetProjectManifest added in v0.2.1

func (siw *ServerInterfaceWrapper) GetProjectManifest(w http.ResponseWriter, r *http.Request)

GetProjectManifest operation middleware

func (*ServerInterfaceWrapper) GetSettings

func (siw *ServerInterfaceWrapper) GetSettings(w http.ResponseWriter, r *http.Request)

GetSettings operation middleware

func (*ServerInterfaceWrapper) GetTools

func (siw *ServerInterfaceWrapper) GetTools(w http.ResponseWriter, r *http.Request)

GetTools operation middleware

func (*ServerInterfaceWrapper) ListProjects

func (siw *ServerInterfaceWrapper) ListProjects(w http.ResponseWriter, r *http.Request)

ListProjects operation middleware

func (*ServerInterfaceWrapper) QueueAnalysis

func (siw *ServerInterfaceWrapper) QueueAnalysis(w http.ResponseWriter, r *http.Request)

QueueAnalysis operation middleware

func (*ServerInterfaceWrapper) QueueExport

func (siw *ServerInterfaceWrapper) QueueExport(w http.ResponseWriter, r *http.Request)

QueueExport operation middleware

func (*ServerInterfaceWrapper) SetProjectTarget

func (siw *ServerInterfaceWrapper) SetProjectTarget(w http.ResponseWriter, r *http.Request)

SetProjectTarget operation middleware

func (*ServerInterfaceWrapper) UpdateSettings

func (siw *ServerInterfaceWrapper) UpdateSettings(w http.ResponseWriter, r *http.Request)

UpdateSettings operation middleware

func (*ServerInterfaceWrapper) UpdateTrivy

func (siw *ServerInterfaceWrapper) UpdateTrivy(w http.ResponseWriter, r *http.Request)

UpdateTrivy operation middleware

func (*ServerInterfaceWrapper) UpdateTrivyDB

func (siw *ServerInterfaceWrapper) UpdateTrivyDB(w http.ResponseWriter, r *http.Request)

UpdateTrivyDB operation middleware

func (*ServerInterfaceWrapper) WatchJob

func (siw *ServerInterfaceWrapper) WatchJob(w http.ResponseWriter, r *http.Request)

WatchJob operation middleware

type SetProjectTarget200JSONResponse

type SetProjectTarget200JSONResponse Project

func (SetProjectTarget200JSONResponse) VisitSetProjectTargetResponse

func (response SetProjectTarget200JSONResponse) VisitSetProjectTargetResponse(w http.ResponseWriter) error

type SetProjectTargetJSONRequestBody

type SetProjectTargetJSONRequestBody = Target

SetProjectTargetJSONRequestBody defines body for SetProjectTarget for application/json ContentType.

type SetProjectTargetRequestObject

type SetProjectTargetRequestObject struct {
	ProjectId ProjectId `json:"projectId"`
	Body      *SetProjectTargetJSONRequestBody
}

type SetProjectTargetResponseObject

type SetProjectTargetResponseObject interface {
	VisitSetProjectTargetResponse(w http.ResponseWriter) error
}

type SetProjectTargetdefaultApplicationProblemPlusJSONResponse

type SetProjectTargetdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (SetProjectTargetdefaultApplicationProblemPlusJSONResponse) VisitSetProjectTargetResponse

func (response SetProjectTargetdefaultApplicationProblemPlusJSONResponse) VisitSetProjectTargetResponse(w http.ResponseWriter) error

type Settings

type Settings struct {
	DownloadParallelism int `json:"downloadParallelism"`
	MinReleaseAgeDays   int `json:"minReleaseAgeDays"`
	ResolveParallelism  int `json:"resolveParallelism"`

	// SignatureKey Masked on read, never logged
	SignatureKey string `json:"signatureKey"`

	// Target The system a resolution or an export is prepared for
	Target Target `json:"target"`
}

Settings Every value the interface can change.

type Signal

type Signal struct {
	Blocking bool   `json:"blocking"`
	Evidence string `json:"evidence"`
	Name     string `json:"name"`
}

Signal One reason a candidate is blocked or worth a second look

type State

type State string

State State of a job and of the directory it writes

const (
	Cancelled   State = "cancelled"
	Done        State = "done"
	Failed      State = "failed"
	Interrupted State = "interrupted"
	Queued      State = "queued"
	Running     State = "running"
)

Defines values for State.

func (State) Valid

func (e State) Valid() bool

Valid indicates whether the value is a known member of the State enum.

type StdHTTPServerOptions

type StdHTTPServerOptions struct {
	BaseURL          string
	BaseRouter       ServeMux
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StepData

type StepData struct {
	DurationMs *int `json:"durationMs,omitempty"`

	// Error err.Error() when state is failed, absent otherwise
	Error *string `json:"error,omitempty"`
	Name  string  `json:"name"`

	// State State of a job and of the directory it writes
	State State `json:"state"`
}

StepData Payload of a step event

type StrictHTTPServerOptions

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHandlerFunc

type StrictHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, request any) (any, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// WatchJob Server-sent events of the running job
	// (GET /jobs/current/events)
	WatchJob(ctx context.Context, request WatchJobRequestObject) (WatchJobResponseObject, error)
	// ListProjects List projects with their last analysis and export
	// (GET /projects)
	ListProjects(ctx context.Context, request ListProjectsRequestObject) (ListProjectsResponseObject, error)
	// CreateProject Create a project from an uploaded package.json and start an analysis
	// (POST /projects)
	CreateProject(ctx context.Context, request CreateProjectRequestObject) (CreateProjectResponseObject, error)
	// DeleteProject Delete the project directory
	// (DELETE /projects/{projectId})
	DeleteProject(ctx context.Context, request DeleteProjectRequestObject) (DeleteProjectResponseObject, error)
	// GetProject Get a project, its target and its history
	// (GET /projects/{projectId})
	GetProject(ctx context.Context, request GetProjectRequestObject) (GetProjectResponseObject, error)
	// QueueAnalysis Queue an analysis for the project
	// (POST /projects/{projectId}/analyses)
	QueueAnalysis(ctx context.Context, request QueueAnalysisRequestObject) (QueueAnalysisResponseObject, error)
	// DeleteAnalysis Delete an analysis
	// (DELETE /projects/{projectId}/analyses/{analysisId})
	DeleteAnalysis(ctx context.Context, request DeleteAnalysisRequestObject) (DeleteAnalysisResponseObject, error)
	// GetAnalysis Get an analysis' status and results
	// (GET /projects/{projectId}/analyses/{analysisId})
	GetAnalysis(ctx context.Context, request GetAnalysisRequestObject) (GetAnalysisResponseObject, error)
	// CancelAnalysis Cancel a running or queued analysis
	// (POST /projects/{projectId}/analyses/{analysisId}/cancel)
	CancelAnalysis(ctx context.Context, request CancelAnalysisRequestObject) (CancelAnalysisResponseObject, error)
	// QueueExport Queue an export with a version selection
	// (POST /projects/{projectId}/analyses/{analysisId}/exports)
	QueueExport(ctx context.Context, request QueueExportRequestObject) (QueueExportResponseObject, error)
	// GetAnalysisLog Get an analysis' full log
	// (GET /projects/{projectId}/analyses/{analysisId}/log)
	GetAnalysisLog(ctx context.Context, request GetAnalysisLogRequestObject) (GetAnalysisLogResponseObject, error)
	// DeleteExport Delete an export
	// (DELETE /projects/{projectId}/exports/{exportId})
	DeleteExport(ctx context.Context, request DeleteExportRequestObject) (DeleteExportResponseObject, error)
	// GetExport Get an export's status and files
	// (GET /projects/{projectId}/exports/{exportId})
	GetExport(ctx context.Context, request GetExportRequestObject) (GetExportResponseObject, error)
	// CancelExport Cancel a running or queued export
	// (POST /projects/{projectId}/exports/{exportId}/cancel)
	CancelExport(ctx context.Context, request CancelExportRequestObject) (CancelExportResponseObject, error)
	// DownloadExportFile Download one file of a finished export
	// (GET /projects/{projectId}/exports/{exportId}/files/{name})
	DownloadExportFile(ctx context.Context, request DownloadExportFileRequestObject) (DownloadExportFileResponseObject, error)
	// GetProjectManifest Get the package.json a project was created from, byte for byte
	// (GET /projects/{projectId}/manifest)
	GetProjectManifest(ctx context.Context, request GetProjectManifestRequestObject) (GetProjectManifestResponseObject, error)
	// SetProjectTarget Change the project's target platform and toolchain
	// (PUT /projects/{projectId}/target)
	SetProjectTarget(ctx context.Context, request SetProjectTargetRequestObject) (SetProjectTargetResponseObject, error)
	// GetSettings Get settings, with signatureKey masked
	// (GET /settings)
	GetSettings(ctx context.Context, request GetSettingsRequestObject) (GetSettingsResponseObject, error)
	// UpdateSettings Update settings
	// (PUT /settings)
	UpdateSettings(ctx context.Context, request UpdateSettingsRequestObject) (UpdateSettingsResponseObject, error)
	// GetTools Installed and available tool versions, DB date
	// (GET /tools)
	GetTools(ctx context.Context, request GetToolsRequestObject) (GetToolsResponseObject, error)
	// ActivateTrivy Activate an installed Trivy version
	// (POST /tools/trivy/activate)
	ActivateTrivy(ctx context.Context, request ActivateTrivyRequestObject) (ActivateTrivyResponseObject, error)
	// UpdateTrivyDB Force a Trivy DB download
	// (POST /tools/trivy/db/update)
	UpdateTrivyDB(ctx context.Context, request UpdateTrivyDBRequestObject) (UpdateTrivyDBResponseObject, error)
	// UpdateTrivy Install a new Trivy release
	// (POST /tools/trivy/update)
	UpdateTrivy(ctx context.Context, request UpdateTrivyRequestObject) (UpdateTrivyResponseObject, error)
}

StrictServerInterface represents all server handlers.

type Subscriptions

type Subscriptions interface {
	Subscribe() (<-chan jobs.Event, func())
}

Subscriptions is the narrow view of a job queue the events handler needs. *jobs.Queue satisfies it; a fake in tests can feed canned events without running a real worker goroutine.

type Target

type Target struct {
	Cpu     string `json:"cpu"`
	Libc    string `json:"libc"`
	Node    string `json:"node"`
	Os      string `json:"os"`
	PnpmVer string `json:"pnpmVer"`
}

Target The system a resolution or an export is prepared for

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type ToolsState

type ToolsState struct {
	// LatestSizeBytes Size in bytes of the latest Trivy release asset for this host, 0 when the latest release is itself unavailable
	LatestSizeBytes int `json:"latestSizeBytes"`

	// Missing Names of what ready needs and does not have yet
	Missing       []string `json:"missing"`
	PnpmInstalled []string `json:"pnpmInstalled"`

	// Ready Whether trivy, its database and a signature key are all in place
	Ready          bool      `json:"ready"`
	TrivyActive    string    `json:"trivyActive"`
	TrivyDbDate    time.Time `json:"trivyDbDate"`
	TrivyInstalled []string  `json:"trivyInstalled"`
	TrivyLatest    string    `json:"trivyLatest"`

	// TrivyLatestAge Duration since the latest Trivy release, as a Go duration string
	TrivyLatestAge string `json:"trivyLatestAge"`

	// TrivyRecommended Newest Trivy release old enough to install without force, set only while the latest release is younger than the minimum release age
	TrivyRecommended *string `json:"trivyRecommended,omitempty"`
}

ToolsState Installed and available pnpm and Trivy versions, and the DB date.

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UpdateSettings200JSONResponse

type UpdateSettings200JSONResponse Settings

func (UpdateSettings200JSONResponse) VisitUpdateSettingsResponse

func (response UpdateSettings200JSONResponse) VisitUpdateSettingsResponse(w http.ResponseWriter) error

type UpdateSettingsJSONRequestBody

type UpdateSettingsJSONRequestBody = Settings

UpdateSettingsJSONRequestBody defines body for UpdateSettings for application/json ContentType.

type UpdateSettingsRequestObject

type UpdateSettingsRequestObject struct {
	Body *UpdateSettingsJSONRequestBody
}

type UpdateSettingsResponseObject

type UpdateSettingsResponseObject interface {
	VisitUpdateSettingsResponse(w http.ResponseWriter) error
}

type UpdateSettingsdefaultApplicationProblemPlusJSONResponse

type UpdateSettingsdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (UpdateSettingsdefaultApplicationProblemPlusJSONResponse) VisitUpdateSettingsResponse

func (response UpdateSettingsdefaultApplicationProblemPlusJSONResponse) VisitUpdateSettingsResponse(w http.ResponseWriter) error

type UpdateTrivy200JSONResponse

type UpdateTrivy200JSONResponse ToolsState

func (UpdateTrivy200JSONResponse) VisitUpdateTrivyResponse

func (response UpdateTrivy200JSONResponse) VisitUpdateTrivyResponse(w http.ResponseWriter) error

type UpdateTrivyDB200JSONResponse

type UpdateTrivyDB200JSONResponse ToolsState

func (UpdateTrivyDB200JSONResponse) VisitUpdateTrivyDBResponse

func (response UpdateTrivyDB200JSONResponse) VisitUpdateTrivyDBResponse(w http.ResponseWriter) error

type UpdateTrivyDBRequestObject

type UpdateTrivyDBRequestObject struct {
}

type UpdateTrivyDBResponseObject

type UpdateTrivyDBResponseObject interface {
	VisitUpdateTrivyDBResponse(w http.ResponseWriter) error
}

type UpdateTrivyDBdefaultApplicationProblemPlusJSONResponse

type UpdateTrivyDBdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (UpdateTrivyDBdefaultApplicationProblemPlusJSONResponse) VisitUpdateTrivyDBResponse

type UpdateTrivyJSONBody

type UpdateTrivyJSONBody struct {
	// Force Install the latest release regardless of its age
	Force bool `json:"force"`

	// Version Install this release instead of the latest, such as the ToolsState.trivyRecommended version. Still subject to the minimum age check unless force is set.
	Version *string `json:"version,omitempty"`
}

UpdateTrivyJSONBody defines parameters for UpdateTrivy.

type UpdateTrivyJSONRequestBody

type UpdateTrivyJSONRequestBody UpdateTrivyJSONBody

UpdateTrivyJSONRequestBody defines body for UpdateTrivy for application/json ContentType.

type UpdateTrivyRequestObject

type UpdateTrivyRequestObject struct {
	Body *UpdateTrivyJSONRequestBody
}

type UpdateTrivyResponseObject

type UpdateTrivyResponseObject interface {
	VisitUpdateTrivyResponse(w http.ResponseWriter) error
}

type UpdateTrivydefaultApplicationProblemPlusJSONResponse

type UpdateTrivydefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (UpdateTrivydefaultApplicationProblemPlusJSONResponse) VisitUpdateTrivyResponse

type Vector

type Vector = []int

Vector CVE counts by severity, critical to unknown

type WatchJob200TexteventStreamResponse

type WatchJob200TexteventStreamResponse struct {
	Body          io.Reader
	ContentLength int64
}

func (WatchJob200TexteventStreamResponse) VisitWatchJobResponse

func (response WatchJob200TexteventStreamResponse) VisitWatchJobResponse(w http.ResponseWriter) error

type WatchJobRequestObject

type WatchJobRequestObject struct {
}

type WatchJobResponseObject

type WatchJobResponseObject interface {
	VisitWatchJobResponse(w http.ResponseWriter) error
}

type WatchJobdefaultApplicationProblemPlusJSONResponse

type WatchJobdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (WatchJobdefaultApplicationProblemPlusJSONResponse) VisitWatchJobResponse

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL