mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 15:36:48 +00:00
## 📄 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
28 lines
519 B
Go
28 lines
519 B
Go
package user
|
|
|
|
import "github.com/SigNoz/signoz/pkg/types"
|
|
|
|
type createUserOptions struct {
|
|
FactorPassword *types.FactorPassword
|
|
}
|
|
|
|
type CreateUserOption func(*createUserOptions)
|
|
|
|
func WithFactorPassword(factorPassword *types.FactorPassword) CreateUserOption {
|
|
return func(o *createUserOptions) {
|
|
o.FactorPassword = factorPassword
|
|
}
|
|
}
|
|
|
|
func NewCreateUserOptions(opts ...CreateUserOption) *createUserOptions {
|
|
o := &createUserOptions{
|
|
FactorPassword: nil,
|
|
}
|
|
|
|
for _, opt := range opts {
|
|
opt(o)
|
|
}
|
|
|
|
return o
|
|
}
|