api

package
v0.0.0-...-ebe1833 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 9 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.5.0 DO NOT EDIT.

Package api 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

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router gin.IRouter, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type Compliance

type Compliance struct {
	// Control Security control information for compliance assessment
	Control ComplianceControl `json:"control"`

	// EnrichmentStatus Status of the compliance enrichment process: Success, Unmapped, Partial, Unknown, or Skipped.
	EnrichmentStatus ComplianceEnrichmentStatus `json:"enrichmentStatus"`

	// Frameworks Compliance framework and requirement information
	Frameworks ComplianceFrameworks `json:"frameworks"`

	// Risk Compliance risk assessment information
	Risk *ComplianceRisk `json:"risk,omitempty"`
}

Compliance Compliance details from OCSF Security Control Profile.

type ComplianceControl

type ComplianceControl struct {
	// Applicability Environments or contexts where this control applies
	Applicability *[]string `json:"applicability,omitempty"`

	// CatalogId Unique identifier for the security control catalog or framework
	CatalogId string `json:"catalogId"`

	// Category Category or family that the security control belongs to
	Category string `json:"category"`

	// Id Unique identifier for the security control being assessed
	Id string `json:"id"`

	// RemediationDescription Description of the recommended remediation strategy for this control
	RemediationDescription *string `json:"remediationDescription,omitempty"`
}

ComplianceControl Security control information for compliance assessment

type ComplianceEnrichmentStatus

type ComplianceEnrichmentStatus string

ComplianceEnrichmentStatus Status of the compliance enrichment process: Success, Unmapped, Partial, Unknown, or Skipped.

const (
	Partial  ComplianceEnrichmentStatus = "Partial"
	Skipped  ComplianceEnrichmentStatus = "Skipped"
	Success  ComplianceEnrichmentStatus = "Success"
	Unknown  ComplianceEnrichmentStatus = "Unknown"
	Unmapped ComplianceEnrichmentStatus = "Unmapped"
)

Defines values for ComplianceEnrichmentStatus.

type ComplianceFrameworks

type ComplianceFrameworks struct {
	// Frameworks Regulatory or industry standards being evaluated for compliance
	Frameworks []string `json:"frameworks"`

	// Requirements Compliance requirement identifiers from the frameworks being evaluated
	Requirements []string `json:"requirements"`
}

ComplianceFrameworks Compliance framework and requirement information

type ComplianceRisk

type ComplianceRisk struct {
	// Level Risk level associated with non-compliance
	Level ComplianceRiskLevel `json:"level"`
}

ComplianceRisk Compliance risk assessment information

type ComplianceRiskLevel

type ComplianceRiskLevel string

ComplianceRiskLevel Risk level associated with non-compliance

const (
	Critical      ComplianceRiskLevel = "Critical"
	High          ComplianceRiskLevel = "High"
	Informational ComplianceRiskLevel = "Informational"
	Low           ComplianceRiskLevel = "Low"
	Medium        ComplianceRiskLevel = "Medium"
)

Defines values for ComplianceRiskLevel.

type EnrichmentRequest

type EnrichmentRequest struct {
	// Policy Complete evidence log from policy engines and compliance assessment tools
	Policy Policy `json:"policy"`
}

EnrichmentRequest Request payload for telemetry attribute enrichment

type EnrichmentResponse

type EnrichmentResponse struct {
	// Compliance Compliance details from OCSF Security Control Profile.
	Compliance Compliance `json:"compliance"`
}

EnrichmentResponse Complete compliance metadata including control mappings, frameworks, risk assessment.

type Error

type Error struct {
	// Code HTTP status code
	Code int32 `json:"code"`

	// Message Error message
	Message string `json:"message"`
}

Error defines model for Error.

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type Policy

type Policy struct {
	// PolicyEngineName Name of the policy engine that performed the evaluation or enforcement action
	PolicyEngineName string `json:"policyEngineName"`

	// PolicyRuleId Unique identifier for the policy rule being evaluated or enforced
	PolicyRuleId string `json:"policyRuleId"`
}

Policy Complete evidence log from policy engines and compliance assessment tools

type PostV1EnrichJSONRequestBody

type PostV1EnrichJSONRequestBody = EnrichmentRequest

PostV1EnrichJSONRequestBody defines body for PostV1Enrich for application/json ContentType.

type ServerInterface

type ServerInterface interface {
	// Enrich telemetry attributes with compliance control data
	// (POST /v1/enrich)
	PostV1Enrich(c *gin.Context)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) PostV1Enrich

func (siw *ServerInterfaceWrapper) PostV1Enrich(c *gin.Context)

PostV1Enrich operation middleware

Jump to

Keyboard shortcuts

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