#include "file_based_authenticator.hpp"

namespace fz::authentication
{

bool file_based_authenticator::is_idp_user(const users::value_type &u)
{
	return u.second.identity && u.first == username_for_idp(u.second.identity->idp);
}

std::string file_based_authenticator::username_for_idp(const identity_provider &idp)
{
	return username_for_idp(idp.get_name());
}

std::string file_based_authenticator::username_for_idp(std::string_view idp_name)
{
	return fz::sprintf("<%s user>", idp_name);
}

}
