signoz/pkg/http/binding/binding.go
Vibhu Pandey 360e8309c8
feat(password): implement strong controls for password (#8983)
## 📄 Summary

implement strong controls for password. Now the password requirement is : 

password must be at least 12 characters long, should contain at least one uppercase letter [A-Z], one lowercase letter [a-z], one number [0-9], and one symbol
2025-09-04 17:22:28 +05:30

39 lines
731 B
Go

package binding
import (
"io"
"github.com/SigNoz/signoz/pkg/errors"
)
var (
ErrCodeInvalidRequestBody = errors.MustNewCode("invalid_request_body")
)
var (
JSON Binding = &jsonBinding{}
)
type bindBodyOptions struct {
DisallowUnknownFields bool
UseNumber bool
}
type BindBodyOption func(*bindBodyOptions)
func WithDisallowUnknownFields(disallowUnknownFields bool) BindBodyOption {
return func(options *bindBodyOptions) {
options.DisallowUnknownFields = disallowUnknownFields
}
}
func WithUseNumber(useNumber bool) BindBodyOption {
return func(options *bindBodyOptions) {
options.UseNumber = useNumber
}
}
type Binding interface {
BindBody(body io.Reader, obj any, opts ...BindBodyOption) error
}