notifications

package
v0.0.0-...-6cfc1b2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 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 Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

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

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

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

HandlerWithOptions creates http.Handler with additional options

func NewPostNotificationApiIDRequest

func NewPostNotificationApiIDRequest(server string, apiID int64, body PostNotificationApiIDJSONRequestBody) (*http.Request, error)

NewPostNotificationApiIDRequest calls the generic PostNotificationApiID builder with application/json body

func NewPostNotificationApiIDRequestWithBody

func NewPostNotificationApiIDRequestWithBody(server string, apiID int64, contentType string, body io.Reader) (*http.Request, error)

NewPostNotificationApiIDRequestWithBody generates requests for PostNotificationApiID with any type of body

func PathToRawSpec

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

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

Types

type APIClarityNotification

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

APIClarityNotification defines model for APIClarityNotification.

func (APIClarityNotification) AsApiFindingsNotification

func (t APIClarityNotification) AsApiFindingsNotification() (ApiFindingsNotification, error)

AsApiFindingsNotification returns the union data inside the APIClarityNotification as a ApiFindingsNotification

func (APIClarityNotification) AsAuthorizationModelNotification

func (t APIClarityNotification) AsAuthorizationModelNotification() (AuthorizationModelNotification, error)

AsAuthorizationModelNotification returns the union data inside the APIClarityNotification as a AuthorizationModelNotification

func (APIClarityNotification) AsNewDiscoveredAPINotification

func (t APIClarityNotification) AsNewDiscoveredAPINotification() (NewDiscoveredAPINotification, error)

AsNewDiscoveredAPINotification returns the union data inside the APIClarityNotification as a NewDiscoveredAPINotification

func (APIClarityNotification) AsSpecDiffsNotification

func (t APIClarityNotification) AsSpecDiffsNotification() (SpecDiffsNotification, error)

AsSpecDiffsNotification returns the union data inside the APIClarityNotification as a SpecDiffsNotification

func (APIClarityNotification) AsTestProgressNotification

func (t APIClarityNotification) AsTestProgressNotification() (TestProgressNotification, error)

AsTestProgressNotification returns the union data inside the APIClarityNotification as a TestProgressNotification

func (APIClarityNotification) AsTestReportNotification

func (t APIClarityNotification) AsTestReportNotification() (TestReportNotification, error)

AsTestReportNotification returns the union data inside the APIClarityNotification as a TestReportNotification

func (APIClarityNotification) Discriminator

func (t APIClarityNotification) Discriminator() (string, error)

func (*APIClarityNotification) FromApiFindingsNotification

func (t *APIClarityNotification) FromApiFindingsNotification(v ApiFindingsNotification) error

FromApiFindingsNotification overwrites any union data inside the APIClarityNotification as the provided ApiFindingsNotification

func (*APIClarityNotification) FromAuthorizationModelNotification

func (t *APIClarityNotification) FromAuthorizationModelNotification(v AuthorizationModelNotification) error

FromAuthorizationModelNotification overwrites any union data inside the APIClarityNotification as the provided AuthorizationModelNotification

func (*APIClarityNotification) FromNewDiscoveredAPINotification

func (t *APIClarityNotification) FromNewDiscoveredAPINotification(v NewDiscoveredAPINotification) error

FromNewDiscoveredAPINotification overwrites any union data inside the APIClarityNotification as the provided NewDiscoveredAPINotification

func (*APIClarityNotification) FromSpecDiffsNotification

func (t *APIClarityNotification) FromSpecDiffsNotification(v SpecDiffsNotification) error

FromSpecDiffsNotification overwrites any union data inside the APIClarityNotification as the provided SpecDiffsNotification

func (*APIClarityNotification) FromTestProgressNotification

func (t *APIClarityNotification) FromTestProgressNotification(v TestProgressNotification) error

FromTestProgressNotification overwrites any union data inside the APIClarityNotification as the provided TestProgressNotification

func (*APIClarityNotification) FromTestReportNotification

func (t *APIClarityNotification) FromTestReportNotification(v TestReportNotification) error

FromTestReportNotification overwrites any union data inside the APIClarityNotification as the provided TestReportNotification

func (APIClarityNotification) MarshalJSON

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

func (*APIClarityNotification) MergeApiFindingsNotification

func (t *APIClarityNotification) MergeApiFindingsNotification(v ApiFindingsNotification) error

MergeApiFindingsNotification performs a merge with any union data inside the APIClarityNotification, using the provided ApiFindingsNotification

func (*APIClarityNotification) MergeAuthorizationModelNotification

func (t *APIClarityNotification) MergeAuthorizationModelNotification(v AuthorizationModelNotification) error

MergeAuthorizationModelNotification performs a merge with any union data inside the APIClarityNotification, using the provided AuthorizationModelNotification

func (*APIClarityNotification) MergeNewDiscoveredAPINotification

