apigen

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

README

Generated OpenAPI Types (internal/api-gen)

This directory contains types generated from docs/api-spec.yaml using oapi-codegen (types-only generation).

How to regenerate:

task api-spec:refresh

this will pull down the latest changes and regenerate types.

Alternatively:

task api-spec:pull

this will just pull down the latest changes.

task api-spec:gen

this regenerate types.

CI also runs a drift check:

task api-spec:check

Notes:

  • The generated types follow the spec exactly (field names, optionality, enums).
  • Do not edit generated files manually.

Documentation

Overview

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

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

Index

Constants

View Source
const (
	PublishableKeyAuthScopes = "PublishableKeyAuth.Scopes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchRatingRequest

type BatchRatingRequest struct {
	Identifiers []TargetIdentifier `json:"identifiers"`

	// Timeout Max wait time for any individual scan
	Timeout *int32 `json:"timeout,omitempty"`
}

BatchRatingRequest defines model for BatchRatingRequest.

type BatchRatingResponse

type BatchRatingResponse struct {
	// Ratings Per-item rating link results for the requested identifiers.
	Ratings []struct {
		Identifier TargetIdentifier `json:"identifier"`

		// RatingUrl URL path to fetch full rating details for this item.
		RatingUrl string `json:"rating_url"`
	} `json:"ratings"`
}

BatchRatingResponse defines model for BatchRatingResponse.

type DefaultError

type DefaultError = Error

DefaultError defines model for DefaultError.

type Error

type Error struct {
	// Details Additional error context
	Details *map[string]interface{} `json:"details,omitempty"`

	// Error Error code
	Error string `json:"error"`

	// Message Human-readable error message
	Message string `json:"message"`

	// RequestId Unique request identifier for debugging
	RequestId *string `json:"request_id,omitempty"`
}

Error defines model for Error.

type ErrorResponse

type ErrorResponse struct {
	Details *map[string]interface{} `json:"details,omitempty"`
	Error   string                  `json:"error"`
	Message string                  `json:"message"`
}

ErrorResponse defines model for ErrorResponse.

type GetHealthParams

type GetHealthParams struct {
	// Authorization Bearer publishable key (format: ^ens_pk_live_[a-f0-9]{40}$)
	Authorization PublishableAuthHeader `json:"Authorization"`
}

GetHealthParams defines parameters for GetHealth.

type GetRatingByOCIParams

type GetRatingByOCIParams struct {
	// Timeout Maximum time to wait for scan completion (seconds)
	Timeout *TimeoutQuery `form:"timeout,omitempty" json:"timeout,omitempty"`

	// XOrgUuid Optional organization UUID for usage reporting
	XOrgUuid *OrgUuidHeader `json:"X-Org-Uuid,omitempty"`

	// XHostUuid Optional host UUID for usage reporting
	XHostUuid *HostUuidHeader `json:"X-Host-Uuid,omitempty"`

	// Authorization Bearer publishable key (format: ^ens_pk_live_[a-f0-9]{40}$)
	Authorization PublishableAuthHeader `json:"Authorization"`
}

GetRatingByOCIParams defines parameters for GetRatingByOCI.

type GetRatingByPurlParams

type GetRatingByPurlParams struct {
	// Timeout Maximum time to wait for scan completion (seconds)
	Timeout *TimeoutQuery `form:"timeout,omitempty" json:"timeout,omitempty"`

	// XOrgUuid Optional organization UUID for usage reporting
	XOrgUuid *OrgUuidHeader `json:"X-Org-Uuid,omitempty"`

	// XHostUuid Optional host UUID for usage reporting
	XHostUuid *HostUuidHeader `json:"X-Host-Uuid,omitempty"`

	// Authorization Bearer publishable key (format: ^ens_pk_live_[a-f0-9]{40}$)
	Authorization PublishableAuthHeader `json:"Authorization"`
}

GetRatingByPurlParams defines parameters for GetRatingByPurl.

type GetRatingByRepoParams

type GetRatingByRepoParams struct {
	// Timeout Maximum time to wait for scan completion (seconds)
	Timeout *TimeoutQuery `form:"timeout,omitempty" json:"timeout,omitempty"`

	// XOrgUuid Optional organization UUID for usage reporting
	XOrgUuid *OrgUuidHeader `json:"X-Org-Uuid,omitempty"`

	// XHostUuid Optional host UUID for usage reporting
	XHostUuid *HostUuidHeader `json:"X-Host-Uuid,omitempty"`

	// Authorization Bearer publishable key (format: ^ens_pk_live_[a-f0-9]{40}$)
	Authorization PublishableAuthHeader `json:"Authorization"`
}

GetRatingByRepoParams defines parameters for GetRatingByRepo.

type GetRatingByUrlParams

type GetRatingByUrlParams struct {
	// Timeout Maximum time to wait for scan completion (seconds)
	Timeout *TimeoutQuery `form:"timeout,omitempty" json:"timeout,omitempty"`

	// XOrgUuid Optional organization UUID for usage reporting
	XOrgUuid *OrgUuidHeader `json:"X-Org-Uuid,omitempty"`

	// XHostUuid Optional host UUID for usage reporting
	XHostUuid *HostUuidHeader `json:"X-Host-Uuid,omitempty"`

	// Authorization Bearer publishable key (format: ^ens_pk_live_[a-f0-9]{40}$)
	Authorization PublishableAuthHeader `json:"Authorization"`
}

GetRatingByUrlParams defines parameters for GetRatingByUrl.

type GetRatingsBatchJSONRequestBody

type GetRatingsBatchJSONRequestBody = BatchRatingRequest

GetRatingsBatchJSONRequestBody defines body for GetRatingsBatch for application/json ContentType.

type GetRatingsBatchParams

type GetRatingsBatchParams struct {
	// Timeout Maximum time to wait for scan completion (seconds)
	Timeout *TimeoutQuery `form:"timeout,omitempty" json:"timeout,omitempty"`

	// XOrgUuid Optional organization UUID for usage reporting
	XOrgUuid *OrgUuidHeader `json:"X-Org-Uuid,omitempty"`

	// XHostUuid Optional host UUID for usage reporting
	XHostUuid *HostUuidHeader `json:"X-Host-Uuid,omitempty"`

	// Authorization Bearer publishable key (format: ^ens_pk_live_[a-f0-9]{40}$)
	Authorization PublishableAuthHeader `json:"Authorization"`
}

GetRatingsBatchParams defines parameters for GetRatingsBatch.

type GetScanStatusParams

type GetScanStatusParams struct {
	// XOrgUuid Optional organization UUID for usage reporting
	XOrgUuid *OrgUuidHeader `json:"X-Org-Uuid,omitempty"`

	// XHostUuid Optional host UUID for usage reporting
	XHostUuid *HostUuidHeader `json:"X-Host-Uuid,omitempty"`

	// Authorization Bearer publishable key (format: ^ens_pk_live_[a-f0-9]{40}$)
	Authorization PublishableAuthHeader `json:"Authorization"`
}

GetScanStatusParams defines parameters for GetScanStatus.

type HealthResponse

type HealthResponse struct {
	// ApiSpecVersion Duplicate of API spec version for explicitness.
	ApiSpecVersion string `json:"api_spec_version"`
	Capabilities   struct {
		AsyncScanning   *bool `json:"async_scanning,omitempty"`
		BatchOperations *bool `json:"batch_operations,omitempty"`
		RatingsLookup   *bool `json:"ratings_lookup,omitempty"`
	} `json:"capabilities"`

	// Errors Critical issues (when status is unhealthy)
	Errors *[]string `json:"errors,omitempty"`

	// ServerVersion Deployed server implementation version.
	ServerVersion string `json:"server_version"`
	Services      struct {
		Database     *HealthResponseServicesDatabase     `json:"database,omitempty"`
		ScannerQueue *HealthResponseServicesScannerQueue `json:"scanner_queue,omitempty"`
	} `json:"services"`

	// Status Overall service health status
	Status HealthResponseStatus `json:"status"`

	// Timestamp Health check timestamp
	Timestamp time.Time `json:"timestamp"`

	// Version API spec version.
	Version string `json:"version"`

	// Warnings Non-critical issues
	Warnings *[]string `json:"warnings,omitempty"`
}

HealthResponse defines model for HealthResponse.

type HealthResponseServicesDatabase

type HealthResponseServicesDatabase string

HealthResponseServicesDatabase defines model for HealthResponse.Services.Database.

const (
	HealthResponseServicesDatabaseDegraded  HealthResponseServicesDatabase = "degraded"
	HealthResponseServicesDatabaseHealthy   HealthResponseServicesDatabase = "healthy"
	HealthResponseServicesDatabaseUnhealthy HealthResponseServicesDatabase = "unhealthy"
)

Defines values for HealthResponseServicesDatabase.

type HealthResponseServicesScannerQueue

type HealthResponseServicesScannerQueue string

HealthResponseServicesScannerQueue defines model for HealthResponse.Services.ScannerQueue.

const (
	HealthResponseServicesScannerQueueDegraded  HealthResponseServicesScannerQueue = "degraded"
	HealthResponseServicesScannerQueueHealthy   HealthResponseServicesScannerQueue = "healthy"
	HealthResponseServicesScannerQueueUnhealthy HealthResponseServicesScannerQueue = "unhealthy"
)

Defines values for HealthResponseServicesScannerQueue.

type HealthResponseStatus

type HealthResponseStatus string

HealthResponseStatus Overall service health status

const (
	Degraded  HealthResponseStatus = "degraded"
	Healthy   HealthResponseStatus = "healthy"
	Unhealthy HealthResponseStatus = "unhealthy"
)

Defines values for HealthResponseStatus.

type HostUuidHeader

type HostUuidHeader = openapi_types.UUID

HostUuidHeader defines model for HostUuidHeader.

type IdentifierKind

type IdentifierKind string

IdentifierKind Type of identifier.

const (
	Oci  IdentifierKind = "oci"
	Purl IdentifierKind = "purl"
	Repo IdentifierKind = "repo"
	Url  IdentifierKind = "url"
)

Defines values for IdentifierKind.

type NotAcceptable

type NotAcceptable = Error

NotAcceptable defines model for NotAcceptable.

type OrgUuidHeader

type OrgUuidHeader = openapi_types.UUID

OrgUuidHeader defines model for OrgUuidHeader.

type PublishableAuthHeader

type PublishableAuthHeader = string

PublishableAuthHeader defines model for PublishableAuthHeader.

type RateLimited

type RateLimited = Error

RateLimited defines model for RateLimited.

type RatingNotAvailableOrNotFound

type RatingNotAvailableOrNotFound = Error

RatingNotAvailableOrNotFound defines model for RatingNotAvailableOrNotFound.

type RatingResponse

type RatingResponse struct {
	// Links Optional navigation links related to this batch request.
	Links *struct {
		// Ratings Per-item rating links for convenience.
		Ratings *[]struct {
			// Name Optional human-friendly name for the rated item.
			Name *string `json:"name,omitempty"`

			// RatingUrl URL path to fetch full rating details for this item.
			RatingUrl string `json:"rating_url"`
		} `json:"ratings,omitempty"`

		// ScanStatus URL to the scan-status resource tracking any pending work for this batch.
		ScanStatus *string `json:"scan_status,omitempty"`
	} `json:"links,omitempty"`

	// Ratings Successfully retrieved ratings
	Ratings []SecurityRating `json:"ratings"`
}

RatingResponse defines model for RatingResponse.

type ScanExpired

type ScanExpired = Error

ScanExpired defines model for ScanExpired.

type ScanInProgress

type ScanInProgress struct {
	// EstimatedCompletion Estimated completion time
	EstimatedCompletion time.Time `json:"estimated_completion"`

	// PollUrl URL path to poll for updates
	PollUrl *string `json:"poll_url,omitempty"`

	// ScanId Unique scan identifier for polling
	ScanId openapi_types.UUID `json:"scan_id"`

	// Status Current scan status
	Status ScanInProgressStatus `json:"status"`
}

ScanInProgress defines model for ScanInProgress.

type ScanInProgressStatus

type ScanInProgressStatus string

ScanInProgressStatus Current scan status

const (
	ScanInProgressStatusQueued   ScanInProgressStatus = "queued"
	ScanInProgressStatusScanning ScanInProgressStatus = "scanning"
)

Defines values for ScanInProgressStatus.

type ScanMetrics

type ScanMetrics struct {
	ScanDurationMs   *int64 `json:"scan_duration_ms"`
	TargetsCompleted *int32 `json:"targets_completed,omitempty"`
	TargetsFailed    *int32 `json:"targets_failed,omitempty"`
	TargetsTotal     *int32 `json:"targets_total,omitempty"`
}

ScanMetrics defines model for ScanMetrics.

type ScanNotFound

type ScanNotFound = Error

ScanNotFound defines model for ScanNotFound.

type ScanStatus

type ScanStatus struct {
	CompletedAt  *time.Time `json:"completed_at"`
	ErrorMessage *string    `json:"error_message"`
	Links        *struct {
		Self *string `json:"self,omitempty"`
	} `json:"links,omitempty"`
	Metrics *ScanMetrics `json:"metrics,omitempty"`

	// Progress Aggregate completion percentage across targets.
	Progress  *int32             `json:"progress,omitempty"`
	ScanId    openapi_types.UUID `json:"scan_id"`
	StartedAt time.Time          `json:"started_at"`

	// Status Aggregate status across all targets.
	Status    ScanStatusStatus `json:"status"`
	Targets   []ScanTarget     `json:"targets"`
	UpdatedAt *time.Time       `json:"updated_at"`
}

ScanStatus defines model for ScanStatus.

type ScanStatusStatus

type ScanStatusStatus string

ScanStatusStatus Aggregate status across all targets.

const (
	ScanStatusStatusCanceled  ScanStatusStatus = "canceled"
	ScanStatusStatusCompleted ScanStatusStatus = "completed"
	ScanStatusStatusFailed    ScanStatusStatus = "failed"
	ScanStatusStatusPartial   ScanStatusStatus = "partial"
	ScanStatusStatusQueued    ScanStatusStatus = "queued"
	ScanStatusStatusRunning   ScanStatusStatus = "running"
)

Defines values for ScanStatusStatus.

type ScanTarget

type ScanTarget struct {
	CompletedAt  *time.Time       `json:"completed_at"`
	ErrorMessage *string          `json:"error_message"`
	Identifier   TargetIdentifier `json:"identifier"`

	// Name Human-friendly target label (e.g., package or server name).
	Name string `json:"name"`

	// RatingUrl URL path to fetch full rating details for this target when status is completed.
	RatingUrl *string          `json:"rating_url"`
	StartedAt *time.Time       `json:"started_at"`
	Status    ScanTargetStatus `json:"status"`
}

ScanTarget defines model for ScanTarget.

type ScanTargetStatus

type ScanTargetStatus string

ScanTargetStatus defines model for ScanTarget.Status.

const (
	Completed ScanTargetStatus = "completed"
	Failed    ScanTargetStatus = "failed"
	Queued    ScanTargetStatus = "queued"
	Running   ScanTargetStatus = "running"
	Skipped   ScanTargetStatus = "skipped"
)

Defines values for ScanTargetStatus.

type SecurityRating

type SecurityRating struct {
	// Classification Security classification for the server.
	Classification SecurityRatingClassification `json:"classification"`

	// Description Human-readable summary of what the server provides and how it integrates.
	Description string `json:"description"`

	// Identifiers Consolidated identifiers discovered for this server.
	Identifiers *struct {
		// Oci OCI image reference if known.
		Oci *string `json:"oci,omitempty"`

		// Purl Package URL if known.
		Purl *string `json:"purl,omitempty"`

		// Repo GitHub/GitLab repository if known (org/repo or full URL).
		Repo *string `json:"repo,omitempty"`

		// ServerUrl MCP server base URL if known.
		ServerUrl *string `json:"server_url,omitempty"`
	} `json:"identifiers,omitempty"`

	// Labels Tags describing capabilities or domains (e.g., CI/CD, Development, Code Scanning, Package Management).
	Labels *[]string `json:"labels,omitempty"`

	// LastUpdated When this rating was last updated.
	LastUpdated time.Time `json:"last_updated"`

	// License Detected software license identifier (e.g., MIT, Apache-2.0).
	License *SecurityRatingLicense `json:"license,omitempty"`

	// Name MCP server name.
	Name string `json:"name"`

	// Permissions Capability-related security permissions.
	Permissions *struct {
		// FilesystemRead Server or tools can read the filesystem.
		FilesystemRead *bool `json:"filesystem_read,omitempty"`

		// FilesystemWrite Server or tools can write to the filesystem.
		FilesystemWrite *bool `json:"filesystem_write,omitempty"`

		// NetworkAccess Server or tools can access the network.
		NetworkAccess *bool `json:"network_access,omitempty"`
	} `json:"permissions,omitempty"`

	// ScanDetails Additional scan metadata.
	ScanDetails *struct {
		ScanDurationMs      *int64   `json:"scan_duration_ms,omitempty"`
		ScannedFiles        *int32   `json:"scanned_files,omitempty"`
		StaticAnalysisScore *float32 `json:"static_analysis_score,omitempty"`
	} `json:"scan_details,omitempty"`
	Scores struct {
		// Components Score breakdown by signal area.
		Components struct {
			CodeQuality     *int32 `json:"code_quality,omitempty"`
			Maintenance     *int32 `json:"maintenance,omitempty"`
			SupplyChain     *int32 `json:"supply_chain,omitempty"`
			Vulnerabilities *int32 `json:"vulnerabilities,omitempty"`
		} `json:"components"`

		// Confidence Confidence level in the computed scores.
		Confidence *SecurityRatingScoresConfidence `json:"confidence,omitempty"`

		// OverallGrade Letter grade summarizing security posture.
		OverallGrade SecurityRatingScoresOverallGrade `json:"overall_grade"`

		// OverallPercent Overall score as a percentage.
		OverallPercent *int32 `json:"overall_percent,omitempty"`
	} `json:"scores"`

	// Source How this rating was determined.
	Source SecurityRatingSource `json:"source"`

	// ToolCalls Catalog of available tool calls.
	ToolCalls *[]struct {
		// Category Action category (e.g., Create, Read, Update, Delete). Optional.
		Category *string `json:"category,omitempty"`

		// Description Human-readable tool description.
		Description *string `json:"description,omitempty"`

		// Name Tool call name.
		Name *string `json:"name,omitempty"`

		// Sensitive Whether the tool is considered sensitive.
		Sensitive *bool `json:"sensitive,omitempty"`
	} `json:"tool_calls,omitempty"`

	// ToolCallsCount Number of available tool calls reported by the server.
	ToolCallsCount *int32 `json:"tool_calls_count,omitempty"`

	// Version Server version.
	Version *string `json:"version,omitempty"`

	// Vulnerabilities Known CVEs or security issues.
	Vulnerabilities *[]string `json:"vulnerabilities,omitempty"`
}

SecurityRating defines model for SecurityRating.

type SecurityRatingClassification

type SecurityRatingClassification string

SecurityRatingClassification Security classification for the server.

const (
	Allowed    SecurityRatingClassification = "Allowed"
	Benign     SecurityRatingClassification = "Benign"
	Malicious  SecurityRatingClassification = "Malicious"
	Suspicious SecurityRatingClassification = "Suspicious"
	Unknown    SecurityRatingClassification = "Unknown"
)

Defines values for SecurityRatingClassification.

type SecurityRatingLicense

type SecurityRatingLicense string

SecurityRatingLicense Detected software license identifier (e.g., MIT, Apache-2.0).

const (
	AGPL30Only    SecurityRatingLicense = "AGPL-3.0-only"
	AGPL30OrLater SecurityRatingLicense = "AGPL-3.0-or-later"
	Apache20      SecurityRatingLicense = "Apache-2.0"
	BSD2Clause    SecurityRatingLicense = "BSD-2-Clause"
	BSD3Clause    SecurityRatingLicense = "BSD-3-Clause"
	CC010         SecurityRatingLicense = "CC0-1.0"
	EPL20         SecurityRatingLicense = "EPL-2.0"
	GPL20Only     SecurityRatingLicense = "GPL-2.0-only"
	GPL20OrLater  SecurityRatingLicense = "GPL-2.0-or-later"
	GPL30Only     SecurityRatingLicense = "GPL-3.0-only"
	GPL30OrLater  SecurityRatingLicense = "GPL-3.0-or-later"
	LGPL21Only    SecurityRatingLicense = "LGPL-2.1-only"
	LGPL21OrLater SecurityRatingLicense = "LGPL-2.1-or-later"
	LGPL30Only    SecurityRatingLicense = "LGPL-3.0-only"
	LGPL30OrLater SecurityRatingLicense = "LGPL-3.0-or-later"
	MIT           SecurityRatingLicense = "MIT"
	MPL20         SecurityRatingLicense = "MPL-2.0"
	Unlicense     SecurityRatingLicense = "Unlicense"
)

Defines values for SecurityRatingLicense.

type SecurityRatingScoresConfidence

type SecurityRatingScoresConfidence string

SecurityRatingScoresConfidence Confidence level in the computed scores.

const (
	High     SecurityRatingScoresConfidence = "high"
	Low      SecurityRatingScoresConfidence = "low"
	Medium   SecurityRatingScoresConfidence = "medium"
	VeryHigh SecurityRatingScoresConfidence = "very_high"
)

Defines values for SecurityRatingScoresConfidence.

type SecurityRatingScoresOverallGrade

type SecurityRatingScoresOverallGrade string

SecurityRatingScoresOverallGrade Letter grade summarizing security posture.

type SecurityRatingSource

type SecurityRatingSource string

SecurityRatingSource How this rating was determined.

const (
	AutomatedScan   SecurityRatingSource = "automated_scan"
	CommunityReport SecurityRatingSource = "community_report"
	Heuristic       SecurityRatingSource = "heuristic"
	ManualReview    SecurityRatingSource = "manual_review"
)

Defines values for SecurityRatingSource.

type ServiceUnavailable

type ServiceUnavailable = Error

ServiceUnavailable defines model for ServiceUnavailable.

type TargetIdentifier

type TargetIdentifier struct {
	// Kind Type of identifier.
	Kind  IdentifierKind `json:"kind"`
	Value string         `json:"value"`
}

TargetIdentifier defines model for TargetIdentifier.

type TimeoutQuery

type TimeoutQuery = int32

TimeoutQuery defines model for TimeoutQuery.

type Unauthorized

type Unauthorized = Error

Unauthorized defines model for Unauthorized.

type UnsupportedMediaType

type UnsupportedMediaType = Error

UnsupportedMediaType defines model for UnsupportedMediaType.

Jump to

Keyboard shortcuts

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