mirror of
https://github.com/SigNoz/signoz.git
synced 2026-03-05 21:32:00 +00:00
## 📄 Summary
- Instead of relying on JWT for session management, we are adding another token system: opaque. This gives the benefits of expiration and revocation.
- We are now ensuring that emails are regex checked throughout the backend.
- Support has been added for OIDC protocol
55 lines
978 B
Go
55 lines
978 B
Go
package user
|
|
|
|
import (
|
|
"github.com/SigNoz/signoz/pkg/types"
|
|
"github.com/SigNoz/signoz/pkg/valuer"
|
|
)
|
|
|
|
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
|
|
}
|
|
|
|
type authenticateOptions struct {
|
|
OrgID valuer.UUID
|
|
}
|
|
|
|
type AuthenticateOption func(*authenticateOptions)
|
|
|
|
func WithOrgID(orgID valuer.UUID) AuthenticateOption {
|
|
return func(o *authenticateOptions) {
|
|
o.OrgID = orgID
|
|
}
|
|
}
|
|
|
|
func NewAuthenticateOptions(opts ...AuthenticateOption) *authenticateOptions {
|
|
o := &authenticateOptions{
|
|
OrgID: valuer.UUID{},
|
|
}
|
|
|
|
for _, opt := range opts {
|
|
opt(o)
|
|
}
|
|
|
|
return o
|
|
}
|