func (t *APIClarityNotification) MergeNewDiscoveredAPINotification(v NewDiscoveredAPINotification) error

MergeNewDiscoveredAPINotification performs a merge with any union data inside the APIClarityNotification, using the provided NewDiscoveredAPINotification

func (*APIClarityNotification) MergeSpecDiffsNotification

func (t *APIClarityNotification) MergeSpecDiffsNotification(v SpecDiffsNotification) error

MergeSpecDiffsNotification performs a merge with any union data inside the APIClarityNotification, using the provided SpecDiffsNotification

func (*APIClarityNotification) MergeTestProgressNotification

func (t *APIClarityNotification) MergeTestProgressNotification(v TestProgressNotification) error

MergeTestProgressNotification performs a merge with any union data inside the APIClarityNotification, using the provided TestProgressNotification

func (*APIClarityNotification) MergeTestReportNotification

func (t *APIClarityNotification) MergeTestReportNotification(v TestReportNotification) error

MergeTestReportNotification performs a merge with any union data inside the APIClarityNotification, using the provided TestReportNotification

func (*APIClarityNotification) UnmarshalJSON

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

func (APIClarityNotification) ValueByDiscriminator

func (t APIClarityNotification) ValueByDiscriminator() (interface{}, error)

type APIFindings

type APIFindings struct {
	// Items A list of findings
	Items *[]externalRef0.APIFinding `json:"items,omitempty"`
}

APIFindings A group of findings

type ApiFindingsNotification

type ApiFindingsNotification struct {
	// Items A list of findings
	Items            *[]externalRef0.APIFinding `json:"items,omitempty"`
	NotificationType string                     `json:"notificationType"`
}

ApiFindingsNotification defines model for ApiFindingsNotification.

type ApiInfo

type ApiInfo struct {
	DestinationNamespace *string `json:"destinationNamespace,omitempty"`
	HasProvidedSpec      *bool   `json:"hasProvidedSpec,omitempty"`
	HasReconstructedSpec *bool   `json:"hasReconstructedSpec,omitempty"`
	Id                   *uint32 `json:"id,omitempty"`

	// Name API name
	Name *string `json:"name,omitempty"`
	Port *int    `json:"port,omitempty"`

	// TraceSourceId Trace Source ID which created this API. Null UUID 0 means it has been created by APIClarity (from the UI for example)
	TraceSourceId *openapi_types.UUID `json:"traceSourceId,omitempty"`
}

ApiInfo defines model for ApiInfo.

type AuthorizationModel

type AuthorizationModel struct {
	Learning   bool                                       `json:"learning"`
	Operations []externalRef1.AuthorizationModelOperation `json:"operations"`
	SpecType   externalRef1.SpecType                      `json:"specType"`
}

AuthorizationModel defines model for AuthorizationModel.

type AuthorizationModelNotification

type AuthorizationModelNotification struct {
	Learning         bool                                       `json:"learning"`
	NotificationType string                                     `json:"notificationType"`
	Operations       []externalRef1.AuthorizationModelOperation `json:"operations"`
	SpecType         externalRef1.SpecType                      `json:"specType"`
}

AuthorizationModelNotification defines model for AuthorizationModelNotification.

type BaseNotification

type BaseNotification struct {
	NotificationType string `json:"notificationType"`
}

BaseNotification Base Notification all APIClarity notifications must extend

type ChiServerOptions

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

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) PostNotificationApiID

