Documentation
¶
Overview ¶
Package reference 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.
Index ¶
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
- type EntityCategory
- type EntityType
- type ErrorResponse
- type ErrorResponseErrorCode
- type Forbidden
- type ForbiddenJSONResponse
- type GetReference200JSONResponse
- type GetReference401JSONResponse
- type GetReference403JSONResponse
- type GetReference500JSONResponse
- type GetReference501JSONResponse
- type GetReferenceParams
- type GetReferenceRequestObject
- type GetReferenceResponseObject
- type InternalError
- type InternalErrorJSONResponse
- type InvalidParamFormatError
- type MiddlewareFunc
- type NodeType
- type NotImplemented
- type NotImplementedJSONResponse
- type ProjectId
- type Reference
- type RelationType
- type RequiredHeaderError
- type RequiredParamError
- type ServeMux
- type ServerInterface
- type ServerInterfaceWrapper
- type Source
- type SourceKind
- type StdHTTPServerOptions
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type Unauthorized
- type UnauthorizedJSONResponse
- type UnescapedCookieParamError
- type UnmarshalingParamError
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
Types ¶
type EntityCategory ¶
type EntityCategory string
EntityCategory Family of entity types, coarse enough to stay stable as new types are added.
const ( EntityCategoryAsset EntityCategory = "asset" EntityCategoryExecution EntityCategory = "execution" EntityCategoryIdentity EntityCategory = "identity" EntityCategoryNetwork EntityCategory = "network" EntityCategoryOther EntityCategory = "other" EntityCategoryPersistence EntityCategory = "persistence" )
Defines values for EntityCategory.
func (EntityCategory) Valid ¶
func (e EntityCategory) Valid() bool
Valid indicates whether the value is a known member of the EntityCategory enum.
type EntityType ¶
type EntityType struct {
// Category Broad family the type belongs to. Lets the graph colour related kinds alike without knowing every code.
Category EntityCategory `json:"category"`
// Code What `type_code` on an entity or a graph node holds — host, user, account, email, process, ip, domain, url, file_hash.
Code string `json:"code"`
// Title Human-readable name for the UI.
Title string `json:"title"`
}
EntityType Entity type available to the API.
type ErrorResponse ¶
type ErrorResponse struct {
// Error The failure itself. Never carries internal details of a 500.
Error struct {
// Code Machine-readable reason, stable across releases. `validation` covers both a malformed body (400) and a well-formed but invalid one (422). `not_implemented` means the operation exists in the contract but has no implementation yet — a client can hide the control instead of showing an error.
Code ErrorResponseErrorCode `json:"code"`
// Details Extra context tied to the code. Version conflicts list the clashing ids in `conflicts`; validation failures name the field.
Details *map[string]interface{} `json:"details,omitempty"`
// Message Human-readable explanation, safe to show. For an internal error it is deliberately generic — the real cause goes to the log.
Message string `json:"message"`
} `json:"error"`
}
ErrorResponse Body of every non-2xx response. Clients branch on `code`, not on the HTTP status: the status says what happened at the protocol level, the code says what happened in the domain.
type ErrorResponseErrorCode ¶
type ErrorResponseErrorCode string
ErrorResponseErrorCode Machine-readable reason, stable across releases. `validation` covers both a malformed body (400) and a well-formed but invalid one (422). `not_implemented` means the operation exists in the contract but has no implementation yet — a client can hide the control instead of showing an error.
const ( ErrorResponseErrorCodeConflict ErrorResponseErrorCode = "conflict" ErrorResponseErrorCodeForbidden ErrorResponseErrorCode = "forbidden" ErrorResponseErrorCodeInternal ErrorResponseErrorCode = "internal" ErrorResponseErrorCodeNotFound ErrorResponseErrorCode = "not_found" ErrorResponseErrorCodeNotImplemented ErrorResponseErrorCode = "not_implemented" ErrorResponseErrorCodeValidation ErrorResponseErrorCode = "validation" )
Defines values for ErrorResponseErrorCode.
func (ErrorResponseErrorCode) Valid ¶
func (e ErrorResponseErrorCode) Valid() bool
Valid indicates whether the value is a known member of the ErrorResponseErrorCode enum.
type Forbidden ¶
type Forbidden = ErrorResponse
Forbidden Body of every non-2xx response. Clients branch on `code`, not on the HTTP status: the status says what happened at the protocol level, the code says what happened in the domain.
type ForbiddenJSONResponse ¶
type ForbiddenJSONResponse ErrorResponse
type GetReference200JSONResponse ¶
type GetReference200JSONResponse Reference
func (GetReference200JSONResponse) VisitGetReferenceResponse ¶
func (response GetReference200JSONResponse) VisitGetReferenceResponse(w http.ResponseWriter) error
type GetReference401JSONResponse ¶
func (GetReference401JSONResponse) VisitGetReferenceResponse ¶
func (response GetReference401JSONResponse) VisitGetReferenceResponse(w http.ResponseWriter) error
type GetReference403JSONResponse ¶
type GetReference403JSONResponse struct{ ForbiddenJSONResponse }
func (GetReference403JSONResponse) VisitGetReferenceResponse ¶
func (response GetReference403JSONResponse) VisitGetReferenceResponse(w http.ResponseWriter) error
type GetReference500JSONResponse ¶
type GetReference500JSONResponse struct{ InternalErrorJSONResponse }
func (GetReference500JSONResponse) VisitGetReferenceResponse ¶
func (response GetReference500JSONResponse) VisitGetReferenceResponse(w http.ResponseWriter) error
type GetReference501JSONResponse ¶
type GetReference501JSONResponse struct{ NotImplementedJSONResponse }
func (GetReference501JSONResponse) VisitGetReferenceResponse ¶
func (response GetReference501JSONResponse) VisitGetReferenceResponse(w http.ResponseWriter) error
type GetReferenceParams ¶
type GetReferenceParams struct {
// XProjectID Sb0rka project selected for this request. It scopes IR data, the project's external-source configuration, and project Secrets.
XProjectID ProjectId `json:"X-Project-ID"`
}
GetReferenceParams defines parameters for GetReference.
type GetReferenceRequestObject ¶
type GetReferenceRequestObject struct {
Params GetReferenceParams
}
type GetReferenceResponseObject ¶
type GetReferenceResponseObject interface {
VisitGetReferenceResponse(w http.ResponseWriter) error
}
type InternalError ¶
type InternalError = ErrorResponse
InternalError Body of every non-2xx response. Clients branch on `code`, not on the HTTP status: the status says what happened at the protocol level, the code says what happened in the domain.
type InternalErrorJSONResponse ¶
type InternalErrorJSONResponse ErrorResponse
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type NodeType ¶
type NodeType string
NodeType What a graph node stands for. An entity node is a host, account, process, address or hash; an event node is a source record promoted onto the graph.
type NotImplemented ¶
type NotImplemented = ErrorResponse
NotImplemented Body of every non-2xx response. Clients branch on `code`, not on the HTTP status: the status says what happened at the protocol level, the code says what happened in the domain.
type NotImplementedJSONResponse ¶
type NotImplementedJSONResponse ErrorResponse
type Reference ¶
type Reference struct {
// EntityTypes Kinds of entity that can appear as a node.
EntityTypes []EntityType `json:"entity_types"`
// RelationTypes Relations an edge can assert between two nodes.
RelationTypes []RelationType `json:"relation_types"`
// Sources Security tools events can be pulled from. Disabled ones are omitted.
Sources []Source `json:"sources"`
}
Reference The full set of dictionaries, in one request.
type RelationType ¶
type RelationType struct {
// Code What `relation_code` on an edge holds — parent_process, logged_in, connected_to, executed, resolved_to, same_host, subevent_of, followed_by.
Code string `json:"code"`
// Directed Whether the order of the endpoints carries meaning. Undirected relations are drawn without an arrowhead and read the same either way.
Directed bool `json:"directed"`
// SourceKind Kind of node the relation may start from.
SourceKind NodeType `json:"source_kind"`
// TargetKind Kind of node it may point to.
TargetKind NodeType `json:"target_kind"`
// Title Human-readable name, drawn on or beside the edge.
Title string `json:"title"`
}
RelationType A relation an edge may assert. The endpoint kinds are what make this more than a label: they say which pairs of nodes the relation is legal between, so the client can offer only the relations that fit the two nodes an analyst selected — and the server rejects the rest anyway.
type RequiredHeaderError ¶
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 {
// GetReference Reference dictionaries
// (GET /reference)
GetReference(w http.ResponseWriter, r *http.Request, params GetReferenceParams)
}
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) GetReference ¶
func (siw *ServerInterfaceWrapper) GetReference(w http.ResponseWriter, r *http.Request)
GetReference operation middleware
type Source ¶
type Source struct {
// Code What `source_code` holds on an event and in an ingest request.
Code string `json:"code"`
// Kind Class of tool. Determines which query fields make sense and how the UI groups sources.
Kind SourceKind `json:"kind"`
// Title Human-readable name of the installation, e.g. "MaxPatrol SIEM".
Title string `json:"title"`
}
Source A security tool events can be pulled from. Connection settings and credentials are deliberately absent — the client only needs to name a source, never to reach it.
type SourceKind ¶
type SourceKind string
SourceKind Class of security tool the source belongs to.
const ( SourceKindEdr SourceKind = "edr" SourceKindInfra SourceKind = "infra" SourceKindNdr SourceKind = "ndr" SourceKindOther SourceKind = "other" SourceKindSandbox SourceKind = "sandbox" SourceKindSiem SourceKind = "siem" )
Defines values for SourceKind.
func (SourceKind) Valid ¶
func (e SourceKind) Valid() bool
Valid indicates whether the value is a known member of the SourceKind enum.
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
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 StrictMiddlewareFunc ¶
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// GetReference Reference dictionaries
// (GET /reference)
GetReference(ctx context.Context, request GetReferenceRequestObject) (GetReferenceResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type Unauthorized ¶
type Unauthorized = ErrorResponse
Unauthorized Body of every non-2xx response. Clients branch on `code`, not on the HTTP status: the status says what happened at the protocol level, the code says what happened in the domain.
type UnauthorizedJSONResponse ¶
type UnauthorizedJSONResponse ErrorResponse
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error