Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ParentValidator ¶
type ParentValidator struct {
// contains filtered or unexported fields
}
ParentValidator validates that response resources are children of requested parent resources.
func NewParentValidator ¶
func NewParentValidator(config ParentValidatorConfig) *ParentValidator
NewParentValidator creates a new parent validator middleware.
func (*ParentValidator) UnaryServerInterceptor ¶
func (p *ParentValidator) UnaryServerInterceptor( ctx context.Context, request interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (interface{}, error)
UnaryServerInterceptor implements grpc.UnaryServerInterceptor.
type ParentValidatorConfig ¶
type ParentValidatorConfig struct { // ErrorLogHook is called when parent validation fails, with the failing request/response, parent/name combination. ErrorLogHook func(info *grpc.UnaryServerInfo, request, response proto.Message, parent, name string) // LogOnly configures the middleware to only log violations and not return errors. LogOnly bool }
ParentValidatorConfig configures the ParentValidator middleware.
Click to show internal directories.
Click to hide internal directories.