Documentation ¶
Index ¶
- Variables
- func RegisterNginxFilterServer(s grpc.ServiceRegistrar, srv NginxFilterServer)
- type Decision
- func (*Decision) Descriptor() ([]byte, []int)deprecated
- func (x *Decision) GetAction() int32
- func (x *Decision) GetDecisionid() int32
- func (x *Decision) GetMessage() string
- func (x *Decision) GetStatuscode() int32
- func (*Decision) ProtoMessage()
- func (x *Decision) ProtoReflect() protoreflect.Message
- func (x *Decision) Reset()
- func (x *Decision) String() string
- type FilterRequest
- func (*FilterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *FilterRequest) GetBody() []byte
- func (x *FilterRequest) GetHeaders() map[string]string
- func (x *FilterRequest) GetId() string
- func (m *FilterRequest) GetOperation() isFilterRequest_Operation
- func (x *FilterRequest) GetRequest() *Request
- func (x *FilterRequest) GetResponse() *Response
- func (x *FilterRequest) GetVersion() string
- func (*FilterRequest) ProtoMessage()
- func (x *FilterRequest) ProtoReflect() protoreflect.Message
- func (x *FilterRequest) Reset()
- func (x *FilterRequest) String() string
- type FilterRequest_Request
- type FilterRequest_Response
- type NginxFilterClient
- type NginxFilterServer
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetDstip() string
- func (x *Request) GetDstport() int32
- func (x *Request) GetMethod() string
- func (x *Request) GetPath() string
- func (x *Request) GetQuery() string
- func (x *Request) GetSrcip() string
- func (x *Request) GetSrcport() int32
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- type Response
- type UnimplementedNginxFilterServer
- type UnsafeNginxFilterServer
Constants ¶
This section is empty.
Variables ¶
var File_apis_nginx_filter_proto protoreflect.FileDescriptor
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) GetDecisionid ¶
func (*Decision) GetMessage ¶
func (*Decision) GetStatuscode ¶
func (*Decision) ProtoMessage ¶
func (*Decision) ProtoMessage()
func (*Decision) ProtoReflect ¶
func (x *Decision) ProtoReflect() protoreflect.Message
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.
func NewNginxFilterClient ¶
func NewNginxFilterClient(cc grpc.ClientConnInterface) NginxFilterClient
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) GetDstport ¶
func (*Request) GetSrcport ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
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) GetStatuscode ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedNginxFilterServer ¶
type UnimplementedNginxFilterServer struct { }
UnimplementedNginxFilterServer must be embedded to have forward compatible implementations.
func (UnimplementedNginxFilterServer) Handle ¶
func (UnimplementedNginxFilterServer) Handle(context.Context, *FilterRequest) (*Decision, error)
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.