nginx

package
v0.0.0-...-e5371cd Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_apis_nginx_filter_proto protoreflect.FileDescriptor
View Source
var NginxFilter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "filter.NginxFilter",
	HandlerType: (*NginxFilterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Handle",
			Handler:    _NginxFilter_Handle_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apis/nginx/filter.proto",
}

NginxFilter_ServiceDesc is the grpc.ServiceDesc for NginxFilter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterNginxFilterServer

func RegisterNginxFilterServer(s grpc.ServiceRegistrar, srv NginxFilterServer)

Types

type Decision

type Decision struct {

	// Action can be allow (0), deny (1) or redirect (2)
	Action int32 `protobuf:"varint,1,opt,name=action,proto3" json:"action,omitempty"`
	// Message defines an arbitrary message justifying the decision
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// DecisionID defines an identifier of a rule that took the decision. Can be empty
	Decisionid int32 `protobuf:"varint,3,opt,name=decisionid,proto3" json:"decisionid,omitempty"`
	// Status can be used if the filter wants to force on its decision
	Statuscode int32 `protobuf:"varint,4,opt,name=statuscode,proto3" json:"statuscode,omitempty"` // TODO: Define additional data?
	// contains filtered or unexported fields
}

Decision defines a decision taken by the filter and an additional message to be sent to NGINX. The fields below are highly inspired on mod_security/coraza interruption fields https://github.com/corazawaf/coraza/blob/82157f85f24c6107667bf0f686b71a72aafdf8a5/types/waf.go#L165

func (*Decision) Descriptor deprecated

func (*Decision) Descriptor() ([]byte, []int)

Deprecated: Use Decision.ProtoReflect.Descriptor instead.

func (*Decision) GetAction

func (x *Decision) GetAction() int32

func (*Decision) GetDecisionid

func (x *Decision) GetDecisionid() int32

func (*Decision) GetMessage

func (x *Decision) GetMessage() string

func (*Decision) GetStatuscode

func (x *Decision) GetStatuscode() int32

func (*Decision) ProtoMessage

func (*Decision) ProtoMessage()

func (*Decision) ProtoReflect

func (x *Decision) ProtoReflect() protoreflect.Message

func (*Decision) Reset

func (x *Decision) Reset()

func (*Decision) String

func (x *Decision) String() string

type FilterRequest

type FilterRequest struct {

	// ID defines the request ID. This information can be used later to check with a subsequent response
	Id      string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version string            `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Headers map[string]string `` /* 155-byte string literal not displayed */
	Body    []byte            `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// Types that are assignable to Operation:
	//
	//	*FilterRequest_Request
	//	*FilterRequest_Response
	Operation isFilterRequest_Operation `protobuf_oneof:"operation"`
	// contains filtered or unexported fields
}

func (*FilterRequest) Descriptor deprecated

func (*FilterRequest) Descriptor() ([]byte, []int)

Deprecated: Use FilterRequest.ProtoReflect.Descriptor instead.

func (*FilterRequest) GetBody

func (x *FilterRequest) GetBody() []byte

func (*FilterRequest) GetHeaders

func (x *FilterRequest) GetHeaders() map[string]string

func (*FilterRequest) GetId

func (x *FilterRequest) GetId() string

func (*FilterRequest) GetOperation

func (m *FilterRequest) GetOperation() isFilterRequest_Operation

func (*FilterRequest) GetRequest

func (x *FilterRequest) GetRequest() *Request

func (*FilterRequest) GetResponse

func (x *FilterRequest) GetResponse() *Response

func (*FilterRequest) GetVersion

func (x *FilterRequest) GetVersion() string

func (*FilterRequest) ProtoMessage

func (*FilterRequest) ProtoMessage()

func (*FilterRequest) ProtoReflect

func (x *FilterRequest) ProtoReflect() protoreflect.Message

func (*FilterRequest) Reset

func (x *FilterRequest) Reset()

func (*FilterRequest) String

func (x *FilterRequest) String() string

type FilterRequest_Request

type FilterRequest_Request struct {
	Request *Request `protobuf:"bytes,10,opt,name=request,proto3,oneof"`
}

type FilterRequest_Response

type FilterRequest_Response struct {
	Response *Response `protobuf:"bytes,11,opt,name=response,proto3,oneof"`
}

type NginxFilterClient

type NginxFilterClient interface {
	// Handle defines a remote call that will receive the HTTP request
	// and return the decision before NGINX can pass it to the next filter or
	// to the backends
	Handle(ctx context.Context, in *FilterRequest, opts ...grpc.CallOption) (*Decision, error)
}

NginxFilterClient is the client API for NginxFilter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type NginxFilterServer

type NginxFilterServer interface {
	// Handle defines a remote call that will receive the HTTP request
	// and return the decision before NGINX can pass it to the next filter or
	// to the backends
	Handle(context.Context, *FilterRequest) (*Decision, error)
	// contains filtered or unexported methods
}

NginxFilterServer is the server API for NginxFilter service. All implementations must embed UnimplementedNginxFilterServer for forward compatibility

type Request

type Request struct {
	Srcip   string `protobuf:"bytes,2,opt,name=srcip,proto3" json:"srcip,omitempty"`
	Srcport int32  `protobuf:"varint,3,opt,name=srcport,proto3" json:"srcport,omitempty"`
	Dstip   string `protobuf:"bytes,4,opt,name=dstip,proto3" json:"dstip,omitempty"`
	Dstport int32  `protobuf:"varint,5,opt,name=dstport,proto3" json:"dstport,omitempty"`
	Method  string `protobuf:"bytes,6,opt,name=method,proto3" json:"method,omitempty"`
	Path    string `protobuf:"bytes,7,opt,name=path,proto3" json:"path,omitempty"`
	Query   string `protobuf:"bytes,8,opt,name=query,proto3" json:"query,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

func (*Request) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetDstip

func (x *Request) GetDstip() string

func (*Request) GetDstport

func (x *Request) GetDstport() int32

func (*Request) GetMethod

func (x *Request) GetMethod() string

func (*Request) GetPath

func (x *Request) GetPath() string

func (*Request) GetQuery

func (x *Request) GetQuery() string

func (*Request) GetSrcip

func (x *Request) GetSrcip() string

func (*Request) GetSrcport

func (x *Request) GetSrcport() int32

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {
	Statuscode int32 `protobuf:"varint,1,opt,name=statuscode,proto3" json:"statuscode,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetStatuscode

func (x *Response) GetStatuscode() int32

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type UnimplementedNginxFilterServer

type UnimplementedNginxFilterServer struct {
}

UnimplementedNginxFilterServer must be embedded to have forward compatible implementations.

func (UnimplementedNginxFilterServer) Handle

type UnsafeNginxFilterServer

type UnsafeNginxFilterServer interface {
	// contains filtered or unexported methods
}

UnsafeNginxFilterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NginxFilterServer will result in compilation errors.

Jump to

Keyboard shortcuts

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