mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
325f7a789e
* Delete duplicate models for user * Use new models in some tests * Add auth model conversion back
27 lines
570 B
Go
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
|
|
}
|