security

package
v0.0.0-...-0643f43 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthInterceptor

func DefaultAuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

DefaultAuthInterceptor is a no-op interceptor that allows all requests.

func NewWAFInterceptor

func NewWAFInterceptor(rules WAFRule) grpc.UnaryServerInterceptor

NewWAFInterceptor creates an interceptor that blocks requests containing specific substrings. This is a demonstration interceptor for testing/validating general interceptor logic. It shows how to implement custom security policies as gRPC interceptors.

Types

type WAFRule

type WAFRule struct {
	BlockedSubstrings []string
}

WAFRule defines a rule for the Web Application Firewall. This is an example/testing implementation to demonstrate gRPC interceptor patterns. Production systems should implement domain-specific security policies.

Jump to

Keyboard shortcuts

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