// userFromUserItems is an extended variant of itemToUser which can be used
// with the `userItems` collector to include additional backend.Item values
// such as password hash or u2f registration.
userFromUserItems is an extended variant of itemToUser which can be used
with the `userItems` collector to include additional backend.Item values
such as password hash or u2f registration.
// userFromUserItems is an extended variant of itemToUser which can be used // with the ` userItems ` collector to include additional backend . Item values // such as password hash or u2f registration .
func userFromUserItems(name string, items userItems) (services.User, error) {
	if items.params == nil {
		return nil, trace.BadParameter("cannot itemTo user %q without primary item %q", name, paramsPrefix)
	}
	user, err := itemToUser(*items.params)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	if items.Len() < 2 {
		return user, nil
	}
	auth, err := itemToLocalAuthSecrets(items)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	user.SetLocalAuth(auth)
	return user, nil
}
func userFromUserItems ( name string , items userItems ) ( services . User , error ) { if items . params == nil { return nil , trace . BadParameter ( " " , name , paramsPrefix ) } user , err := itemToUser ( * items . params ) if err != nil { return nil , trace . Wrap ( err ) } if items . Len ( ) < 2 { return user , nil } auth , err := itemToLocalAuthSecrets ( items ) if err != nil { return nil , trace . Wrap ( err ) } user . SetLocalAuth ( auth ) return user , nil }
userFromUserItems is an extended variant of itemToUser which can be used
with the `userItems` collector to include additional backend.Item values
such as password hash or u2f registration.
userFromUserItems is an extended variant of itemToUser which can be used with the ` userItems ` collector to include additional backend . Item values such as password hash or u2f registration .