using System.Threading.Tasks;
namespace VanadiumGuard.Server.Security
{
///
/// Verifies the bearer token a client presents at session open and returns the player
/// id it belongs to. Implement this against your existing auth service.
///
public interface IPlayerAuthenticator
{
/// Returns the authenticated player id, or null when the token is not valid.
Task AuthenticateAsync(string? bearerToken);
}
///
/// Development stand-in that trusts whatever the client claims.
///
/// It refuses to run outside Development precisely because trusting the client about
/// who it is would let anyone file detections against anyone else.
///
///
public sealed class TrustClaimedIdentityAuthenticator : IPlayerAuthenticator
{
public Task AuthenticateAsync(string? bearerToken)
{
return Task.FromResult(string.IsNullOrEmpty(bearerToken) ? null : bearerToken);
}
}
}