flame/models.go
func (a *Application) Validate() error {
	// hash password if available
	err := a.HashSecret()
	if err != nil {
		return err
	}

	// check id
	if !a.ID().Valid() {
		return fire.E("invalid id")
	}

	// check name
	if a.Name == "" {
		return fire.E("name not set")
	}

	// check key
	if a.Key == "" {
		return fire.E("key not set")
	}

	// check secret hash
	if len(a.SecretHash) == 0 {
		return fire.E("secret hash not set")
	}

	// check redirect uri
	if a.RedirectURL != "" && !govalidator.IsURL(a.RedirectURL) {
		return fire.E("invalid redirect url")
	}

	return nil
}
func (a *Application) Validate() error {
	// hash password if available
	err := a.HashSecret()
	if err != nil {
		return err
	}

	// check id
	if !a.ID().Valid() {
		return fire.E("invalid id")
	}

	// check name
	if a.Name == "" {
		return fire.E("name not set")
	}

	// check key
	if a.Key == "" {
		return fire.E("key not set")
	}

	// check secret hash
	if len(a.SecretHash) == 0 {
		return fire.E("secret hash not set")
	}

	// check redirect uri
	if a.RedirectURL != "" && !govalidator.IsURL(a.RedirectURL) {
		return fire.E("invalid redirect url")
	}

	return nil
}
// Validate implements the coal.ValidatableModel interface.