func (c *Client) PostNotificationApiID(ctx context.Context, apiID int64, body PostNotificationApiIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostNotificationApiIDWithBody

func (c *Client) PostNotificationApiIDWithBody(ctx context.Context, apiID int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// PostNotificationApiID request with any body
	PostNotificationApiIDWithBody(ctx context.Context, apiID int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostNotificationApiID(ctx context.Context, apiID int64, body PostNotificationApiIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) PostNotificationApiIDWithBodyWithResponse

func (c *ClientWithResponses) PostNotificationApiIDWithBodyWithResponse(ctx context.Context, apiID int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostNotificationApiIDResponse, error)

PostNotificationApiIDWithBodyWithResponse request with arbitrary body returning *PostNotificationApiIDResponse

func (*ClientWithResponses) PostNotificationApiIDWithResponse

func (c *ClientWithResponses) PostNotificationApiIDWithResponse(ctx context.Context, apiID int64, body PostNotificationApiIDJSONRequestBody, reqEditors ...RequestEditorFn) (*PostNotificationApiIDResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// PostNotificationApiID request with any body
	PostNotificationApiIDWithBodyWithResponse(ctx context.Context, apiID int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostNotificationApiIDResponse, error)

	PostNotificationApiIDWithResponse(ctx context.Context, apiID int64, body PostNotificationApiIDJSONRequestBody, reqEditors ...RequestEditorFn) (*PostNotificationApiIDResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

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 MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type NewDiscoveredAPINotification

type NewDiscoveredAPINotification struct {
	DestinationNamespace *string `json:"destinationNamespace,omitempty"`
	HasProvidedSpec      *bool   `json:"hasProvidedSpec,omitempty"`
	HasReconstructedSpec *bool   `json:"hasReconstructedSpec,omitempty"`
	Id                   *uint32 `json:"id,omitempty"`

	// Name API name
	Name             *string `json:"name,omitempty"`
	NotificationType string  `json:"notificationType"`
	Port             *int    `json:"port,omitempty"`

	// TraceSourceId Trace Source ID which created this API. Null UUID 0 means it has been created by APIClarity (from the UI for example)
	TraceSourceId *openapi_types.UUID `json:"traceSourceId,omitempty"`
}

NewDiscoveredAPINotification defines model for NewDiscoveredAPINotification.

type PostNotificationApiIDJSONRequestBody

type PostNotificationApiIDJSONRequestBody = APIClarityNotification

PostNotificationApiIDJSONRequestBody defines body for PostNotificationApiID for application/json ContentType.

type PostNotificationApiIDResponse

type PostNotificationApiIDResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *string
}

func ParsePostNotificationApiIDResponse

func ParsePostNotificationApiIDResponse(rsp *http.Response) (*PostNotificationApiIDResponse, error)

ParsePostNotificationApiIDResponse parses an HTTP response from a PostNotificationApiIDWithResponse call

func (PostNotificationApiIDResponse) Status

Status returns HTTPResponse.Status

func (PostNotificationApiIDResponse) StatusCode

func (r PostNotificationApiIDResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

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 ServerInterface

type ServerInterface interface {
	// Provide to Apiclarity list of raw input for a given API ID associated with a given timestamp
	// (POST /notification/{apiID})
	PostNotificationApiID(w http.ResponseWriter, r *http.Request, apiID int64)
}

ServerInterface represents all server handlers.

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) PostNotificationApiID

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

PostNotificationApiID operation middleware

type ShortTestProgress

type ShortTestProgress struct {
	ApiID *externalRef0.ApiID `json:"apiID,omitempty"`

	// Progress Progress of the test
	Progress int `json:"progress"`

	// Starttime Timestamp of the start of the test
	Starttime int64 `json:"starttime"`
}

ShortTestProgress Describes the progress of an ongoing test

type ShortTestReport

type ShortTestReport struct {
	ApiID *externalRef0.ApiID `json:"apiID,omitempty"`

	// HighestSeverity Severity of a finding
	HighestSeverity *externalRef0.Severity `json:"highestSeverity,omitempty"`

	// Starttime Timestamp of the start of the test
	Starttime int64 `json:"starttime"`

	// Status An enumeration.
	Status externalRef1.FuzzingStatusEnum `json:"status"`

	// StatusMessage Message for status details, if any
	StatusMessage *string                          `json:"statusMessage,omitempty"`
	Tags          *[]externalRef1.FuzzingReportTag `json:"tags,omitempty"`
}

ShortTestReport Short Test Report

type SpecDiffs

type SpecDiffs struct {
	Diffs externalRef1.APIDiffs `json:"diffs"`
}

SpecDiffs defines model for SpecDiffs.

type SpecDiffsNotification

type SpecDiffsNotification struct {
	Diffs            externalRef1.APIDiffs `json:"diffs"`
	NotificationType string                `json:"notificationType"`
}

SpecDiffsNotification defines model for SpecDiffsNotification.

type TestProgressNotification

type TestProgressNotification struct {
	ApiID            *externalRef0.ApiID `json:"apiID,omitempty"`
	NotificationType string              `json:"notificationType"`

	// Progress Progress of the test
	Progress int `json:"progress"`

	// Starttime Timestamp of the start of the test
	Starttime int64 `json:"starttime"`
}

TestProgressNotification defines model for TestProgressNotification.

type TestReportNotification

type TestReportNotification struct {
	ApiID *externalRef0.ApiID `json:"apiID,omitempty"`

	// HighestSeverity Severity of a finding
	HighestSeverity  *externalRef0.Severity `json:"highestSeverity,omitempty"`
	NotificationType string                 `json:"notificationType"`

	// Starttime Timestamp of the start of the test
	Starttime int64 `json:"starttime"`

	// Status An enumeration.
	Status externalRef1.FuzzingStatusEnum `json:"status"`

	// StatusMessage Message for status details, if any
	StatusMessage *string                          `json:"statusMessage,omitempty"`
	Tags          *[]externalRef1.FuzzingReportTag `json:"tags,omitempty"`
}

TestReportNotification defines model for TestReportNotification.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

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 UnmarshallingParamError

type UnmarshallingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshallingParamError) Error

func (e *UnmarshallingParamError) Error() string

func (*UnmarshallingParamError) Unwrap

func (e *UnmarshallingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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