user/users.go
func (m *DefaultManager) SyncUsers(uaaUsers *uaa.Users, usersInput UsersInput) error {
	roleUsers, err := usersInput.ListUsers(usersInput, uaaUsers)
	if err != nil {
		return err
	}
	lo.G.Debugf("Current Users In Role %+v", roleUsers.Users())

	if err := m.SyncLdapUsers(roleUsers, uaaUsers, usersInput); err != nil {
		return errors.Wrap(err, "adding ldap users")
	}
	if len(roleUsers.Users()) > 0 {
		lo.G.Debugf("Users after LDAP sync %+v", roleUsers.Users())
	}

	if err := m.SyncInternalUsers(roleUsers, uaaUsers, usersInput); err != nil {
		return errors.Wrap(err, "adding internal users")
	}
	if len(roleUsers.Users()) > 0 {
		lo.G.Debugf("Users after Internal sync %+v", roleUsers.Users())
	}

	if err := m.SyncSamlUsers(roleUsers, uaaUsers, usersInput); err != nil {
		return errors.Wrap(err, "adding saml users")
	}
	if len(roleUsers.Users()) > 0 {
		lo.G.Debugf("Users after SAML sync %+v", roleUsers.Users())
	}

	if err := m.RemoveUsers(roleUsers, usersInput); err != nil {
		return errors.Wrap(err, "removing users")
	}
	return nil
}
func (m *DefaultManager) SyncUsers(uaaUsers *uaa.Users, usersInput UsersInput) error {
	roleUsers, err := usersInput.ListUsers(usersInput, uaaUsers)
	if err != nil {
		return err
	}
	lo.G.Debugf("Current Users In Role %+v", roleUsers.Users())

	if err := m.SyncLdapUsers(roleUsers, uaaUsers, usersInput); err != nil {
		return errors.Wrap(err, "adding ldap users")
	}
	if len(roleUsers.Users()) > 0 {
		lo.G.Debugf("Users after LDAP sync %+v", roleUsers.Users())
	}

	if err := m.SyncInternalUsers(roleUsers, uaaUsers, usersInput); err != nil {
		return errors.Wrap(err, "adding internal users")
	}
	if len(roleUsers.Users()) > 0 {
		lo.G.Debugf("Users after Internal sync %+v", roleUsers.Users())
	}

	if err := m.SyncSamlUsers(roleUsers, uaaUsers, usersInput); err != nil {
		return errors.Wrap(err, "adding saml users")
	}
	if len(roleUsers.Users()) > 0 {
		lo.G.Debugf("Users after SAML sync %+v", roleUsers.Users())
	}

	if err := m.RemoveUsers(roleUsers, usersInput); err != nil {
		return errors.Wrap(err, "removing users")
	}
	return nil
}
//SyncUsers