Files
signoz/pkg/modules/user/option.go
Vibhu Pandey c122bc09b4 feat(tokenizer|sso): add tokenizer for session management and oidc sso support (#9183)
## 📄 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
2025-10-16 18:00:38 +05:30

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
}