grafana/pkg/models/user.go
idafurjes 325f7a789e
Chore: Delete duplicate models for user (#60906)
* Delete duplicate models for user

* Use new models in some tests

* Add auth model conversion back
2023-01-03 15:25:35 +01:00

27 lines
570 B
Go

package models
type Password string
func (p Password) IsWeak() bool {
return len(p) <= 4
}
type UserIdDTO struct {
Id int64 `json:"id"`
Message string `json:"message"`
}
// implement Conversion interface to define custom field mapping (xorm feature)
type AuthModuleConversion []string
func (auth *AuthModuleConversion) FromDB(data []byte) error {
auth_module := string(data)
*auth = []string{auth_module}
return nil
}
// Just a stub, we don't want to write to database
func (auth *AuthModuleConversion) ToDB() ([]byte, error) {
return []byte{}, nil
}